ellipsis 3.2.4__py3-none-any.whl → 3.2.6__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.

Potentially problematic release.


This version of ellipsis might be problematic. Click here for more details.

ellipsis/__init__.py CHANGED
@@ -6,7 +6,7 @@ from ellipsis import user
6
6
  from ellipsis import path
7
7
  from ellipsis import util
8
8
  from ellipsis import compute
9
- __version__ = '3.2.4'
9
+ __version__ = '3.2.6'
10
10
 
11
11
 
12
12
 
ellipsis/compute/root.py CHANGED
@@ -12,7 +12,7 @@ from io import BytesIO
12
12
 
13
13
  def createCompute(layers, token, files = None, nodes=None, interpreter='python3.12', requirements= [], awaitTillStarted = True, largeResult = False):
14
14
  layers = sanitize.validDictArray('layers', layers, True)
15
- files = sanitize.validUuidArray('files', files, True)
15
+ files = sanitize.validUuidArray('files', files, False)
16
16
  token = sanitize.validString('token', token, True)
17
17
  nodes = sanitize.validInt('nodes', nodes, False)
18
18
  interpreter = sanitize.validString('interpreter', interpreter, True)
@@ -31,6 +31,7 @@ def createCompute(layers, token, files = None, nodes=None, interpreter='python3.
31
31
 
32
32
  computeId = r['id']
33
33
  while awaitTillStarted:
34
+ print('waiting')
34
35
  res = listComputes(token=token)['result']
35
36
  r = [x for x in res if x['id'] == computeId][0]
36
37
  if r['status'] == 'available':
@@ -59,6 +60,7 @@ def execute(computeId, f, token, awaitTillCompleted=True):
59
60
  while awaitTillCompleted:
60
61
  res = listComputes(token=token)['result']
61
62
  r = [x for x in res if x['id'] == computeId][0]
63
+ print('waiting')
62
64
  if r['status'] == 'completed':
63
65
  break
64
66
  time.sleep(1)
@@ -146,14 +148,27 @@ def addToLayer(response, pathId, timestampId, token):
146
148
  token = sanitize.validString('token', token, True)
147
149
 
148
150
  for url in response:
149
- memfile = downloadFile(url, token)
150
- addFile(pathId = pathId, timestampId=timestampId, token = token, fileFormat='tif', memFile=memfile, name='out.tif')
151
+ print('fetching file ' + url.split('/')[-1])
152
+ memfile = BytesIO()
153
+ memfile = downloadFile(url, token, memfile=memfile)
154
+ print('read file ' + url.split('/')[-1])
155
+ print('adding file ' + url.split('/')[-1])
156
+ addFile(pathId = pathId, timestampId=timestampId, token = token, fileFormat='tif', memFile=memfile, name= url.split('/')[-1] + '.tif' )
157
+ print('file ' + url.split('/')[-1] + ' added to layer')
151
158
  activate(pathId=pathId, timestampId=timestampId, token=token)
159
+ print('layer can now be found at ' + apiManager.baseUrl + '/drive/me?pathId=' + pathId )
152
160
 
153
161
 
154
162
 
155
- def downloadFile(url, token):
156
- memfile = BytesIO()
157
- apiManager.download(url = url, filePath='', memfile=memfile, token = token)
158
- memfile.seek(0)
159
- return memfile
163
+ def downloadFile(url, token, filePath = None, memfile = None):
164
+
165
+ url = sanitize.validString('url', url, True)
166
+ token = sanitize.validString('token', token, True)
167
+ filePath = sanitize.validString('filePath', filePath, False)
168
+ if memfile == None and filePath == None:
169
+ raise ValueError('Either memfile or filePath is required')
170
+
171
+ apiManager.download(url = url, filePath=filePath, memfile=memfile, token = token)
172
+
173
+ if memfile != None:
174
+ return memfile
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ellipsis
3
- Version: 3.2.4
3
+ Version: 3.2.6
4
4
  Summary: Package to interact with the Ellipsis API
5
5
  Home-page: https://github.com/ellipsis-drive-internal/python-package
6
6
  Author: Daniel van der Maas
@@ -1,4 +1,4 @@
1
- ellipsis/__init__.py,sha256=EJ02d1UN9rkZkh-vretLuqjTy1xlFwXDFcJnbRO4VNU,237
1
+ ellipsis/__init__.py,sha256=WgtGW5z3sVpEExvHTlhAdXkCqkV7T-cfU7CbNozgHfQ,237
2
2
  ellipsis/apiManager.py,sha256=iX6XFwilMfuCQYioAmgRgReL8W63FUBr3UC506ucIF4,5603
3
3
  ellipsis/sanitize.py,sha256=VuTPjHAUNCGUaOzKU2ojloiEN8kPhm53fIjbk6E9IEg,10597
4
4
  ellipsis/account/__init__.py,sha256=jTmwL9HVS27vAHPC_2a98RQJWbpSKBN4ptiXpY0qJgk,101
@@ -6,7 +6,7 @@ ellipsis/account/root.py,sha256=p8AehZQizaPlpGdFB5RsMduyUF4ynN0cGDz41nIxjYM,1942
6
6
  ellipsis/account/accessToken/__init__.py,sha256=ivwhK1eC4g74PAKaeTReb1QhIpKXyvmfdqZV6wDY-EY,66
7
7
  ellipsis/account/accessToken/root.py,sha256=TYo8wTyWyzytaqOTsuQC-Vn3y7BhYMC88EItZafpISA,1281
8
8
  ellipsis/compute/__init__.py,sha256=zcjm8GX1kSi5PEK5CXsR3wc2wxBdy3EIMo_y1sFEguQ,115
9
- ellipsis/compute/root.py,sha256=S6csK95CKT8LF9VTVjRux4EoDfo6fZvsDF8po0huVaM,5411
9
+ ellipsis/compute/root.py,sha256=raqMp1sYw3rPw5Vi5CY4mUhCRTKiuCx2pT5r0T6USNs,6144
10
10
  ellipsis/path/__init__.py,sha256=NzdcTpXpicdrBWLgsFP6WY7ARIBKUFnkwa5VuB1Qdpc,506
11
11
  ellipsis/path/root.py,sha256=GqiYjAkdSchkQf1NzcSFZvBrmoQir7K2fqmZosqghFM,7953
12
12
  ellipsis/path/bookmark/__init__.py,sha256=vNrqGcWl5MN_xVAiClP6W6NilmsV-fqYOnJukbYcNwc,56
@@ -67,8 +67,8 @@ ellipsis/user/__init__.py,sha256=um_b42pc2otFiQRGqMajcEtONQpC2ei4r-EY3j7bsfQ,43
67
67
  ellipsis/user/root.py,sha256=dsMK6wGBdeCmOd3YsbIv9cEcQ6tAiSGr0jmtBhQl5-0,484
68
68
  ellipsis/util/__init__.py,sha256=_sNBUXDKJVGffRyt93xdUrJ4gON651Sp-unr7LKVCEc,756
69
69
  ellipsis/util/root.py,sha256=3pw-tXGTQC5PMUtpReJEA9rgyJZNlTM3uUISPz2Sq6Q,23976
70
- ellipsis-3.2.4.dist-info/LICENSE,sha256=7EI8xVBu6h_7_JlVw-yPhhOZlpY9hP8wal7kHtqKT_E,1074
71
- ellipsis-3.2.4.dist-info/METADATA,sha256=LyJYDVOtgX8vW9ligtntBbHd-FH3fBsRV5My9Gq54Z0,1842
72
- ellipsis-3.2.4.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
73
- ellipsis-3.2.4.dist-info/top_level.txt,sha256=eG8gfaVDyprKdb-dsGSh_lFMSa3DiZCsJFqze239RjA,9
74
- ellipsis-3.2.4.dist-info/RECORD,,
70
+ ellipsis-3.2.6.dist-info/LICENSE,sha256=7EI8xVBu6h_7_JlVw-yPhhOZlpY9hP8wal7kHtqKT_E,1074
71
+ ellipsis-3.2.6.dist-info/METADATA,sha256=STWvm4CaLABwUP9Re8be6T0w0ncC0yle2NLfe7gi5Ig,1842
72
+ ellipsis-3.2.6.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
73
+ ellipsis-3.2.6.dist-info/top_level.txt,sha256=eG8gfaVDyprKdb-dsGSh_lFMSa3DiZCsJFqze239RjA,9
74
+ ellipsis-3.2.6.dist-info/RECORD,,