ellipsis 3.1.49__py3-none-any.whl → 3.1.50__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 +2 -2
- ellipsis/account/__init__.py +1 -1
- ellipsis/account/root.py +9 -0
- ellipsis/compute/__init__.py +1 -0
- ellipsis/compute/root.py +112 -0
- ellipsis/path/vector/root.py +9 -0
- ellipsis/sanitize.py +21 -1
- {ellipsis-3.1.49.dist-info → ellipsis-3.1.50.dist-info}/METADATA +1 -1
- {ellipsis-3.1.49.dist-info → ellipsis-3.1.50.dist-info}/RECORD +12 -10
- {ellipsis-3.1.49.dist-info → ellipsis-3.1.50.dist-info}/LICENSE +0 -0
- {ellipsis-3.1.49.dist-info → ellipsis-3.1.50.dist-info}/WHEEL +0 -0
- {ellipsis-3.1.49.dist-info → ellipsis-3.1.50.dist-info}/top_level.txt +0 -0
ellipsis/__init__.py
CHANGED
ellipsis/account/__init__.py
CHANGED
ellipsis/account/root.py
CHANGED
|
@@ -24,6 +24,15 @@ def logIn(username, password, validFor = None):
|
|
|
24
24
|
|
|
25
25
|
return(token)
|
|
26
26
|
|
|
27
|
+
|
|
28
|
+
def getInfo(token):
|
|
29
|
+
token = sanitize.validString('token', token, True)
|
|
30
|
+
|
|
31
|
+
r = apiManager.get( '/account', body={}, token=token)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
return r
|
|
35
|
+
|
|
27
36
|
def listRoot(rootName, token, pathTypes= None, pageStart = None, listAll = True):
|
|
28
37
|
token = sanitize.validString('token', token, True)
|
|
29
38
|
rootName = sanitize.validString('rootName', rootName, True)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from ellipsis.compute.root import createCluster
|
ellipsis/compute/root.py
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import dill
|
|
2
|
+
import base64
|
|
3
|
+
import time
|
|
4
|
+
|
|
5
|
+
from ellipsis.util.root import recurse
|
|
6
|
+
from ellipsis import sanitize
|
|
7
|
+
from ellipsis import apiManager
|
|
8
|
+
from ellipsis.account import getInfo
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def createCluster(layers, token, nodes=None, interpreter='python3.12', requirements= [], awaitTillStarted = True):
|
|
13
|
+
|
|
14
|
+
layers = sanitize.validDictArray('layers', layers, True)
|
|
15
|
+
token = sanitize.validString('token', token, True)
|
|
16
|
+
nodes = sanitize.validInt('nodes', nodes, False)
|
|
17
|
+
interpreter = sanitize.validString('interpreter', interpreter, True)
|
|
18
|
+
requirements = sanitize.validStringArray('requirements', requirements, False)
|
|
19
|
+
|
|
20
|
+
if type(nodes) == type(None):
|
|
21
|
+
info = getInfo(token=token)
|
|
22
|
+
nodes = info['plan']['maxComputeNodes']
|
|
23
|
+
if nodes == 0:
|
|
24
|
+
raise ValueError('You have no compute nodes in your plan. Please update your subscription')
|
|
25
|
+
|
|
26
|
+
requirements = "\n".join(requirements)
|
|
27
|
+
|
|
28
|
+
body = {'layers':layers, 'interpreter':interpreter, 'nodes':nodes, 'requirements':requirements}
|
|
29
|
+
r = apiManager.post('/compute', body, token)
|
|
30
|
+
|
|
31
|
+
clusterId = r['id']
|
|
32
|
+
while awaitTillStarted:
|
|
33
|
+
res = listClusters(token=token)['result']
|
|
34
|
+
r = [x for x in res if x['id'] == clusterId][0]
|
|
35
|
+
|
|
36
|
+
if r['status'] == 'available':
|
|
37
|
+
break
|
|
38
|
+
time.sleep(1)
|
|
39
|
+
|
|
40
|
+
return {'id':clusterId}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def execute(clusterId, f, token, awaitTillCompleted=True):
|
|
44
|
+
clusterId = sanitize.validUuid('clusterId', clusterId, True)
|
|
45
|
+
token = sanitize.validString('token', token, True)
|
|
46
|
+
|
|
47
|
+
if str(type(f)) != "<class 'function'>":
|
|
48
|
+
raise ValueError('parameter f must be a function')
|
|
49
|
+
|
|
50
|
+
f_bytes = dill.dumps(f)
|
|
51
|
+
f_string = base64.b64encode(f_bytes)
|
|
52
|
+
|
|
53
|
+
body = { 'file':f_string}
|
|
54
|
+
apiManager.post('/compute/' + clusterId + '/execute', body, token)
|
|
55
|
+
|
|
56
|
+
while awaitTillCompleted:
|
|
57
|
+
res = listClusters(token=token)['result']
|
|
58
|
+
r = [x for x in res if x['id'] == clusterId][0]
|
|
59
|
+
if r['status'] == 'completed':
|
|
60
|
+
break
|
|
61
|
+
time.sleep(1)
|
|
62
|
+
|
|
63
|
+
return r['result']
|
|
64
|
+
|
|
65
|
+
def parseResults(r):
|
|
66
|
+
results = []
|
|
67
|
+
for x in r:
|
|
68
|
+
x = base64.b64decode(x)
|
|
69
|
+
x = dill.loads(x)
|
|
70
|
+
results = results + x
|
|
71
|
+
|
|
72
|
+
return results
|
|
73
|
+
|
|
74
|
+
def terminateCluster(clusterId, token, awaitTillTerminated = True):
|
|
75
|
+
clusterId = sanitize.validUuid('clusterId', clusterId, True)
|
|
76
|
+
token = sanitize.validString('token', token, True)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
r = apiManager.post('/compute/' + clusterId + '/terminate', {}, token)
|
|
80
|
+
|
|
81
|
+
while awaitTillTerminated:
|
|
82
|
+
res = listClusters(token=token)['result']
|
|
83
|
+
z = [x for x in res if x['id'] == clusterId][0]
|
|
84
|
+
if z['status'] == 'stopped':
|
|
85
|
+
break
|
|
86
|
+
time.sleep(1)
|
|
87
|
+
|
|
88
|
+
return r
|
|
89
|
+
|
|
90
|
+
def getClusterInfo(clusterId, token):
|
|
91
|
+
res = listClusters(token=token)['result']
|
|
92
|
+
r = [x for x in res if x['id'] == clusterId]
|
|
93
|
+
if len(r) ==0:
|
|
94
|
+
raise ValueError('No cluster found for given id')
|
|
95
|
+
return r[0]
|
|
96
|
+
|
|
97
|
+
def listClusters(token, pageStart = None, listAll = True):
|
|
98
|
+
token = sanitize.validString('token', token, True)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
body = { 'pageStart':pageStart }
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
def f(body):
|
|
105
|
+
return apiManager.get('/compute', body, token)
|
|
106
|
+
|
|
107
|
+
r = recurse(f, body, listAll)
|
|
108
|
+
for i in range(len(r['result'])):
|
|
109
|
+
if 'result' in r['result'][i]:
|
|
110
|
+
r['result'][i]['result'] = parseResults(r['result'][i]['result'])
|
|
111
|
+
return r
|
|
112
|
+
|
ellipsis/path/vector/root.py
CHANGED
|
@@ -12,6 +12,15 @@ def add( name, token, parentId = None, publicAccess =None, metadata=None):
|
|
|
12
12
|
|
|
13
13
|
return apiManager.post('/path/vector', body, token)
|
|
14
14
|
|
|
15
|
+
def editRendering(pathId, maxZoom, token):
|
|
16
|
+
token = sanitize.validString('token', token, True)
|
|
17
|
+
pathId = sanitize.validUuid('parentId', pathId, True)
|
|
18
|
+
maxZoom = sanitize.validInt('maxZoom', maxZoom, True)
|
|
19
|
+
|
|
20
|
+
body = {"method":"vector tiles","parameters":{"zoom":maxZoom,"mb":2,"step":1000,"amount":1000},"centerPointOnly":False,"lod":6}
|
|
21
|
+
r = apiManager.put('/path/' + pathId + '/vector/renderOptions' , body, token)
|
|
22
|
+
return r
|
|
23
|
+
|
|
15
24
|
|
|
16
25
|
def editFilter(pathId, propertyFilter, token):
|
|
17
26
|
pathId = sanitize.validUuid('pathId', pathId, True)
|
ellipsis/sanitize.py
CHANGED
|
@@ -81,7 +81,7 @@ def validString(name, value, required):
|
|
|
81
81
|
return
|
|
82
82
|
|
|
83
83
|
if type(value) != type('x'):
|
|
84
|
-
raise ValueError(name + 'must be of type string')
|
|
84
|
+
raise ValueError(name + ' must be of type string')
|
|
85
85
|
return(value)
|
|
86
86
|
|
|
87
87
|
def validShapely(name, value, required):
|
|
@@ -317,6 +317,26 @@ def validFloatArray(name, value, required):
|
|
|
317
317
|
return value
|
|
318
318
|
|
|
319
319
|
|
|
320
|
+
def validDictArray(name, value, required):
|
|
321
|
+
if not required and type(value) == type(None):
|
|
322
|
+
return
|
|
323
|
+
|
|
324
|
+
try:
|
|
325
|
+
value = list(value)
|
|
326
|
+
|
|
327
|
+
except:
|
|
328
|
+
raise ValueError(name + ' must be an iterable')
|
|
329
|
+
|
|
330
|
+
types = np.array([(not 'dict' in str(type(x))) for x in value])
|
|
331
|
+
|
|
332
|
+
if np.sum(types) > 0:
|
|
333
|
+
raise ValueError(name + ' must be a list of dictionaries')
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
return value
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
|
|
320
340
|
def validIntArray(name, value, required):
|
|
321
341
|
if not required and type(value) == type(None):
|
|
322
342
|
return
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
ellipsis/__init__.py,sha256=
|
|
1
|
+
ellipsis/__init__.py,sha256=pNIJjavEIZGWwAtesOpLrFsnp8VcxmlBAWrITOGTLg8,238
|
|
2
2
|
ellipsis/apiManager.py,sha256=T0YYV26r02yDMFO5ePmBbM4_gfy55KleECAyM1OSrCk,5598
|
|
3
|
-
ellipsis/sanitize.py,sha256=
|
|
4
|
-
ellipsis/account/__init__.py,sha256=
|
|
5
|
-
ellipsis/account/root.py,sha256=
|
|
3
|
+
ellipsis/sanitize.py,sha256=VuTPjHAUNCGUaOzKU2ojloiEN8kPhm53fIjbk6E9IEg,10597
|
|
4
|
+
ellipsis/account/__init__.py,sha256=jTmwL9HVS27vAHPC_2a98RQJWbpSKBN4ptiXpY0qJgk,101
|
|
5
|
+
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
|
+
ellipsis/compute/__init__.py,sha256=2UDm8SlCNXemkvDeNDnDV9HP_NU0ouwLVrjGzzqQ0Rc,48
|
|
9
|
+
ellipsis/compute/root.py,sha256=I89ut7UURp1Bx3yFQIOHwqLLc7RacKTvq7iyFZLIBKc,3343
|
|
8
10
|
ellipsis/path/__init__.py,sha256=NzdcTpXpicdrBWLgsFP6WY7ARIBKUFnkwa5VuB1Qdpc,506
|
|
9
11
|
ellipsis/path/root.py,sha256=GqiYjAkdSchkQf1NzcSFZvBrmoQir7K2fqmZosqghFM,7953
|
|
10
12
|
ellipsis/path/bookmark/__init__.py,sha256=vNrqGcWl5MN_xVAiClP6W6NilmsV-fqYOnJukbYcNwc,56
|
|
@@ -44,7 +46,7 @@ ellipsis/path/setUpTask/root.py,sha256=ERmbcGvxyCcGSKeJDe3bdYke9Do4VK02o-aeTQ77s
|
|
|
44
46
|
ellipsis/path/usage/__init__.py,sha256=2BHmLV9soOYDhyQFH2B86bBjmWXGsfuX4KneEBDo6O4,96
|
|
45
47
|
ellipsis/path/usage/root.py,sha256=NAZCDHXHcN6kodU3EpbNwlWM3It60ewsGXt4LJ_enG0,1566
|
|
46
48
|
ellipsis/path/vector/__init__.py,sha256=hIbJlp1kO_k2AhaFagUfd_We7taOBdD3K9n6lheWpYI,228
|
|
47
|
-
ellipsis/path/vector/root.py,sha256=
|
|
49
|
+
ellipsis/path/vector/root.py,sha256=XA6698yrY1HEHCUc7b8e_ideyuUWw2p-blE0w7p3I3E,1427
|
|
48
50
|
ellipsis/path/vector/featureProperty/__init__.py,sha256=-S6G0Sq66m8HVTg4bCp33fsUzYq-2hPueg5BotSpk2Q,81
|
|
49
51
|
ellipsis/path/vector/featureProperty/root.py,sha256=eb2bw4UGO3eYGaYgjwu43pZyA4iAjQTik_4HurZaGbM,2111
|
|
50
52
|
ellipsis/path/vector/style/__init__.py,sha256=riiDnL4FDq4EFhSYAYHBSe_o5oltRTSrj4sc72F6IVQ,63
|
|
@@ -65,8 +67,8 @@ ellipsis/user/__init__.py,sha256=um_b42pc2otFiQRGqMajcEtONQpC2ei4r-EY3j7bsfQ,43
|
|
|
65
67
|
ellipsis/user/root.py,sha256=dsMK6wGBdeCmOd3YsbIv9cEcQ6tAiSGr0jmtBhQl5-0,484
|
|
66
68
|
ellipsis/util/__init__.py,sha256=_sNBUXDKJVGffRyt93xdUrJ4gON651Sp-unr7LKVCEc,756
|
|
67
69
|
ellipsis/util/root.py,sha256=Ts7DeaD_X7x-csmq5V2sa_hYrt1mCd59T7-NUQcWj3Y,23980
|
|
68
|
-
ellipsis-3.1.
|
|
69
|
-
ellipsis-3.1.
|
|
70
|
-
ellipsis-3.1.
|
|
71
|
-
ellipsis-3.1.
|
|
72
|
-
ellipsis-3.1.
|
|
70
|
+
ellipsis-3.1.50.dist-info/LICENSE,sha256=7EI8xVBu6h_7_JlVw-yPhhOZlpY9hP8wal7kHtqKT_E,1074
|
|
71
|
+
ellipsis-3.1.50.dist-info/METADATA,sha256=F_4xCQHgtOAfNUsLIAKpCz6FXxgDP8RRhDQHya5YBYo,1823
|
|
72
|
+
ellipsis-3.1.50.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
73
|
+
ellipsis-3.1.50.dist-info/top_level.txt,sha256=eG8gfaVDyprKdb-dsGSh_lFMSa3DiZCsJFqze239RjA,9
|
|
74
|
+
ellipsis-3.1.50.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|