atlasai-dstoolkit-client 0.0.16__py3-none-any.whl → 0.0.18__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.
@@ -47,7 +47,7 @@ class Workflow:
47
47
  def __init__(self, id=None):
48
48
  # Allow the selection of an existing workflow and check the logs.
49
49
  self.id = id
50
- self.results = []
50
+ self._run_results = []
51
51
 
52
52
  @property
53
53
  def status(self):
@@ -157,6 +157,7 @@ class Electrification(Workflow):
157
157
  self.aoi_path = None
158
158
  self.aoi = None
159
159
  self.output_path = None
160
+ self.start_date = None
160
161
 
161
162
  super().__init__(id)
162
163
 
@@ -166,11 +167,12 @@ class Electrification(Workflow):
166
167
  def __str__(self):
167
168
  return f'Electrification({self.aoi_name})'
168
169
 
169
- def configure(self, aoi_name=None, aoi_path=None, aoi=None, output_path=None):
170
+ def configure(self, aoi_name=None, aoi_path=None, aoi=None, start_date=None, output_path=None):
170
171
  self.aoi_name = aoi_name or self.aoi_name
171
172
  self.aoi_path = aoi_path or self.aoi_path
172
173
  self.aoi = aoi or self.aoi
173
174
  self.output_path = output_path or self.output_path
175
+ self.start_date = start_date or self.start_date
174
176
 
175
177
  def _config(self):
176
178
  cfg = {}
@@ -178,7 +180,8 @@ class Electrification(Workflow):
178
180
  ('aoi_name', self.aoi_name),
179
181
  ('aoi_geojson', self.aoi),
180
182
  ('aoi_geojson_uri', self.aoi_path),
181
- ('output_bucket', self.output_path)
183
+ ('output_bucket', self.output_path),
184
+ ('start_date', self.start_date)
182
185
  ):
183
186
  if value:
184
187
  cfg[name] = value
@@ -191,9 +194,9 @@ class Electrification(Workflow):
191
194
  if not self.aoi_path and not self.aoi:
192
195
  raise Exception('`aoi_path` or `aoi` must be specified.')
193
196
 
194
- def _results(self, save_to=None):
195
- if self.results:
196
- return self.results
197
+ def _results(self, save_to=None, force=False):
198
+ if self._run_results and not force:
199
+ return self._run_results
197
200
 
198
201
  results = []
199
202
  if not self.id:
@@ -211,7 +214,7 @@ class Electrification(Workflow):
211
214
  for fut in as_completed(fut_map):
212
215
  results.append(fut.result())
213
216
  pbar.update(1)
214
- self.results = results
217
+ self._run_results = results
215
218
  return results
216
219
 
217
220
  def _download_file(self, name, url, to=None):
@@ -233,8 +236,9 @@ class Electrification(Workflow):
233
236
  return local_path
234
237
 
235
238
  def preview(self, from_=None, to_=None, selection=None, limit=None):
236
- if not self.results:
239
+ if not self._run_results:
237
240
  raise Exception('No result to be displayed. Run the workflow first and wait for its completion.')
241
+
238
242
  _results = []
239
243
  if selection is None:
240
244
  selection = []
@@ -247,7 +251,7 @@ class Electrification(Workflow):
247
251
  if to_:
248
252
  to_ = datetime.strptime(to_, "%Y-%m-%d")
249
253
 
250
- for f in sorted(self.results):
254
+ for f in sorted(self._run_results):
251
255
  yyyy, mm = f.split('_')[-1].replace('.tif', '').split('-')
252
256
  dt = datetime(year=int(yyyy), month=int(mm), day=1)
253
257
  if selection:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: atlasai-dstoolkit-client
3
- Version: 0.0.16
3
+ Version: 0.0.18
4
4
  Summary: UNKNOWN
5
5
  Home-page: UNKNOWN
6
6
  Author: AtlasAI SWE
@@ -10,9 +10,9 @@ atlasai/toolkit/model.py,sha256=RUe0HbDpzvHOV9A4rzG3PgN9boMWDHQ2tR7IKHXzbx8,4126
10
10
  atlasai/toolkit/output.py,sha256=FyDjrpVlbrEyfHfwOpxp8H57jx_qXahDjO1qpHIeuYM,473
11
11
  atlasai/toolkit/requests.py,sha256=X86nIo07hAjUlilZcZ1lV8RB7KOsTKbTGtcY_SpFEXY,1223
12
12
  atlasai/toolkit/utils.py,sha256=lYh3P2XOshRgHCjFeXJ0FOJWQW64sddgx8c2kL6Wqwc,1566
13
- atlasai/toolkit/workflows.py,sha256=u17Hl-tIgyoB_-dA23g5h2o900fcsyj3H1uVVbZ4Mao,9392
14
- atlasai_dstoolkit_client-0.0.16.dist-info/LICENSE.txt,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
15
- atlasai_dstoolkit_client-0.0.16.dist-info/METADATA,sha256=cC7U97hGZ68zR7Gapl1ZXPR2R2Q2Y4Xyp7--UtfdOnM,1547
16
- atlasai_dstoolkit_client-0.0.16.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
17
- atlasai_dstoolkit_client-0.0.16.dist-info/top_level.txt,sha256=HRTbErU8nmHFDaJJ5R_XYbwpt21dqdjDpSva8xyy_0k,8
18
- atlasai_dstoolkit_client-0.0.16.dist-info/RECORD,,
13
+ atlasai/toolkit/workflows.py,sha256=UXkNP84P-EExLtTiRGiO2PN0ZckCdf871GUhbIJtTvw,9603
14
+ atlasai_dstoolkit_client-0.0.18.dist-info/LICENSE.txt,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
15
+ atlasai_dstoolkit_client-0.0.18.dist-info/METADATA,sha256=I91iQj6v4fkVVKWzvgw0XjiYTKrc45WiPw6KFPyK9po,1547
16
+ atlasai_dstoolkit_client-0.0.18.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
17
+ atlasai_dstoolkit_client-0.0.18.dist-info/top_level.txt,sha256=HRTbErU8nmHFDaJJ5R_XYbwpt21dqdjDpSva8xyy_0k,8
18
+ atlasai_dstoolkit_client-0.0.18.dist-info/RECORD,,