ellipsis 3.2.0__py3-none-any.whl → 3.2.1__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.0'
9
+ __version__ = '3.2.1'
10
10
 
11
11
 
12
12
 
ellipsis/apiManager.py CHANGED
@@ -140,7 +140,7 @@ def upload(url, filePath, body, token, key = 'data', memfile= None):
140
140
  raise ValueError(r.text)
141
141
  return r.json()
142
142
 
143
- def download(url, filePath, token = None, memfile = None):
143
+ def download(url, filePath=None, token = None, memfile = None):
144
144
  if type(token) == type(None):
145
145
  with requests.get(baseUrl + url, stream=True) as r:
146
146
  r.raise_for_status()
@@ -1 +1 @@
1
- from ellipsis.compute.root import createCompute, listComputes, execute
1
+ from ellipsis.compute.root import createCompute, listComputes, execute, terminatecompute, terminateAll, addToLayer
ellipsis/compute/root.py CHANGED
@@ -4,17 +4,19 @@ import time
4
4
 
5
5
  from ellipsis.util.root import recurse
6
6
  from ellipsis import sanitize
7
- from ellipsis import apiManager
8
7
  from ellipsis.account import getInfo
8
+ from ellipsis import apiManager
9
+ from ellipsis.path.raster.timestamp.file import add as addFile
10
+ from ellipsis.path.raster.timestamp import activate
11
+ from io import BytesIO
9
12
 
10
-
11
- def createCompute(layers, token, nodes=None, interpreter='python3.12', requirements= [], awaitTillStarted = True):
13
+ def createCompute(layers, token, nodes=None, interpreter='python3.12', requirements= [], awaitTillStarted = True, largeResult = False):
12
14
  layers = sanitize.validDictArray('layers', layers, True)
13
15
  token = sanitize.validString('token', token, True)
14
16
  nodes = sanitize.validInt('nodes', nodes, False)
15
17
  interpreter = sanitize.validString('interpreter', interpreter, True)
16
18
  requirements = sanitize.validStringArray('requirements', requirements, False)
17
-
19
+ largeResult = sanitize.validBool('largeResult', largeResult, True)
18
20
  if type(nodes) == type(None):
19
21
  info = getInfo(token=token)
20
22
  nodes = info['plan']['maxComputeNodes']
@@ -23,7 +25,7 @@ def createCompute(layers, token, nodes=None, interpreter='python3.12', requireme
23
25
 
24
26
  requirements = "\n".join(requirements)
25
27
 
26
- body = {'layers':layers, 'interpreter':interpreter, 'nodes':nodes, 'requirements':requirements}
28
+ body = {'layers':layers, 'interpreter':interpreter, 'nodes':nodes, 'requirements':requirements, 'largeResult': largeResult}
27
29
  r = apiManager.post('/compute', body, token)
28
30
 
29
31
  computeId = r['id']
@@ -64,7 +66,8 @@ def execute(computeId, f, token, awaitTillCompleted=True):
64
66
  if x['type'] == 'exception':
65
67
  raise x['value']
66
68
 
67
- values = [x['value'] for x in r['result']]
69
+
70
+ values = [ '/compute/' + computeId + '/file/'+ x['value'] if x['type'] == 'file' else x['value'] for x in r['result']]
68
71
  return values
69
72
 
70
73
  def parseResults(r):
@@ -133,6 +136,23 @@ def listComputes(token, pageStart = None, listAll = True):
133
136
  r = recurse(f, body, listAll)
134
137
  for i in range(len(r['result'])):
135
138
  if 'result' in r['result'][i]:
136
- r['result'][i]['result'] = parseResults(r['result'][i]['result'])
139
+ r['result'][i]['result'] = parseResults(r['result'][i]['result'])
137
140
  return r
138
141
 
142
+ def addToLayer(response, pathId, timestampId, token):
143
+ pathId = sanitize.validUuid('pathId', pathId, True)
144
+ timestampId = sanitize.validUuid('timestampId', timestampId, True)
145
+ token = sanitize.validString('token', token, True)
146
+
147
+ for url in response:
148
+ memfile = downloadFile(url, filePath, token)
149
+ addFile(pathId = pathId, timestampId=timestampId, token = token, fileFormat='tif', memFile=memfile, name='out.tif')
150
+ activate(pathId=pathId, timestampId=timestampId, token=token)
151
+
152
+
153
+
154
+ def downloadFile(url, filePath, token):
155
+ memfile = BytesIO()
156
+ apiManager.download(url = url, filePath='', memfile=memfile, token = token)
157
+ memfile.seek(0)
158
+ return memfile
@@ -6,7 +6,6 @@ from ellipsis.util.root import reprojectRaster
6
6
  from ellipsis.path.raster.timestamp.util import constructImage
7
7
  from ellipsis.path.raster.timestamp.util import cutOfTilesPerZoom
8
8
 
9
- from rasterio.io import MemoryFile
10
9
  from skimage.transform import resize
11
10
  import json
12
11
  import numpy as np
@@ -31,6 +30,8 @@ def getSampledRaster(pathId, timestampId, extent, width, height, epsg=3857, toke
31
30
  epsg = sanitize.validInt('epsg', epsg, True)
32
31
 
33
32
  res = getActualExtent(extent['xMin'], extent['xMax'], extent['yMin'], extent['yMax'], 'EPSG:' + str(epsg))
33
+ #res = getActualExtent(minx = extentWeb['xMin'], maxx = extentWeb['xMax'], miny = extentWeb['yMin'], maxy = extentWeb['yMax'], crs = 'EPSG:3857', out_crs = 4326)
34
+ #extent = res['message']
34
35
 
35
36
  if res['status'] == '400':
36
37
  raise ValueError('Invalid epsg and extent combination')
@@ -46,7 +47,7 @@ def getSampledRaster(pathId, timestampId, extent, width, height, epsg=3857, toke
46
47
 
47
48
 
48
49
  r = tifffile.imread(BytesIO(r.content))
49
-
50
+ #np.unique(r)
50
51
  r = np.transpose(r, [2,0,1])
51
52
 
52
53
 
@@ -1,2 +1,2 @@
1
- from ellipsis.path.vector.timestamp.file.root import get, add, download
1
+ from ellipsis.path.vector.timestamp.file.root import get, add, download, revert, recover, delete
2
2
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ellipsis
3
- Version: 3.2.0
3
+ Version: 3.2.1
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,24 +11,24 @@ 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: Fiona
14
+ Requires-Dist: pandas
15
15
  Requires-Dist: Pillow
16
- Requires-Dist: Shapely
17
- Requires-Dist: dill
16
+ Requires-Dist: matplotlib
18
17
  Requires-Dist: geopandas
19
- Requires-Dist: geopy
20
- Requires-Dist: imagecodecs
18
+ Requires-Dist: pyproj
21
19
  Requires-Dist: imageio
22
- Requires-Dist: matplotlib
23
20
  Requires-Dist: numpy
24
- Requires-Dist: pandas
25
- Requires-Dist: pygltflib
26
- Requires-Dist: pyproj
27
- Requires-Dist: rasterio
21
+ Requires-Dist: imagecodecs
28
22
  Requires-Dist: requests
29
23
  Requires-Dist: requests-toolbelt
24
+ Requires-Dist: rasterio
25
+ Requires-Dist: Shapely
26
+ Requires-Dist: geopy
30
27
  Requires-Dist: scikit-image
28
+ Requires-Dist: Fiona
29
+ Requires-Dist: pygltflib
31
30
  Requires-Dist: tifffile
31
+ Requires-Dist: dill
32
32
 
33
33
  # Ellipsis Drive Python Package
34
34
 
@@ -1,12 +1,12 @@
1
- ellipsis/__init__.py,sha256=-_z5ZgwqTjO6gsw3IBYRdaa9yjVdgrnnVFOLyIQJtr4,237
2
- ellipsis/apiManager.py,sha256=T0YYV26r02yDMFO5ePmBbM4_gfy55KleECAyM1OSrCk,5598
1
+ ellipsis/__init__.py,sha256=-Xy1_i1cnwMfp6HBcWbfwqRb43Ho-SWJ8WSgQ04-UAs,237
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
5
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=-FC0XRa4C66PSNOzMPuyqt4SNLFSThvH4GWa5CPLVz4,71
9
- ellipsis/compute/root.py,sha256=l2F-UGpl50yNWjTebC4Q_Qul5e4B_tCcisQc_gPE170,4315
8
+ ellipsis/compute/__init__.py,sha256=D_PEEIfNar00N85LUF4m1p9R4icrnAktJP_26PoAPqA,115
9
+ ellipsis/compute/root.py,sha256=Ec5BgrfGDV_cKN-3RpMVLJqRv9mk1kKRRggbxKmsV1Y,5342
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
@@ -35,7 +35,7 @@ ellipsis/path/raster/root.py,sha256=-y0SEukHEYUDvyJyDI1x7gtcDm-Wum_Ze7ekSYJr6O4,
35
35
  ellipsis/path/raster/style/__init__.py,sha256=mxlqVtSd2dsKai3DAVQjtNsh2KnTrZVyF8loRwUNT7E,61
36
36
  ellipsis/path/raster/style/root.py,sha256=YFQlGTdgjpwXn4h0ug7LrQZFLmRp2bdJN71A0iqZRFo,1627
37
37
  ellipsis/path/raster/timestamp/__init__.py,sha256=brmFXg69CKRcWaAfPbxWfsvHvnn5q8GBQhVzUTVb4_w,842
38
- ellipsis/path/raster/timestamp/root.py,sha256=AVwrLIcyyK_1G90C3jLCWFSFxisv5bzIobdt5IHk5R0,17330
38
+ ellipsis/path/raster/timestamp/root.py,sha256=JxMjB834jVHYsjA9KeIjUttvf9K5S8zHI44iC03cdhQ,17507
39
39
  ellipsis/path/raster/timestamp/util.py,sha256=eupFFSBp5CaTDIRg6DYnZnfWY61h81JZ7c15NdJ-j5E,2580
40
40
  ellipsis/path/raster/timestamp/file/__init__.py,sha256=Ln9_dQ4-PMwb5VP--Qh09IV5zmr-47RShpe0-f_NVh4,97
41
41
  ellipsis/path/raster/timestamp/file/root.py,sha256=KD8E64eZtS62C-WCl3BTeVjsc08BaLXpuLwxfbmnTLI,4545
@@ -59,7 +59,7 @@ ellipsis/path/vector/timestamp/feature/message/__init__.py,sha256=XfX3MIa4RjpToF
59
59
  ellipsis/path/vector/timestamp/feature/message/root.py,sha256=isLzkITTiluKoIsH0PYT0K5Cr-LBzTA0TSE4-2tZU5M,3949
60
60
  ellipsis/path/vector/timestamp/feature/series/__init__.py,sha256=vPi57QdUPTEnQE31abgxzwWU3Gzu-Xxi3ZVD4z5MMwg,107
61
61
  ellipsis/path/vector/timestamp/feature/series/root.py,sha256=DEeX5noIHMQA-sNlyLnxiZEBBEs5Xpsnclv9Xfe6Uas,7605
62
- ellipsis/path/vector/timestamp/file/__init__.py,sha256=qJtOXI9MEv4KifDjMW3zUDKnef8PD69SQmgRc3wDShQ,73
62
+ ellipsis/path/vector/timestamp/file/__init__.py,sha256=sLdDeC6kiLxrQmHzyVJfg8MAT1JdzdZ2LdnguOllrUI,98
63
63
  ellipsis/path/vector/timestamp/file/root.py,sha256=STswXCVZMtLmYceXKQsLKhyNmWzifDHp084mdS9fYLQ,4736
64
64
  ellipsis/path/vector/timestamp/order/__init__.py,sha256=w11nMYDQJzZJU_q8o7ApadV2EOdCX93gNkHZ7PO1gUo,74
65
65
  ellipsis/path/vector/timestamp/order/root.py,sha256=kknhHJSuj91WaRF-qzfovummHwplwyizi5q-V8cA0To,1249
@@ -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.2.0.dist-info/LICENSE,sha256=7EI8xVBu6h_7_JlVw-yPhhOZlpY9hP8wal7kHtqKT_E,1074
71
- ellipsis-3.2.0.dist-info/METADATA,sha256=pynnmna2DzMd4oP8ASvlM24b2fQA18IsinJOFzEn-Rw,1842
72
- ellipsis-3.2.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
73
- ellipsis-3.2.0.dist-info/top_level.txt,sha256=eG8gfaVDyprKdb-dsGSh_lFMSa3DiZCsJFqze239RjA,9
74
- ellipsis-3.2.0.dist-info/RECORD,,
70
+ ellipsis-3.2.1.dist-info/LICENSE,sha256=7EI8xVBu6h_7_JlVw-yPhhOZlpY9hP8wal7kHtqKT_E,1074
71
+ ellipsis-3.2.1.dist-info/METADATA,sha256=wehcxhDesgn_cQzN89hMbh36KVDaLSrDDTbmiI0GNA4,1842
72
+ ellipsis-3.2.1.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
73
+ ellipsis-3.2.1.dist-info/top_level.txt,sha256=eG8gfaVDyprKdb-dsGSh_lFMSa3DiZCsJFqze239RjA,9
74
+ ellipsis-3.2.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: setuptools (75.3.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5