ellipsis 3.1.48__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 CHANGED
@@ -5,8 +5,8 @@ from ellipsis import account
5
5
  from ellipsis import user
6
6
  from ellipsis import path
7
7
  from ellipsis import util
8
-
9
- __version__ = '3.1.48'
8
+ from ellipsis import compute
9
+ __version__ = '3.1.50'
10
10
 
11
11
 
12
12
 
@@ -1,4 +1,4 @@
1
1
 
2
- from ellipsis.account.root import logIn, listRoot
2
+ from ellipsis.account.root import logIn, listRoot, getInfo
3
3
 
4
4
  from ellipsis.account import accessToken
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)
ellipsis/apiManager.py CHANGED
@@ -116,6 +116,7 @@ def actualCall(method, url, body, token):
116
116
  return r
117
117
 
118
118
  def upload(url, filePath, body, token, key = 'data', memfile= None):
119
+ body['debug'] = True
119
120
  body = filterNone(body, toString=True)
120
121
 
121
122
  seperator = os.path.sep
@@ -0,0 +1 @@
1
+ from ellipsis.compute.root import createCluster
@@ -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
+
@@ -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)
@@ -13,6 +13,9 @@ from ellipsis.path import get as getInfo
13
13
 
14
14
  import datetime
15
15
 
16
+
17
+
18
+
16
19
  def add(pathId, token, properties = None, description = None, date ={'from': datetime.datetime.now(), 'to': datetime.datetime.now()}):
17
20
 
18
21
  pathId = sanitize.validUuid('pathId', pathId, True)
@@ -150,7 +153,8 @@ def getFeaturesByIds(pathId, timestampId, featureIds, token = None, showProgress
150
153
  sh = sh.to_crs('EPSG:' + str(epsg))
151
154
  r['result'] = sh
152
155
  return r
153
-
156
+
157
+
154
158
 
155
159
  def getFeaturesByExtent(pathId, timestampId, extent, propertyFilter = None, token = None, listAll = True, pageStart = None, epsg = 4326, coordinateBuffer = None, onlyIfCenterPointInExtent = False):
156
160
  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,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ellipsis
3
- Version: 3.1.48
3
+ Version: 3.1.50
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
@@ -11,22 +11,22 @@ Classifier: Operating System :: OS Independent
11
11
  Requires-Python: >=3.6
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE
14
- Requires-Dist: pandas
14
+ Requires-Dist: Fiona
15
15
  Requires-Dist: Pillow
16
- Requires-Dist: matplotlib
16
+ Requires-Dist: Shapely
17
17
  Requires-Dist: geopandas
18
- Requires-Dist: pyproj
18
+ Requires-Dist: geopy
19
+ Requires-Dist: imagecodecs
19
20
  Requires-Dist: imageio
21
+ Requires-Dist: matplotlib
20
22
  Requires-Dist: numpy
21
- Requires-Dist: imagecodecs
23
+ Requires-Dist: pandas
24
+ Requires-Dist: pygltflib
25
+ Requires-Dist: pyproj
26
+ Requires-Dist: rasterio
22
27
  Requires-Dist: requests
23
28
  Requires-Dist: requests-toolbelt
24
- Requires-Dist: rasterio
25
- Requires-Dist: Shapely
26
- Requires-Dist: geopy
27
29
  Requires-Dist: scikit-image
28
- Requires-Dist: Fiona
29
- Requires-Dist: pygltflib
30
30
  Requires-Dist: tifffile
31
31
 
32
32
  # Ellipsis Drive Python Package
@@ -1,10 +1,12 @@
1
- ellipsis/__init__.py,sha256=KwTCnOXo6LwHgK67wjnduQDCLwIlXztMDJs1-tCnAWg,210
2
- ellipsis/apiManager.py,sha256=iU8HoHycJSDowyjiSqAMaqRY1MgoaPWwFeYCiJfzaaE,5573
3
- ellipsis/sanitize.py,sha256=T5FawJRZ2eqGv0itiMkZ1fuJpahsSyhBMFty9cG-wwA,10194
4
- ellipsis/account/__init__.py,sha256=K40DMBaUDSxt3rO2WZv63Wmpfy49ocqBxvWqyIYHR24,92
5
- ellipsis/account/root.py,sha256=tgGAT2BzP3zgAqsevvkeognn5S67T-MrIP52BLN9rbE,1791
1
+ ellipsis/__init__.py,sha256=pNIJjavEIZGWwAtesOpLrFsnp8VcxmlBAWrITOGTLg8,238
2
+ ellipsis/apiManager.py,sha256=T0YYV26r02yDMFO5ePmBbM4_gfy55KleECAyM1OSrCk,5598
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,13 +46,13 @@ 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=dGW6md_Hxu8y0IZ2sX8FJuH8aEy-qPY5IpsyMKKhtgo,984
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
51
53
  ellipsis/path/vector/style/root.py,sha256=09PsRbCJ35YV8bl8xoWFoeGRpdmf5IBmmqwhRj30OTM,1641
52
54
  ellipsis/path/vector/timestamp/__init__.py,sha256=n0ncRxXoQIDX1WeV0lbpJH1BND793CdZ5swGgeu1Kfk,330
53
- ellipsis/path/vector/timestamp/root.py,sha256=kcLdfBWpoqRXWswz-nqrEM0mxw6oEZc5sUFCD_B4JRk,11296
55
+ ellipsis/path/vector/timestamp/root.py,sha256=MrYfAUKzmIXnt8DYRYU9YB6pqnNexcWcXUu4Ze3WUGc,11296
54
56
  ellipsis/path/vector/timestamp/feature/__init__.py,sha256=miaLCHkogL9KJ_eUr4K_N15BShAe2ivcppDFJuE_SgI,210
55
57
  ellipsis/path/vector/timestamp/feature/root.py,sha256=Y_GiT1vBEvZxxvJdUvzhjGqYsfPfi1L6qHBS5jNcnBY,7212
56
58
  ellipsis/path/vector/timestamp/feature/message/__init__.py,sha256=XfX3MIa4RjpToFnxNyfxCKTvRlNtJFRQ44j31wDyhGc,100
@@ -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.48.dist-info/LICENSE,sha256=7EI8xVBu6h_7_JlVw-yPhhOZlpY9hP8wal7kHtqKT_E,1074
69
- ellipsis-3.1.48.dist-info/METADATA,sha256=sdIfJZ4ddvKrElMJq-XraR859JmHykpGB_ai2HnPCW4,1823
70
- ellipsis-3.1.48.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
71
- ellipsis-3.1.48.dist-info/top_level.txt,sha256=eG8gfaVDyprKdb-dsGSh_lFMSa3DiZCsJFqze239RjA,9
72
- ellipsis-3.1.48.dist-info/RECORD,,
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,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.37.1)
2
+ Generator: bdist_wheel (0.42.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5