ellipsis 3.1.51__py3-none-any.whl → 3.1.53__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.1.51'
9
+ __version__ = '3.1.53'
10
10
 
11
11
 
12
12
 
ellipsis/compute/root.py CHANGED
@@ -7,10 +7,9 @@ from ellipsis import sanitize
7
7
  from ellipsis import apiManager
8
8
  from ellipsis.account import getInfo
9
9
 
10
+ apiManager.baseUrl = 'https://acc.api.ellipsis-drive.com/v3'
10
11
 
11
-
12
- def createCluster(layers, token, nodes=None, interpreter='python3.12', requirements= [], awaitTillStarted = True):
13
-
12
+ def createCompute(layers, token, nodes=None, interpreter='python3.12', requirements= [], awaitTillStarted = True):
14
13
  layers = sanitize.validDictArray('layers', layers, True)
15
14
  token = sanitize.validString('token', token, True)
16
15
  nodes = sanitize.validInt('nodes', nodes, False)
@@ -28,20 +27,22 @@ def createCluster(layers, token, nodes=None, interpreter='python3.12', requireme
28
27
  body = {'layers':layers, 'interpreter':interpreter, 'nodes':nodes, 'requirements':requirements}
29
28
  r = apiManager.post('/compute', body, token)
30
29
 
31
- clusterId = r['id']
30
+ computeId = r['id']
32
31
  while awaitTillStarted:
33
- res = listClusters(token=token)['result']
34
- r = [x for x in res if x['id'] == clusterId][0]
35
-
32
+ res = listComputes(token=token)['result']
33
+ r = [x for x in res if x['id'] == computeId][0]
36
34
  if r['status'] == 'available':
37
35
  break
36
+ if r['status'] == 'errored':
37
+ raise ValueError(r['message'])
38
+
38
39
  time.sleep(1)
39
40
 
40
- return {'id':clusterId}
41
+ return {'id':computeId}
41
42
 
42
43
 
43
- def execute(clusterId, f, token, awaitTillCompleted=True):
44
- clusterId = sanitize.validUuid('clusterId', clusterId, True)
44
+ def execute(computeId, f, token, awaitTillCompleted=True):
45
+ computeId = sanitize.validUuid('computeId', computeId, True)
45
46
  token = sanitize.validString('token', token, True)
46
47
 
47
48
  if str(type(f)) != "<class 'function'>":
@@ -51,16 +52,21 @@ def execute(clusterId, f, token, awaitTillCompleted=True):
51
52
  f_string = base64.b64encode(f_bytes)
52
53
 
53
54
  body = { 'file':f_string}
54
- apiManager.post('/compute/' + clusterId + '/execute', body, token)
55
+ apiManager.post('/compute/' + computeId + '/execute', body, token)
55
56
 
56
57
  while awaitTillCompleted:
57
- res = listClusters(token=token)['result']
58
- r = [x for x in res if x['id'] == clusterId][0]
58
+ res = listComputes(token=token)['result']
59
+ r = [x for x in res if x['id'] == computeId][0]
59
60
  if r['status'] == 'completed':
60
61
  break
61
62
  time.sleep(1)
62
63
 
63
- return r['result']
64
+ for x in r['result']:
65
+ if x['type'] == 'exception':
66
+ raise x['value']
67
+
68
+ values = [x['value'] for x in r['result']]
69
+ return values
64
70
 
65
71
  def parseResults(r):
66
72
  results = []
@@ -71,30 +77,51 @@ def parseResults(r):
71
77
 
72
78
  return results
73
79
 
74
- def terminateCluster(clusterId, token, awaitTillTerminated = True):
75
- clusterId = sanitize.validUuid('clusterId', clusterId, True)
80
+ def terminatecompute(computeId, token, awaitTillTerminated = True):
81
+ computeId = sanitize.validUuid('computeId', computeId, True)
76
82
  token = sanitize.validString('token', token, True)
83
+ sanitize.validBool('awaitTillTerminated',awaitTillTerminated, True)
77
84
 
78
85
 
79
- r = apiManager.post('/compute/' + clusterId + '/terminate', {}, token)
86
+ r = apiManager.post('/compute/' + computeId + '/terminate', {}, token)
80
87
 
81
88
  while awaitTillTerminated:
82
- res = listClusters(token=token)['result']
83
- z = [x for x in res if x['id'] == clusterId][0]
89
+ res = listComputes(token=token)['result']
90
+ z = [x for x in res if x['id'] == computeId][0]
84
91
  if z['status'] == 'stopped':
85
92
  break
86
93
  time.sleep(1)
87
94
 
88
95
  return r
89
96
 
90
- def getClusterInfo(clusterId, token):
91
- res = listClusters(token=token)['result']
92
- r = [x for x in res if x['id'] == clusterId]
97
+ def terminateAll(token, awaitTillTerminated = True ):
98
+ token = sanitize.validString('token', token, True)
99
+ sanitize.validBool('awaitTillTerminated',awaitTillTerminated, True)
100
+
101
+ res = listComputes(token = token)['result']
102
+
103
+ for x in res:
104
+ if x['status'] != 'stopped' and x['status'] != 'errored' and x['status'] != 'stopping':
105
+
106
+ apiManager.post('/compute/' + x['id'] + '/terminate', {}, token)
107
+
108
+ while awaitTillTerminated:
109
+ res = listComputes(token=token)['result']
110
+ z = [x for x in res if x['id'] == x['id']][0]
111
+ if z['status'] == 'stopped':
112
+ break
113
+ time.sleep(1)
114
+
115
+
116
+
117
+ def getComputeInfo(computeId, token):
118
+ res = listComputes(token=token)['result']
119
+ r = [x for x in res if x['id'] == computeId]
93
120
  if len(r) ==0:
94
- raise ValueError('No cluster found for given id')
121
+ raise ValueError('No compute found for given id')
95
122
  return r[0]
96
123
 
97
- def listClusters(token, pageStart = None, listAll = True):
124
+ def listComputes(token, pageStart = None, listAll = True):
98
125
  token = sanitize.validString('token', token, True)
99
126
 
100
127
 
@@ -31,5 +31,15 @@ def editFilter(pathId, propertyFilter, token):
31
31
  r = apiManager.post('/path/' + pathId + '/vector/filter' , body, token)
32
32
  return r
33
33
 
34
+ def computeAllVectorTiles(pathId, timestampId, token):
35
+ pathId = sanitize.validUuid('pathId', pathId, True)
36
+ timestampId = sanitize.validUuid('timestampId', timestampId, True)
37
+ token = sanitize.validString('token', token, True)
38
+
39
+ r = apiManager.post('/path/' + pathId + '/vector/timestamp/' + timestampId + '/precompute/completeVectorTile' , {}, token)
40
+
41
+ return r
42
+
43
+
34
44
 
35
45
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ellipsis
3
- Version: 3.1.51
3
+ Version: 3.1.53
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
@@ -14,6 +14,7 @@ License-File: LICENSE
14
14
  Requires-Dist: Fiona
15
15
  Requires-Dist: Pillow
16
16
  Requires-Dist: Shapely
17
+ Requires-Dist: dill
17
18
  Requires-Dist: geopandas
18
19
  Requires-Dist: geopy
19
20
  Requires-Dist: imagecodecs
@@ -1,4 +1,4 @@
1
- ellipsis/__init__.py,sha256=i80vZ2_QmnXj1oBX5d4V6vHMHiVufbd5KiF1HpydmpI,238
1
+ ellipsis/__init__.py,sha256=lxeIxyjSlr7NeusvW1_p_Hqwb4t11nrW4dGWz6A8JA8,238
2
2
  ellipsis/apiManager.py,sha256=T0YYV26r02yDMFO5ePmBbM4_gfy55KleECAyM1OSrCk,5598
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=2UDm8SlCNXemkvDeNDnDV9HP_NU0ouwLVrjGzzqQ0Rc,48
9
- ellipsis/compute/root.py,sha256=I89ut7UURp1Bx3yFQIOHwqLLc7RacKTvq7iyFZLIBKc,3343
9
+ ellipsis/compute/root.py,sha256=uP-yHsNFDn3VSqPY2OcYZ83jRSpIJZH7nDBDGsH6lBU,4376
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
@@ -46,7 +46,7 @@ ellipsis/path/setUpTask/root.py,sha256=ERmbcGvxyCcGSKeJDe3bdYke9Do4VK02o-aeTQ77s
46
46
  ellipsis/path/usage/__init__.py,sha256=2BHmLV9soOYDhyQFH2B86bBjmWXGsfuX4KneEBDo6O4,96
47
47
  ellipsis/path/usage/root.py,sha256=NAZCDHXHcN6kodU3EpbNwlWM3It60ewsGXt4LJ_enG0,1566
48
48
  ellipsis/path/vector/__init__.py,sha256=hsWLBZOmDYw5Ra9TzX5hFipi4ZcXdVP1E35cHk2PQwQ,281
49
- ellipsis/path/vector/root.py,sha256=XA6698yrY1HEHCUc7b8e_ideyuUWw2p-blE0w7p3I3E,1427
49
+ ellipsis/path/vector/root.py,sha256=P8zKEA6b4F9sQ7di5FHtiHrp3wnG49QVfDgq68_n7Ek,1808
50
50
  ellipsis/path/vector/featureProperty/__init__.py,sha256=-S6G0Sq66m8HVTg4bCp33fsUzYq-2hPueg5BotSpk2Q,81
51
51
  ellipsis/path/vector/featureProperty/root.py,sha256=eb2bw4UGO3eYGaYgjwu43pZyA4iAjQTik_4HurZaGbM,2111
52
52
  ellipsis/path/vector/style/__init__.py,sha256=riiDnL4FDq4EFhSYAYHBSe_o5oltRTSrj4sc72F6IVQ,63
@@ -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=Ts7DeaD_X7x-csmq5V2sa_hYrt1mCd59T7-NUQcWj3Y,23980
70
- ellipsis-3.1.51.dist-info/LICENSE,sha256=7EI8xVBu6h_7_JlVw-yPhhOZlpY9hP8wal7kHtqKT_E,1074
71
- ellipsis-3.1.51.dist-info/METADATA,sha256=8l3_aMAIGtCUzmIGjn1FYm3b6NkCT0kwE612NyRcZ_w,1823
72
- ellipsis-3.1.51.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
73
- ellipsis-3.1.51.dist-info/top_level.txt,sha256=eG8gfaVDyprKdb-dsGSh_lFMSa3DiZCsJFqze239RjA,9
74
- ellipsis-3.1.51.dist-info/RECORD,,
70
+ ellipsis-3.1.53.dist-info/LICENSE,sha256=7EI8xVBu6h_7_JlVw-yPhhOZlpY9hP8wal7kHtqKT_E,1074
71
+ ellipsis-3.1.53.dist-info/METADATA,sha256=JH8p--VonrpjP-7A2U-3prjlpsO2qBaXdlctNsThE7s,1843
72
+ ellipsis-3.1.53.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
73
+ ellipsis-3.1.53.dist-info/top_level.txt,sha256=eG8gfaVDyprKdb-dsGSh_lFMSa3DiZCsJFqze239RjA,9
74
+ ellipsis-3.1.53.dist-info/RECORD,,