eotdl 2023.11.3.post4__py3-none-any.whl → 2024.2.15__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. eotdl/__init__.py +1 -1
  2. eotdl/access/__init__.py +0 -0
  3. eotdl/access/airbus/__init__.py +0 -0
  4. eotdl/access/airbus/client.py +0 -0
  5. eotdl/access/airbus/parameters.py +0 -0
  6. eotdl/access/airbus/utils.py +0 -0
  7. eotdl/access/download.py +0 -0
  8. eotdl/access/search.py +0 -0
  9. eotdl/access/sentinelhub/__init__.py +0 -0
  10. eotdl/access/sentinelhub/client.py +0 -0
  11. eotdl/access/sentinelhub/evalscripts.py +0 -4
  12. eotdl/access/sentinelhub/parameters.py +3 -4
  13. eotdl/access/sentinelhub/utils.py +2 -1
  14. eotdl/auth/__init__.py +0 -0
  15. eotdl/auth/auth.py +43 -29
  16. eotdl/auth/errors.py +0 -0
  17. eotdl/auth/is_logged.py +0 -0
  18. eotdl/auth/logout.py +0 -0
  19. eotdl/cli.py +0 -0
  20. eotdl/commands/__init__.py +0 -0
  21. eotdl/commands/auth.py +0 -0
  22. eotdl/commands/datasets.py +0 -0
  23. eotdl/commands/models.py +0 -0
  24. eotdl/curation/__init__.py +0 -0
  25. eotdl/curation/stac/__init__.py +0 -0
  26. eotdl/curation/stac/assets.py +3 -43
  27. eotdl/curation/stac/dataframe.py +14 -3
  28. eotdl/curation/stac/dataframe_bck.py +0 -0
  29. eotdl/curation/stac/dataframe_labeling.py +0 -0
  30. eotdl/curation/stac/extensions/__init__.py +0 -0
  31. eotdl/curation/stac/extensions/base.py +0 -0
  32. eotdl/curation/stac/extensions/dem.py +0 -0
  33. eotdl/curation/stac/extensions/eo.py +0 -0
  34. eotdl/curation/stac/extensions/label/__init__.py +0 -0
  35. eotdl/curation/stac/extensions/label/base.py +0 -0
  36. eotdl/curation/stac/extensions/label/image_name_labeler.py +0 -0
  37. eotdl/curation/stac/extensions/label/scaneo.py +3 -2
  38. eotdl/curation/stac/extensions/ml_dataset.py +0 -0
  39. eotdl/curation/stac/extensions/projection.py +0 -0
  40. eotdl/curation/stac/extensions/raster.py +0 -0
  41. eotdl/curation/stac/extensions/sar.py +0 -0
  42. eotdl/curation/stac/extent.py +0 -0
  43. eotdl/curation/stac/parsers.py +0 -0
  44. eotdl/curation/stac/stac.py +0 -0
  45. eotdl/datasets/__init__.py +0 -0
  46. eotdl/datasets/download.py +4 -6
  47. eotdl/datasets/ingest.py +6 -9
  48. eotdl/datasets/metadata.py +0 -0
  49. eotdl/datasets/retrieve.py +0 -0
  50. eotdl/files/__init__.py +0 -0
  51. eotdl/files/ingest.py +6 -6
  52. eotdl/models/__init__.py +0 -0
  53. eotdl/models/download.py +1 -10
  54. eotdl/models/ingest.py +2 -2
  55. eotdl/models/metadata.py +0 -0
  56. eotdl/models/retrieve.py +0 -0
  57. eotdl/repos/APIRepo.py +7 -0
  58. eotdl/repos/AuthAPIRepo.py +9 -2
  59. eotdl/repos/AuthRepo.py +7 -3
  60. eotdl/repos/DatasetsAPIRepo.py +10 -71
  61. eotdl/repos/FilesAPIRepo.py +17 -35
  62. eotdl/repos/ModelsAPIRepo.py +4 -4
  63. eotdl/repos/__init__.py +0 -0
  64. eotdl/shared/__init__.py +0 -0
  65. eotdl/shared/checksum.py +0 -0
  66. eotdl/tools/__init__.py +0 -0
  67. eotdl/tools/geo_utils.py +0 -0
  68. eotdl/tools/metadata.py +0 -0
  69. eotdl/tools/paths.py +0 -0
  70. eotdl/tools/stac.py +0 -0
  71. eotdl/tools/time_utils.py +0 -0
  72. eotdl/tools/tools.py +4 -4
  73. {eotdl-2023.11.3.post4.dist-info → eotdl-2024.2.15.dist-info}/METADATA +2 -5
  74. {eotdl-2023.11.3.post4.dist-info → eotdl-2024.2.15.dist-info}/RECORD +24 -32
  75. eotdl/datasets/usecases/__init__.py +0 -0
  76. eotdl/datasets/usecases/datasets/DownloadFile.py +0 -30
  77. eotdl/datasets/usecases/datasets/DownloadFileURL.py +0 -22
  78. eotdl/datasets/usecases/datasets/IngestDataset.py +0 -30
  79. eotdl/datasets/usecases/datasets/IngestLargeDataset.py +0 -43
  80. eotdl/datasets/usecases/datasets/IngestLargeDatasetParallel.py +0 -51
  81. eotdl/datasets/usecases/datasets/IngestSTAC.py +0 -77
  82. eotdl/datasets/usecases/datasets/__init__.py +0 -9
  83. {eotdl-2023.11.3.post4.dist-info → eotdl-2024.2.15.dist-info}/WHEEL +0 -0
  84. {eotdl-2023.11.3.post4.dist-info → eotdl-2024.2.15.dist-info}/entry_points.txt +0 -0
@@ -20,11 +20,11 @@ class DatasetsAPIRepo(APIRepo):
20
20
  response = requests.get(url)
21
21
  return self.format_response(response)
22
22
 
23
- def create_dataset(self, metadata, id_token):
23
+ def create_dataset(self, metadata, user):
24
24
  response = requests.post(
25
25
  self.url + "datasets",
26
26
  json=metadata,
27
- headers={"Authorization": "Bearer " + id_token},
27
+ headers=self.generate_headers(user),
28
28
  )
29
29
  return self.format_response(response)
30
30
 
@@ -32,94 +32,33 @@ class DatasetsAPIRepo(APIRepo):
32
32
  response = requests.get(self.url + "datasets?name=" + name)
33
33
  return self.format_response(response)
34
34
 
35
- def create_version(self, dataset_id, id_token):
35
+ def create_version(self, dataset_id, user):
36
36
  response = requests.post(
37
37
  self.url + "datasets/version/" + dataset_id,
38
- headers={"Authorization": "Bearer " + id_token},
38
+ headers=self.generate_headers(user),
39
39
  )
40
40
  return self.format_response(response)
41
41
 
42
- def create_stac_dataset(self, name, id_token):
42
+ def create_stac_dataset(self, name, user):
43
43
  response = requests.post(
44
44
  self.url + "datasets/stac",
45
45
  json={"name": name},
46
- headers={"Authorization": "Bearer " + id_token},
46
+ headers=self.generate_headers(user),
47
47
  )
48
48
  return self.format_response(response)
49
49
 
50
- def ingest_stac(self, stac_json, dataset_id, id_token):
50
+ def ingest_stac(self, stac_json, dataset_id, user):
51
51
  response = requests.put(
52
52
  self.url + f"datasets/stac/{dataset_id}",
53
53
  json={"stac": stac_json},
54
- headers={"Authorization": "Bearer " + id_token},
54
+ headers=self.generate_headers(user),
55
55
  )
56
56
  return self.format_response(response)
57
57
 
58
- def download_stac(self, dataset_id, id_token):
58
+ def download_stac(self, dataset_id, user):
59
59
  url = self.url + "datasets/" + dataset_id + "/download"
60
- headers = {"Authorization": "Bearer " + id_token}
60
+ headers = self.generate_headers(user)
61
61
  response = requests.get(url, headers=headers)
62
62
  if response.status_code != 200:
63
63
  return None, response.json()["detail"]
64
64
  return gpd.GeoDataFrame.from_features(response.json()["features"]), None
65
-
66
- # def update_dataset(self, name, path, id_token, checksum):
67
- # # check that dataset exists
68
- # data, error = self.retrieve_dataset(name)
69
- # if error:
70
- # return None, error
71
- # # first call to get upload id
72
- # dataset_id = data["id"]
73
- # url = self.url + f"datasets/chunk/{dataset_id}?checksum={checksum}"
74
- # response = requests.get(url, headers={"Authorization": "Bearer " + id_token})
75
- # if response.status_code != 200:
76
- # return None, response.json()["detail"]
77
- # data = response.json()
78
- # _, upload_id, parts = data["dataset_id"], data["upload_id"], data["parts"]
79
- # # assert dataset_id is None
80
- # content_path = os.path.abspath(path)
81
- # content_size = os.stat(content_path).st_size
82
- # url = self.url + "datasets/chunk"
83
- # chunk_size = 1024 * 1024 * 100 # 100 MiB
84
- # total_chunks = content_size // chunk_size
85
- # headers = {
86
- # "Authorization": "Bearer " + id_token,
87
- # "Upload-Id": upload_id,
88
- # "Dataset-Id": dataset_id,
89
- # }
90
- # # upload chunks sequentially
91
- # pbar = tqdm(
92
- # self.read_in_chunks(open(content_path, "rb"), chunk_size),
93
- # total=total_chunks,
94
- # )
95
- # index = 0
96
- # for chunk in pbar:
97
- # offset = index + len(chunk)
98
- # part = index // chunk_size + 1
99
- # index = offset
100
- # if part not in parts:
101
- # headers["Part-Number"] = str(part)
102
- # file = {"file": chunk}
103
- # r = requests.post(url, files=file, headers=headers)
104
- # if r.status_code != 200:
105
- # return None, r.json()["detail"]
106
- # pbar.set_description(
107
- # "{:.2f}/{:.2f} MB".format(
108
- # offset / 1024 / 1024, content_size / 1024 / 1024
109
- # )
110
- # )
111
- # pbar.close()
112
- # # complete upload
113
- # url = self.url + "datasets/complete"
114
- # r = requests.post(
115
- # url,
116
- # json={"checksum": checksum},
117
- # headers={
118
- # "Authorization": "Bearer " + id_token,
119
- # "Upload-Id": upload_id,
120
- # "Dataset-Id": dataset_id,
121
- # },
122
- # )
123
- # if r.status_code != 200:
124
- # return None, r.json()["detail"]
125
- # return r.json(), None
@@ -15,7 +15,7 @@ class FilesAPIRepo(APIRepo):
15
15
  batch, # ziped batch of files
16
16
  checksums,
17
17
  dataset_or_model_id,
18
- id_token,
18
+ user,
19
19
  endpoint,
20
20
  version=None,
21
21
  ):
@@ -26,7 +26,7 @@ class FilesAPIRepo(APIRepo):
26
26
  url,
27
27
  files={"batch": ("batch.zip", batch)},
28
28
  data={"checksums": checksums},
29
- headers={"Authorization": "Bearer " + id_token},
29
+ headers=self.generate_headers(user),
30
30
  )
31
31
  return self.format_response(reponse)
32
32
 
@@ -35,7 +35,7 @@ class FilesAPIRepo(APIRepo):
35
35
  batch,
36
36
  dataset_or_model_id,
37
37
  version,
38
- id_token,
38
+ user,
39
39
  endpoint,
40
40
  ):
41
41
  reponse = requests.post(
@@ -44,13 +44,14 @@ class FilesAPIRepo(APIRepo):
44
44
  "filenames": [f["path"] for f in batch],
45
45
  "checksums": [f["checksum"] for f in batch],
46
46
  },
47
- headers={"Authorization": "Bearer " + id_token},
47
+ headers=self.generate_headers(user),
48
48
  )
49
49
  return self.format_response(reponse)
50
50
 
51
51
  def ingest_file(
52
- self, file, dataset_or_model_id, id_token, checksum, endpoint, version=None
52
+ self, file, dataset_or_model_id, user, checksum, endpoint, version=None
53
53
  ):
54
+ # TODO: ingest file URL
54
55
  url = self.url + f"{endpoint}/{dataset_or_model_id}"
55
56
  if version is not None:
56
57
  url += "?version=" + str(version)
@@ -58,7 +59,7 @@ class FilesAPIRepo(APIRepo):
58
59
  url,
59
60
  files={"file": open(file, "rb")},
60
61
  data={"checksum": checksum},
61
- headers={"Authorization": "Bearer " + id_token},
62
+ headers=self.generate_headers(user),
62
63
  )
63
64
  return self.format_response(reponse)
64
65
 
@@ -73,7 +74,7 @@ class FilesAPIRepo(APIRepo):
73
74
  self,
74
75
  dataset_or_model_id,
75
76
  file_name,
76
- id_token,
77
+ user,
77
78
  path,
78
79
  file_version,
79
80
  endpoint="datasets",
@@ -82,10 +83,10 @@ class FilesAPIRepo(APIRepo):
82
83
  url = self.url + f"{endpoint}/{dataset_or_model_id}/download/{file_name}"
83
84
  if file_version is not None:
84
85
  url += "?version=" + str(file_version)
85
- return self.download_file_url(url, file_name, path, id_token, progress=progress)
86
+ return self.download_file_url(url, file_name, path, user, progress=progress)
86
87
 
87
- def download_file_url(self, url, filename, path, id_token, progress=False):
88
- headers = {"Authorization": "Bearer " + id_token}
88
+ def download_file_url(self, url, filename, path, user, progress=False):
89
+ headers = self.generate_headers(user)
89
90
  path = f"{path}/{filename}"
90
91
  for i in range(1, len(path.split("/")) - 1):
91
92
  # print("/".join(path.split("/")[: i + 1]))
@@ -113,23 +114,13 @@ class FilesAPIRepo(APIRepo):
113
114
  progress_bar.close()
114
115
  return path
115
116
 
116
- # def ingest_file_url(self, file, dataset, id_token):
117
- # reponse = requests.post(
118
- # self.url + f"datasets/{dataset}/url",
119
- # json={"url": file},
120
- # headers={"Authorization": "Bearer " + id_token},
121
- # )
122
- # if reponse.status_code != 200:
123
- # return None, reponse.json()["detail"]
124
- # return reponse.json(), None
125
-
126
117
  def prepare_large_upload(
127
- self, filename, dataset_or_model_id, checksum, id_token, endpoint
118
+ self, filename, dataset_or_model_id, checksum, user, endpoint
128
119
  ):
129
120
  response = requests.post(
130
121
  self.url + f"{endpoint}/{dataset_or_model_id}/uploadId",
131
122
  json={"filname": filename, "checksum": checksum},
132
- headers={"Authorization": "Bearer " + id_token},
123
+ headers=self.generate_headers(user),
133
124
  )
134
125
  if response.status_code != 200:
135
126
  raise Exception(response.json()["detail"])
@@ -157,7 +148,7 @@ class FilesAPIRepo(APIRepo):
157
148
  yield data
158
149
 
159
150
  def ingest_large_file(
160
- self, file_path, files_size, upload_id, id_token, parts, endpoint
151
+ self, file_path, files_size, upload_id, user, parts, endpoint
161
152
  ):
162
153
  print(endpoint)
163
154
  # content_path = os.path.abspath(file)
@@ -180,7 +171,7 @@ class FilesAPIRepo(APIRepo):
180
171
  f"{self.url}{endpoint}/chunk/{upload_id}",
181
172
  files={"file": chunk},
182
173
  data={"part_number": part, "checksum": checksum},
183
- headers={"Authorization": "Bearer " + id_token},
174
+ headers=self.generate_headers(user),
184
175
  )
185
176
  if response.status_code != 200:
186
177
  raise Exception(response.json()["detail"])
@@ -192,18 +183,9 @@ class FilesAPIRepo(APIRepo):
192
183
  pbar.close()
193
184
  return
194
185
 
195
- def complete_upload(self, id_token, upload_id, version, endpoint):
186
+ def complete_upload(self, user, upload_id, version, endpoint):
196
187
  r = requests.post(
197
188
  f"{self.url}{endpoint}/complete/{upload_id}?version={version}",
198
- headers={"Authorization": "Bearer " + id_token},
189
+ headers=self.generate_headers(user),
199
190
  )
200
191
  return self.format_response(r)
201
-
202
- # def delete_file(self, dataset_id, file_name, id_token):
203
- # response = requests.delete(
204
- # self.url + "datasets/" + dataset_id + "/file/" + file_name,
205
- # headers={"Authorization": "Bearer " + id_token},
206
- # )
207
- # if response.status_code != 200:
208
- # return None, response.json()["detail"]
209
- # return response.json(), None
@@ -19,11 +19,11 @@ class ModelsAPIRepo(APIRepo):
19
19
  response = requests.get(url)
20
20
  return self.format_response(response)
21
21
 
22
- def create_model(self, metadata, id_token):
22
+ def create_model(self, metadata, user):
23
23
  response = requests.post(
24
24
  self.url + "models",
25
25
  json=metadata,
26
- headers={"Authorization": "Bearer " + id_token},
26
+ headers=self.generate_headers(user),
27
27
  )
28
28
  return self.format_response(response)
29
29
 
@@ -31,9 +31,9 @@ class ModelsAPIRepo(APIRepo):
31
31
  response = requests.get(self.url + "models?name=" + name)
32
32
  return self.format_response(response)
33
33
 
34
- def create_version(self, model_id, id_token):
34
+ def create_version(self, model_id, user):
35
35
  response = requests.post(
36
36
  self.url + "models/version/" + model_id,
37
- headers={"Authorization": "Bearer " + id_token},
37
+ headers=self.generate_headers(user),
38
38
  )
39
39
  return self.format_response(response)
eotdl/repos/__init__.py CHANGED
File without changes
eotdl/shared/__init__.py CHANGED
File without changes
eotdl/shared/checksum.py CHANGED
File without changes
eotdl/tools/__init__.py CHANGED
File without changes
eotdl/tools/geo_utils.py CHANGED
File without changes
eotdl/tools/metadata.py CHANGED
File without changes
eotdl/tools/paths.py CHANGED
File without changes
eotdl/tools/stac.py CHANGED
File without changes
eotdl/tools/time_utils.py CHANGED
File without changes
eotdl/tools/tools.py CHANGED
@@ -15,7 +15,7 @@ from shapely.geometry import box
15
15
  from .geo_utils import get_image_bbox
16
16
 
17
17
 
18
- def get_images_by_location(gdf: gpd.GeoDataFrame) -> pd.DataFrame:
18
+ def get_images_by_location(gdf: gpd.GeoDataFrame, column: str) -> pd.DataFrame:
19
19
  """
20
20
  Generate a GeoDataFrame with the available images for each location in the dataset.
21
21
 
@@ -27,7 +27,7 @@ def get_images_by_location(gdf: gpd.GeoDataFrame) -> pd.DataFrame:
27
27
  - images_count: the count of available images of each location.
28
28
  - images_dates: list with the dates of the available images of each location.
29
29
  """
30
- uniques_location_id = gdf["scene_id"].unique() # List of unique location ids
30
+ uniques_location_id = gdf[column].unique() # List of unique location ids
31
31
  uniques_location_id.sort()
32
32
 
33
33
  images_count_list, images_dates_list = [], []
@@ -35,13 +35,13 @@ def get_images_by_location(gdf: gpd.GeoDataFrame) -> pd.DataFrame:
35
35
  # Iterate the unique location ids, count the number of images per location and generate
36
36
  # a list with the dates of every image in a location
37
37
  for location_id in uniques_location_id:
38
- dates = gdf[gdf["scene_id"] == location_id]["datetime"]
38
+ dates = gdf[gdf[column] == location_id]["datetime"]
39
39
  images_count_list.append(dates.count())
40
40
  images_dates_list.append(dates.tolist())
41
41
 
42
42
  images_dates_list.sort() # Sort the list of dates
43
43
  data = {
44
- "scene_id": uniques_location_id,
44
+ column: uniques_location_id,
45
45
  "dates_count": images_count_list,
46
46
  "dates_list": images_dates_list,
47
47
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: eotdl
3
- Version: 2023.11.3.post4
3
+ Version: 2024.2.15
4
4
  Summary: Earth Observation Training Data Lab
5
5
  License: MIT
6
6
  Author: EarthPulse
@@ -29,7 +29,7 @@ Description-Content-Type: text/markdown
29
29
 
30
30
  <p align="center">
31
31
  <a href="https://www.eotdl.com/">
32
- <img src="eotdl.png" alt="EOTDL" />
32
+ <img src="https://raw.githubusercontent.com/earthpulse/eotdl/main/eotdl/eotdl.png" alt="EOTDL" style="width: 75%;"/>
33
33
  </a>
34
34
  </p>
35
35
 
@@ -40,9 +40,6 @@ Description-Content-Type: text/markdown
40
40
  <a href="https://pypi.python.org/pypi/eotdl">
41
41
  <img src="https://img.shields.io/pypi/v/eotdl.svg" alt="NPM Version" />
42
42
  </a>
43
- <a href="https://discord.eotdl.io">
44
- <img src="https://img.shields.io/discord/1024232224486326362?label=Discord" alt="EOTDL on Discord" />
45
- </a>
46
43
  </p>
47
44
 
48
45
  This is the main library and CLI for the **Earth Observation Training Data Lab** (EOTDL), a complete environment that allows you, among other things, to:
@@ -1,4 +1,4 @@
1
- eotdl/__init__.py,sha256=gSrwUZr2mBINM6QBGDwtTjXz1i4NeI31XLvjsQFYqk0,29
1
+ eotdl/__init__.py,sha256=WKZfCvNYtuas-KdIFXdxyFqYY3MyW7MCPuaqs7lEG1E,27
2
2
  eotdl/access/__init__.py,sha256=jbyjD7BRGJURlTNmtcbBBhw3Xk4EiZvkqmEykM-bJ1k,231
3
3
  eotdl/access/airbus/__init__.py,sha256=G_kkRS9eFjXbQ-aehmTLXeAxh7zpAxz_rgB7J_w0NRg,107
4
4
  eotdl/access/airbus/client.py,sha256=zjfgB_NTsCCIszoQesYkyLJgheKg-eTh28vbleXYxfw,12018
@@ -8,11 +8,11 @@ eotdl/access/download.py,sha256=3LxfGbiZoPO2ReefKtscwnF5cMQdyLBfOnBDQA5xnlw,1568
8
8
  eotdl/access/search.py,sha256=sO2hml6JLK30DncNUqTWq16zy9LvRiWC6wtt5bNRzrI,633
9
9
  eotdl/access/sentinelhub/__init__.py,sha256=YpvaUBTRXM26WrXipo51ZUBCDv9WjRIdT8l1Pklpt_M,238
10
10
  eotdl/access/sentinelhub/client.py,sha256=g40avqlUpIa-WLjD7tK8CL8_SohBA2v3m8NZ0KbIFxc,4098
11
- eotdl/access/sentinelhub/evalscripts.py,sha256=uuLC6Km7IPssvM1xiIlLkx--TA1Ash159M4jov_I1Y4,4315
12
- eotdl/access/sentinelhub/parameters.py,sha256=kZSVdq85UiZjIRDe81TJ8IpOSCeVIOlbDWA5u8Ylg8Q,2050
13
- eotdl/access/sentinelhub/utils.py,sha256=XSDJD6Etg4Cg5D9dsXPbZnC09L4kWrQxTspGqY8LHs8,3305
11
+ eotdl/access/sentinelhub/evalscripts.py,sha256=m6cnZ6ryXHgdH2B7RDVSlDHXWfvKi7HMGkTHXEcJsTw,4142
12
+ eotdl/access/sentinelhub/parameters.py,sha256=Ni3Lqx1bLVcMzgmnuayDS00BLDm7SuM1FExVdGafopI,2061
13
+ eotdl/access/sentinelhub/utils.py,sha256=AUI3M_UX84lVdiSzOuZNiCLpHEP-sXJa97vEzAAZ-cM,3295
14
14
  eotdl/auth/__init__.py,sha256=OuGNfJQ-8Kymn4zIywlHQfImEO8DJMJIwOwTQm-u_dc,99
15
- eotdl/auth/auth.py,sha256=voxwxTERghLQdqrBSyjZrgvKrcF01aWUTc0-vxLFFgY,1601
15
+ eotdl/auth/auth.py,sha256=EjbVFREA2H0sjFJhVqjFZrwjKPzxRJ2x83MTjizpRBs,2029
16
16
  eotdl/auth/errors.py,sha256=E1lv3Igk--J-SOgNH18i8Xx9bXrrMyBSHKt_CAUmGPo,308
17
17
  eotdl/auth/is_logged.py,sha256=QREuhkoDnarZoUZwCxVCNoESGb_Yukh0lJo1pXvrV9Q,115
18
18
  eotdl/auth/logout.py,sha256=P_Sp6WmVvnG3R9V1L9541KNyHFko9DtQPqAKD2vaguw,161
@@ -23,8 +23,8 @@ eotdl/commands/datasets.py,sha256=XeDq-tJec-EmliocIXHPkg_1wBwCR2DJqxBxRbwjSGg,44
23
23
  eotdl/commands/models.py,sha256=7JPzjgxrnLLuj2c_D6RS2pc-m54MhmYIpGcob8pRJ_Q,4362
24
24
  eotdl/curation/__init__.py,sha256=Qdp1cRR_wUYjnpyzGfyRFnL3X7aKtmgZQS8NNzPCc1s,269
25
25
  eotdl/curation/stac/__init__.py,sha256=BGBDvW-IqcxhrxvLap2Ocj0nINYaqjgjzFuAipRcoa4,220
26
- eotdl/curation/stac/assets.py,sha256=SuoUxbDkI-lqv89XpaE7YiyUkgC1ZWKRxi5r7dEGmGI,4510
27
- eotdl/curation/stac/dataframe.py,sha256=sks5CcJAYaOUsnJYI30mbnXfkCvxmiLtsQPCnsUpDBI,5371
26
+ eotdl/curation/stac/assets.py,sha256=ay3JO6iEANMqTAe40sF7QYeEY574LbrhyanqSlVUITc,3347
27
+ eotdl/curation/stac/dataframe.py,sha256=HZ_WrADbsoffOVlJDTJ8RL114mAaYzzOxUJjrXCSpVg,5540
28
28
  eotdl/curation/stac/dataframe_bck.py,sha256=PwAwol7kll0xYtlkhLeQ_Sc5TBQ85cVd6eyzdfTMJnE,8493
29
29
  eotdl/curation/stac/dataframe_labeling.py,sha256=F22-4gpF9zFuCLqRva2XAyArOmGdrgGxXbgo9d54BFE,1520
30
30
  eotdl/curation/stac/extensions/__init__.py,sha256=NSzKe14Iyr8Pm2AVg8RHxddtBD2so45--BRJmJd8bTs,629
@@ -34,7 +34,7 @@ eotdl/curation/stac/extensions/eo.py,sha256=cT4RrbyoimIuuOxNRLkamhZgHpDbj4z_Ziat
34
34
  eotdl/curation/stac/extensions/label/__init__.py,sha256=R6xLkgJaZHoMh5BhpmueupWdM9NWKvmaRurum-ryU_s,159
35
35
  eotdl/curation/stac/extensions/label/base.py,sha256=5xbniQWjzXkrQxxXp8v9QQxFQdRYnaFPBd5_in1QXUw,4069
36
36
  eotdl/curation/stac/extensions/label/image_name_labeler.py,sha256=bivZN-qEtIXE6ehqwPKRsJO9RVckZ1lK2BG8ifUbaA8,8074
37
- eotdl/curation/stac/extensions/label/scaneo.py,sha256=LPrebS3TUsKjy8tnV7yG_T3xI4iKlv5lg5YOfjpu3CQ,8721
37
+ eotdl/curation/stac/extensions/label/scaneo.py,sha256=uUzEqEwdnKYZx-qx9o6d8HcXp1VPy8eYWc9kM0sjiyA,8787
38
38
  eotdl/curation/stac/extensions/ml_dataset.py,sha256=SjOX_EvVRhwIUc4iQLw6YX_bG3VTqlRd9SpmpNCnRak,21429
39
39
  eotdl/curation/stac/extensions/projection.py,sha256=ussVIwr_wOOhn07OmpAWY4qqbeAmYUxKjbE8onrAy7o,1236
40
40
  eotdl/curation/stac/extensions/raster.py,sha256=o5U_1ow8BsgwZXpSQYwQIvMJldhyn7xoGoJmUANTJTE,1540
@@ -43,31 +43,23 @@ eotdl/curation/stac/extent.py,sha256=Jb3K4v59eu_h5t429r0762o0zG_LA50iEE-abWNL0e0
43
43
  eotdl/curation/stac/parsers.py,sha256=H5IukLA61mpLojeuhWNQdiZk2eiYHAfpJBFxmjdGDso,1529
44
44
  eotdl/curation/stac/stac.py,sha256=9GdiB1mV8iyREvXZoJmNJKQGawWyK3h9Eu0hJX5u6O4,13180
45
45
  eotdl/datasets/__init__.py,sha256=oFSUD0OLvUS4_iwu_V1iAQ_VAML-8RWDbxgtuFdU5ZA,170
46
- eotdl/datasets/download.py,sha256=tgWCGhRfy8EtH_6Q6Hn8CHaKvIkPZ03iCW5_Aotrkok,3812
47
- eotdl/datasets/ingest.py,sha256=Z-PFfSp1tO3z7cusADPrniOdbNpYqIPYpP74vpWrqJ8,4020
46
+ eotdl/datasets/download.py,sha256=WM9XJqKQmsUcqnM2S9fKOHGlaoJ3FVePIQhobckHZrw,3750
47
+ eotdl/datasets/ingest.py,sha256=1XA5wwtx1VwEY7dTqb9dH3cBMlrRYuMTAuZt9reRMeo,3903
48
48
  eotdl/datasets/metadata.py,sha256=L23_EziGVSDJ-WZbYUYNN22GrgbCdMGxwJhgK9uzW0U,390
49
49
  eotdl/datasets/retrieve.py,sha256=DJz5K1bCLizg9YNwBnhHMFzcxMXar2socYkFONdSL4c,1041
50
- eotdl/datasets/usecases/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
51
- eotdl/datasets/usecases/datasets/DownloadFile.py,sha256=PoP0Dl2LBshKzbgArgxwxIVs-KT2IsfZKi0qSyiBsoI,936
52
- eotdl/datasets/usecases/datasets/DownloadFileURL.py,sha256=6OcNuCys45MXu9-7GtES0zg2QmY02EAkj_P3cVKVUvo,603
53
- eotdl/datasets/usecases/datasets/IngestDataset.py,sha256=d2H5nPXsEj-LhZpWGwNDSPs9uYNXRO2V07xsTFygQDc,953
54
- eotdl/datasets/usecases/datasets/IngestLargeDataset.py,sha256=yRl4eqDCNPcmbU0rrtooWDq1OPpi88rSFSl8C4RE7oM,1424
55
- eotdl/datasets/usecases/datasets/IngestLargeDatasetParallel.py,sha256=G6uVmpZLkn6lqUVQkjw0ne1xlBcJKHoJik4xLnlqd6o,1612
56
- eotdl/datasets/usecases/datasets/IngestSTAC.py,sha256=QAMLSkMFlc-ic0JWaIdAf0SXPkYcawy-RJqfvDqTD7A,3075
57
- eotdl/datasets/usecases/datasets/__init__.py,sha256=Tx4ISHtcjbu4KUVgjTac_pjpT0vsN-QpkIwtyx8xUYg,383
58
50
  eotdl/files/__init__.py,sha256=wStggK9L_Ni3vdZkKtKmKVdAaZRVuiMbsjYBCrJ8rxs,53
59
- eotdl/files/ingest.py,sha256=EIElSanwBgGUBniEBDkBf1SG-0mPkx8o0Bd1-Y1l6oA,6015
51
+ eotdl/files/ingest.py,sha256=ObLOsf2fuhRRHj5WSby6SDqoakTDozelOS0sTCN7BkQ,5943
60
52
  eotdl/models/__init__.py,sha256=fe1VfnlOxlfviphkkzaY4q8mkm0QxcdJxB3peScBZYk,108
61
- eotdl/models/download.py,sha256=NaKpi2nB4tpVnLWaHanprnaD1JDhAj6hA9-SkN1kiJA,4339
62
- eotdl/models/ingest.py,sha256=Zxv9oL5VOqPXgJgaOROt7v2twRPqzajllpP5ZgyNf3Q,1519
53
+ eotdl/models/download.py,sha256=ClE1V-gIpo7aZY8Q-DIaHL4Cpx5wHvrH6deTuNZclrQ,4017
54
+ eotdl/models/ingest.py,sha256=1NZe60Fl6-nu7SCFgenzFnKlglHCfANh50_GjUl3-is,1507
63
55
  eotdl/models/metadata.py,sha256=L23_EziGVSDJ-WZbYUYNN22GrgbCdMGxwJhgK9uzW0U,390
64
56
  eotdl/models/retrieve.py,sha256=-Ij7dT4J1p7MW4n13OlPB9OW4tBaBXPwk9dW8IuCZPc,664
65
- eotdl/repos/APIRepo.py,sha256=tjvtr96d1fhnKEdGDmc90NrwBW7YVCtdsKLLtV82SBE,402
66
- eotdl/repos/AuthAPIRepo.py,sha256=0ovz92NMOvQsOZOJ_shetO8wsS_80mBf-tDKVfwttH0,760
67
- eotdl/repos/AuthRepo.py,sha256=6AWOdWgXKAVYJ2pB3Fj6X2KABoH2u-tpUyhEkNMWxX0,1001
68
- eotdl/repos/DatasetsAPIRepo.py,sha256=2YYOIG_9Yx4D8H7L-HIGdMiIYA6QscCQ0yaJ5jKRLGg,4667
69
- eotdl/repos/FilesAPIRepo.py,sha256=luln1RI8YviPLxkI-ZKlXn0y_eAYGKZdPVwOyz4vlV4,7626
70
- eotdl/repos/ModelsAPIRepo.py,sha256=nYBaAmGlD4H7XMpeHMwx7GYacmIoWqfhH9PZ4sRfp90,1201
57
+ eotdl/repos/APIRepo.py,sha256=_czH_z7dg9iZvwi0U4lC99TaShqXNUNfqYGbG4gTsaA,662
58
+ eotdl/repos/AuthAPIRepo.py,sha256=vYCqFawe3xUm2cx4SqVXCvzl8J_sr9rs_MkipYC0bXE,957
59
+ eotdl/repos/AuthRepo.py,sha256=jpzzhINCcDZHRCyrPDsp49h17IlXp2HvX3BB3f5cnb4,1154
60
+ eotdl/repos/DatasetsAPIRepo.py,sha256=wyJbgzSx0PNJo5BAwaQiPj8HV9bNAr-7gIZzNKlAUt0,2144
61
+ eotdl/repos/FilesAPIRepo.py,sha256=vHyEePwNERInSo2d3-USgtx-QkXqA3Jzgo5AtuWrAHU,6768
62
+ eotdl/repos/ModelsAPIRepo.py,sha256=FgtXqgdPSjVwRXY-YTUT6aeRH8oDX9KvioQd1Ov7Nh0,1169
71
63
  eotdl/repos/__init__.py,sha256=WvX5TP49k7yYb5dWWNjv5kzbdluO3dJ4LqjQxRIOUVc,222
72
64
  eotdl/shared/__init__.py,sha256=mF7doJC8Z5eTPmB01UQvPivThZac32DRY33T6qshXfg,41
73
65
  eotdl/shared/checksum.py,sha256=4IB6N9jRO0chMDNJzpdnFDhC9wcFF9bO5oHq2HodcHw,479
@@ -77,8 +69,8 @@ eotdl/tools/metadata.py,sha256=RvNmoMdfEKoo-DzhEAqL-f9ZCjIe_bsdHQwACMk6w1E,1664
77
69
  eotdl/tools/paths.py,sha256=yWhOtVxX4NxrDrrBX2fuye5N1mAqrxXFy_eA7dffd84,1152
78
70
  eotdl/tools/stac.py,sha256=ovXdrPm4Sn9AAJmrP88WnxDmq2Ut-xPoscjphxz3Iyo,5763
79
71
  eotdl/tools/time_utils.py,sha256=qJ3-rk1I7ne722SLfAP6-59kahQ0vLQqIf9VpOi0Kpg,4691
80
- eotdl/tools/tools.py,sha256=ESmvh-gCyWHmXsOdqtB70EmdRK_Vzap6kVOuYmlp5gw,6353
81
- eotdl-2023.11.3.post4.dist-info/METADATA,sha256=bjG_M5-N0wC3pWBJ64UBXdiMtZYQDUti1Czqe6VK-Yc,3998
82
- eotdl-2023.11.3.post4.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
83
- eotdl-2023.11.3.post4.dist-info/entry_points.txt,sha256=s6sfxUfRrSX2IP2UbrzTFTvRCtLgw3_OKcHlOKf_5F8,39
84
- eotdl-2023.11.3.post4.dist-info/RECORD,,
72
+ eotdl/tools/tools.py,sha256=Tl4_v2ejkQo_zyZek8oofJwoYcdVosdOwW1C0lvWaNM,6354
73
+ eotdl-2024.2.15.dist-info/METADATA,sha256=PvicntB6mwav_KhBYF5YGmq1z7JPu3OQvkQLficNK84,3914
74
+ eotdl-2024.2.15.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
75
+ eotdl-2024.2.15.dist-info/entry_points.txt,sha256=s6sfxUfRrSX2IP2UbrzTFTvRCtLgw3_OKcHlOKf_5F8,39
76
+ eotdl-2024.2.15.dist-info/RECORD,,
File without changes
@@ -1,30 +0,0 @@
1
- from pydantic import BaseModel
2
- from ....utils import calculate_checksum
3
-
4
-
5
- class DownloadFile:
6
- def __init__(self, repo, retrieve_dataset, logger):
7
- self.repo = repo
8
- self.retrieve_dataset = retrieve_dataset
9
- self.logger = logger if logger else print
10
-
11
- class Inputs(BaseModel):
12
- dataset: str
13
- file: str
14
- path: str = None
15
- user: dict
16
- checksum: str
17
-
18
- class Outputs(BaseModel):
19
- dst_path: str
20
-
21
- def __call__(self, inputs: Inputs) -> Outputs:
22
- dataset = self.retrieve_dataset(inputs.dataset)
23
- dst_path = self.repo.download_file(
24
- inputs.dataset, inputs.file, inputs.user["id_token"], inputs.path
25
- )
26
- checksum = calculate_checksum(dst_path)
27
- self.logger(f"Checksum: {checksum}")
28
- if dataset["checksum"] != checksum:
29
- self.logger("Checksums do not match")
30
- return self.Outputs(dst_path=dst_path)
@@ -1,22 +0,0 @@
1
- from pydantic import BaseModel
2
-
3
-
4
- class DownloadFileURL:
5
- def __init__(self, repo, logger, progress=True):
6
- self.repo = repo
7
- self.logger = logger if logger else print
8
- self.progress = progress
9
-
10
- class Inputs(BaseModel):
11
- url: str
12
- path: str = None
13
- user: dict
14
-
15
- class Outputs(BaseModel):
16
- dst_path: str
17
-
18
- def __call__(self, inputs: Inputs) -> Outputs:
19
- dst_path = self.repo.download_file_url(
20
- inputs.url, inputs.path, inputs.user["id_token"], progress=self.progress
21
- )
22
- return self.Outputs(dst_path=dst_path)
@@ -1,30 +0,0 @@
1
- from pydantic import BaseModel
2
-
3
-
4
- class IngestDataset:
5
- def __init__(self, repo, logger):
6
- self.repo = repo
7
- self.logger = logger if logger else print
8
-
9
- class Inputs(BaseModel):
10
- name: str
11
- description: str
12
- path: str = None
13
- user: dict
14
-
15
- class Outputs(BaseModel):
16
- dataset: dict
17
-
18
- def __call__(self, inputs: Inputs) -> Outputs:
19
- # allow only zip files
20
- if not inputs.path.endswith(".zip"):
21
- raise Exception("Only zip files are allowed")
22
- self.logger("Ingesting dataset...")
23
- data, error = self.repo.ingest_dataset(
24
- inputs.name, inputs.description, inputs.path, inputs.user["id_token"]
25
- )
26
- # response = self.repo.ingest_large_dataset(inputs.name, inputs.description, inputs.path, inputs.user['id_token'])
27
- if error:
28
- raise Exception(error)
29
- self.logger("Done")
30
- return self.Outputs(dataset=data)
@@ -1,43 +0,0 @@
1
- from pydantic import BaseModel
2
- from ....utils import calculate_checksum
3
-
4
-
5
- class IngestLargeDataset:
6
- def __init__(self, repo, logger):
7
- self.repo = repo
8
- self.logger = logger if logger else print
9
-
10
- class Inputs(BaseModel):
11
- name: str
12
- path: str = None
13
- user: dict
14
-
15
- class Outputs(BaseModel):
16
- dataset: dict
17
-
18
- def __call__(self, inputs: Inputs) -> Outputs:
19
- data, error = self.repo.retrieve_dataset(inputs.name)
20
- if data:
21
- raise Exception("Dataset already exists")
22
- # allow only zip files
23
- if not inputs.path.endswith(".zip"):
24
- raise Exception("Only zip files are allowed")
25
- self.logger("Computing checksum...")
26
- checksum = calculate_checksum(inputs.path)
27
- self.logger(checksum)
28
- self.logger("Ingesting dataset...")
29
- id_token = inputs.user["id_token"]
30
- dataset_id, upload_id, parts = self.repo.prepare_large_upload(
31
- inputs.name, id_token, checksum
32
- )
33
- self.repo.ingest_large_dataset(
34
- inputs.path, upload_id, dataset_id, id_token, parts
35
- )
36
- self.logger("\nCompleting upload...")
37
- data, error = self.repo.complete_upload(
38
- inputs.name, id_token, upload_id, dataset_id, checksum
39
- )
40
- if error:
41
- raise Exception(error)
42
- self.logger("Done")
43
- return self.Outputs(dataset=data)
@@ -1,51 +0,0 @@
1
- from pydantic import BaseModel
2
- from eotdl.eotdl.datasets.utils import calculate_checksum
3
-
4
-
5
- class IngestLargeDatasetParallel:
6
- def __init__(self, repo, logger):
7
- self.repo = repo
8
- self.logger = logger
9
-
10
- class Inputs(BaseModel):
11
- name: str
12
- path: str = None
13
- user: dict
14
- threads: int = 0
15
-
16
- class Outputs(BaseModel):
17
- dataset: dict
18
-
19
- def __call__(self, inputs: Inputs) -> Outputs:
20
- data, error = self.repo.retrieve_dataset(inputs.name)
21
- if data:
22
- raise Exception("Dataset already exists")
23
- # allow only zip files
24
- if not inputs.path.endswith(".zip"):
25
- raise Exception("Only zip files are allowed")
26
- self.logger("Computing checksum...")
27
- checksum = calculate_checksum(
28
- inputs.path
29
- ) # should do this at chunk level, before and after
30
- self.logger(checksum)
31
- self.logger("Ingesting dataset...")
32
- id_token = inputs.user["id_token"]
33
- dataset_id, upload_id, parts = self.repo.prepare_large_upload(
34
- inputs.name, id_token, checksum
35
- )
36
- self.repo.ingest_large_dataset_parallel(
37
- inputs.path,
38
- upload_id,
39
- dataset_id,
40
- id_token,
41
- parts,
42
- inputs.threads,
43
- )
44
- self.logger("\nCompleting upload...")
45
- data, error = self.repo.complete_upload(
46
- inputs.name, id_token, upload_id, dataset_id, checksum
47
- )
48
- if error:
49
- raise Exception(error)
50
- self.logger("Done")
51
- return self.Outputs(dataset=data)