ellipsis 3.1.46__tar.gz → 3.1.48__tar.gz

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.

Files changed (78) hide show
  1. {ellipsis-3.1.46 → ellipsis-3.1.48}/PKG-INFO +1 -1
  2. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/__init__.py +1 -1
  3. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/apiManager.py +5 -2
  4. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/__init__.py +1 -0
  5. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/file/root.py +11 -4
  6. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/raster/timestamp/root.py +2 -2
  7. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/root.py +3 -15
  8. ellipsis-3.1.48/ellipsis/path/setUpTask/__init__.py +2 -0
  9. ellipsis-3.1.48/ellipsis/path/setUpTask/root.py +50 -0
  10. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/vector/timestamp/feature/series/root.py +3 -3
  11. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis.egg-info/PKG-INFO +1 -1
  12. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis.egg-info/SOURCES.txt +2 -0
  13. {ellipsis-3.1.46 → ellipsis-3.1.48}/setup.py +1 -1
  14. {ellipsis-3.1.46 → ellipsis-3.1.48}/test/test.py +27 -4
  15. {ellipsis-3.1.46 → ellipsis-3.1.48}/LICENSE +0 -0
  16. {ellipsis-3.1.46 → ellipsis-3.1.48}/README.md +0 -0
  17. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/account/__init__.py +0 -0
  18. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/account/accessToken/__init__.py +0 -0
  19. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/account/accessToken/root.py +0 -0
  20. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/account/root.py +0 -0
  21. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/bookmark/__init__.py +0 -0
  22. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/bookmark/root.py +0 -0
  23. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/file/__init__.py +0 -0
  24. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/folder/__init__.py +0 -0
  25. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/folder/root.py +0 -0
  26. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/hashtag/__init__.py +0 -0
  27. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/hashtag/root.py +0 -0
  28. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/invite/__init__.py +0 -0
  29. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/invite/root.py +0 -0
  30. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/member/__init__.py +0 -0
  31. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/member/root.py +0 -0
  32. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/pointCloud/__init__.py +0 -0
  33. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/pointCloud/root.py +0 -0
  34. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/pointCloud/timestamp/__init__.py +0 -0
  35. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/pointCloud/timestamp/file/__init__.py +0 -0
  36. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/pointCloud/timestamp/file/root.py +0 -0
  37. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/pointCloud/timestamp/order/__init__.py +0 -0
  38. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/pointCloud/timestamp/order/root.py +0 -0
  39. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/pointCloud/timestamp/root.py +0 -0
  40. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/pointCloud/timestamp/util.py +0 -0
  41. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/raster/__init__.py +0 -0
  42. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/raster/root.py +0 -0
  43. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/raster/style/__init__.py +0 -0
  44. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/raster/style/root.py +0 -0
  45. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/raster/timestamp/__init__.py +0 -0
  46. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/raster/timestamp/file/__init__.py +0 -0
  47. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/raster/timestamp/file/root.py +0 -0
  48. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/raster/timestamp/order/__init__.py +0 -0
  49. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/raster/timestamp/order/root.py +0 -0
  50. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/raster/timestamp/util.py +0 -0
  51. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/usage/__init__.py +0 -0
  52. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/usage/root.py +0 -0
  53. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/vector/__init__.py +0 -0
  54. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/vector/featureProperty/__init__.py +0 -0
  55. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/vector/featureProperty/root.py +0 -0
  56. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/vector/root.py +0 -0
  57. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/vector/style/__init__.py +0 -0
  58. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/vector/style/root.py +0 -0
  59. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/vector/timestamp/__init__.py +0 -0
  60. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/vector/timestamp/feature/__init__.py +0 -0
  61. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/vector/timestamp/feature/message/__init__.py +0 -0
  62. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/vector/timestamp/feature/message/root.py +0 -0
  63. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/vector/timestamp/feature/root.py +0 -0
  64. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/vector/timestamp/feature/series/__init__.py +0 -0
  65. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/vector/timestamp/file/__init__.py +0 -0
  66. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/vector/timestamp/file/root.py +0 -0
  67. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/vector/timestamp/order/__init__.py +0 -0
  68. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/vector/timestamp/order/root.py +0 -0
  69. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/path/vector/timestamp/root.py +0 -0
  70. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/sanitize.py +0 -0
  71. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/user/__init__.py +0 -0
  72. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/user/root.py +0 -0
  73. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/util/__init__.py +0 -0
  74. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis/util/root.py +0 -0
  75. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis.egg-info/dependency_links.txt +0 -0
  76. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis.egg-info/requires.txt +0 -0
  77. {ellipsis-3.1.46 → ellipsis-3.1.48}/ellipsis.egg-info/top_level.txt +0 -0
  78. {ellipsis-3.1.46 → ellipsis-3.1.48}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ellipsis
3
- Version: 3.1.46
3
+ Version: 3.1.48
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
@@ -6,7 +6,7 @@ from ellipsis import user
6
6
  from ellipsis import path
7
7
  from ellipsis import util
8
8
 
9
- __version__ = '3.1.46'
9
+ __version__ = '3.1.48'
10
10
 
11
11
 
12
12
 
@@ -74,8 +74,10 @@ def call(method, url, body = None, token = None, crash = True, parseJson = True)
74
74
  try:
75
75
  r = actualCall(method, url, body, token)
76
76
  break
77
- except:
77
+ except Exception as ex:
78
78
  print('time out detected, retrying request')
79
+ print('url', url)
80
+ print('error',ex)
79
81
  time.sleep(WAIT)
80
82
  tried = tried +1
81
83
  if tried >= RETRIES:
@@ -125,7 +127,8 @@ def upload(url, filePath, body, token, key = 'data', memfile= None):
125
127
  conn_file = memfile
126
128
 
127
129
  payload = MultipartEncoder(fields = {**body, key: (fileName, conn_file, 'application/octet-stream')})
128
- token = 'Bearer ' + token
130
+ if not 'Bearer' in token:
131
+ token = 'Bearer ' + token
129
132
 
130
133
  r = requests.post(baseUrl + url, headers = {"Authorization":token, "Content-Type": payload.content_type}, data=payload, verify=False)
131
134
 
@@ -9,4 +9,5 @@ from ellipsis.path import usage
9
9
  from ellipsis.path import folder
10
10
  from ellipsis.path import file
11
11
  from ellipsis.path import bookmark
12
+ from ellipsis.path import setUpTask
12
13
 
@@ -8,20 +8,27 @@ import json
8
8
  import pandas as pd
9
9
 
10
10
 
11
- def add( filePath, token, parentId = None, publicAccess =None, metadata=None):
11
+ def add( token, filePath=None, memFile=None, parentId = None, publicAccess =None, metadata=None,name=None):
12
12
  token = sanitize.validString('token', token, True)
13
13
  parentId = sanitize.validUuid('parentId', parentId, False)
14
14
  publicAccess = sanitize.validObject('publicAccess', publicAccess, False)
15
15
  metadata = sanitize.validObject('metadata', metadata, False)
16
+ filePath = sanitize.validString('filePath', filePath, False)
17
+ name = sanitize.validString('name', name, False)
18
+ if type(memFile) == type(None) and type(filePath) == type(None):
19
+ raise ValueError('You need to specify either a filePath or a memFile')
20
+ if type(memFile) != type(None) and type(name) == type(None):
21
+ raise ValueError('Parameter name is required when using a memory file')
16
22
 
17
-
18
-
19
23
  seperator = os.path.sep
20
24
  fileName = filePath.split(seperator)[len(filePath.split(seperator))-1 ]
21
25
 
22
26
  body = {'name':fileName, 'publicAccess':publicAccess, 'metadata':metadata, 'parentId':parentId}
27
+ if type(memFile) == type(None):
28
+ r = apiManager.upload('/path/file' , filePath, body, token, key = 'data')
29
+ else:
30
+ r = apiManager.upload('/path/file' , filePath , name, body, token, memfile = memFile)
23
31
 
24
- r = apiManager.upload('/path/file' , filePath, body, token, key = 'data')
25
32
  return r
26
33
 
27
34
 
@@ -179,7 +179,7 @@ def getRaster(pathId, timestampId, extent, token = None, showProgress = True, ep
179
179
  as_jpg = info['raster']['asJpg']
180
180
  num_bands = len(bands)
181
181
  dtype = info['raster']['format']
182
-
182
+ accessLevel = info['yourAccess']['accessLevel']
183
183
  timestamps = info['raster']['timestamps']
184
184
  all_timestamps = [item['id'] for item in timestamps]
185
185
  if not timestampId in all_timestamps:
@@ -212,7 +212,7 @@ def getRaster(pathId, timestampId, extent, token = None, showProgress = True, ep
212
212
 
213
213
  N=0
214
214
  w = 256
215
- if not skipTar and ((x2_osm - x1_osm) * (y2_osm - y1_osm) > 50 or forceTar):
215
+ if not skipTar and ((x2_osm - x1_osm) * (y2_osm - y1_osm) > 50 and accessLevel > 100 or forceTar):
216
216
  tarZoom = next(item for item in timestamps if item["id"] == timestampId)['tarZoom']
217
217
 
218
218
  if type(tarZoom) != type(None):
@@ -155,24 +155,12 @@ def recover(pathId, token):
155
155
  }, token)
156
156
 
157
157
 
158
- def delete(pathId, token, recursive = False):
158
+ def delete(pathId, token):
159
159
  pathId = sanitize.validUuid('pathId', pathId, True)
160
160
  token = sanitize.validString('token', token, False)
161
- recursive = sanitize.validBool('recursive', recursive, True)
162
161
 
163
- if recursive:
164
- info = get(pathId, token)
165
- if info['type'] == 'folder':
166
- folders = listFolder(pathId = pathId, includeTrashed=True, pathTypes=['folder'], token=token)['result']
167
- for f in folders:
168
- delete(f['id'], token, True)
169
- maps = listFolder(pathId=pathId, pathTypes=['raster','vector','file', 'pointCloud'], includeTrashed=True, token=token)['result']
170
- for m in maps:
171
- delete(m['id'], token, True)
172
- apiManager.delete(f'/path/{pathId}', None, token)
173
-
174
- else:
175
- return apiManager.delete(f'/path/{pathId}', None, token)
162
+
163
+ return apiManager.delete(f'/path/{pathId}', None, token)
176
164
 
177
165
  def editPublicAccess(pathId, token, access = None, hidden=None, recursive = False):
178
166
  pathId = sanitize.validUuid('pathId', pathId, True)
@@ -0,0 +1,2 @@
1
+ from ellipsis.path.setUpTask.root import get, copernicusImport, fileImport
2
+
@@ -0,0 +1,50 @@
1
+ from ellipsis import apiManager
2
+ from ellipsis import sanitize
3
+ import os
4
+
5
+ def get(token):
6
+ token = sanitize.validString('token', token, False)
7
+
8
+ r = apiManager.get('/path/setUpTask', {}, token)
9
+
10
+ return r
11
+
12
+
13
+ def copernicusImport( parameters, token):
14
+ token = sanitize.validString('token', token, True)
15
+ parameters = sanitize.validObject('parameters', parameters, True)
16
+ r = apiManager.post('/path/setUpTask', {'type':'copernicusImport', 'parameters':parameters}, token)
17
+
18
+ return r
19
+
20
+
21
+ def fileImport( token, memFile=None, parentId = None, filePath=None, fileFormat = 'geopackage', name = None):
22
+ token = sanitize.validString('token', token, True)
23
+ parentId = sanitize.validUuid(('parentId', parentId, False))
24
+ filePath = sanitize.validString('filePath', filePath, False)
25
+ name = sanitize.validString('name', name, False)
26
+ fileFormat = sanitize.validString('fileFormat', fileFormat, True)
27
+
28
+
29
+ if type(memFile) == type(None) and type(filePath) == type(None):
30
+ raise ValueError('You need to specify either a filePath or a memFile')
31
+ if type(memFile) != type(None) and type(name) == type(None):
32
+ raise ValueError('Parameter name is required when using a memory file')
33
+
34
+ if type(name) != type(None):
35
+ nameToUse = name
36
+ else:
37
+ seperator = os.path.sep
38
+ nameToUse = filePath.split(seperator)[len(filePath.split(seperator)) - 1]
39
+
40
+ parameters = {'name': nameToUse, 'parentId': parentId}
41
+ body = {'type': fileFormat + 'Import', 'parameters': parameters}
42
+ if type(memFile) == type(None):
43
+ r = apiManager.post('/path/setUpTask', body, token)
44
+ else:
45
+ r = apiManager.upload('/path/setUpTask' , filePath , name, body, token, memfile = memFile)
46
+ return r
47
+
48
+
49
+
50
+
@@ -82,17 +82,17 @@ def add(pathId, timestampId, seriesData, token, featureId=None, showProgress = T
82
82
  df_sub['value'] = seriesData[c].astype(float)
83
83
  dfs_long = dfs_long + [df_sub]
84
84
  seriesData_long = pd.concat(dfs_long)
85
-
86
85
  if uploadAsFile:
87
86
 
88
87
  memfile = BytesIO()
89
- seriesData_long.to_csv(memfile)
88
+ seriesData_long.to_csv(memfile, na_rep='null')
90
89
 
91
90
  res = apiManager.upload(url = '/path/' + pathId + '/vector/timestamp/' + timestampId + '/feature/series', filePath = 'upload', body= {'name':'upload'}, token = token, key = 'data', memfile= memfile)
92
91
  return res
93
92
  else:
94
- values = seriesData_long.to_dict('records')
93
+ seriesData_long = seriesData_long.replace({float('nan'): None})
95
94
 
95
+ values = seriesData_long.to_dict('records')
96
96
 
97
97
  chunks_values = chunks(values)
98
98
  N = 0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ellipsis
3
- Version: 3.1.46
3
+ Version: 3.1.48
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
@@ -47,6 +47,8 @@ ellipsis/path/raster/timestamp/file/__init__.py
47
47
  ellipsis/path/raster/timestamp/file/root.py
48
48
  ellipsis/path/raster/timestamp/order/__init__.py
49
49
  ellipsis/path/raster/timestamp/order/root.py
50
+ ellipsis/path/setUpTask/__init__.py
51
+ ellipsis/path/setUpTask/root.py
50
52
  ellipsis/path/usage/__init__.py
51
53
  ellipsis/path/usage/root.py
52
54
  ellipsis/path/vector/__init__.py
@@ -6,7 +6,7 @@ with open("README.md", "r") as fh:
6
6
 
7
7
  setuptools.setup(
8
8
  name="ellipsis",
9
- version="3.1.46",
9
+ version="3.1.48",
10
10
  author="Daniel van der Maas",
11
11
  author_email="daniel@ellipsis-drive.com",
12
12
  description="Package to interact with the Ellipsis API",
@@ -9,8 +9,11 @@ import pandas as pd
9
9
 
10
10
  import os
11
11
 
12
- token = el.account.logIn('admin', '')
13
-
12
+ file = '/home/daniel/Ellipsis/keys/admin'
13
+ with open(file,'r') as c:
14
+ password = c.read()
15
+ password = password[0:-1]
16
+ token = el.account.logIn('admin', password)
14
17
 
15
18
 
16
19
  ####################################
@@ -18,9 +21,7 @@ token = el.account.logIn('admin', '')
18
21
  #python3 setup.py sdist bdist_wheel
19
22
  #twine upload --repository pypi dist/*
20
23
 
21
- token = el.account.logIn(username = 'admin', password='')
22
24
 
23
- el.apiManager.baseUrl = 'https://acc.api.ellipsis-drive.com/v3'
24
25
  ##access token
25
26
  el.account.accessToken.create(description = 'hoi', accessList = [{'pathId': '46e1e919-8b73-42a3-a575-25c6d45fd93b' , 'access':{'accessTier':'view'}}], token = token)
26
27
  tokenId = el.account.accessToken.get(token, listAll = True)['result'][0]['id']
@@ -555,3 +556,25 @@ out = el.util.saveVector(features = sh, targetFile = b)
555
556
 
556
557
  el.path.vector.timestamp.file.add(pathId = 'c6a341e1-59bf-44f8-a0d7-0962415a8fa2', timestampId= 'ad490f78-0cf0-426e-9238-e0ef803c7371', token = token, fileFormat='gpkg', memFile=out, name = 'test.gpkg')
557
558
 
559
+
560
+
561
+ ###add series
562
+ import geopandas as gpd
563
+ import numpy as np
564
+ import pandas as pd
565
+ import datetime
566
+ layerId = el.path.vector.add(name = 'series test', token = token)['id']
567
+ timestampId = el.path.vector.timestamp.add(pathId = layerId, token = token)['id']
568
+
569
+ features = gpd.read_file('/home/daniel/Ellipsis/db/testset/buildings_mini')
570
+
571
+ featureIds = el.path.vector.timestamp.feature.add(pathId = layerId, timestampId=timestampId, features=features, token = token)
572
+ N = 1000
573
+ x = [float(x) for x in np.arange(N)]
574
+ featureId = np.repeat(featureIds[0], N)
575
+ date = np.repeat( datetime.datetime.now(),N)
576
+ seriesData = pd.DataFrame({'date':date, 'featureId': featureId, 'x':x })
577
+ seriesData['x'].values[4] = np.nan
578
+ el.path.vector.timestamp.feature.series.add(pathId = layerId, timestampId = timestampId, uploadAsFile = True, seriesData=seriesData, token=token)
579
+
580
+ t = pd.read_csv('/home/daniel/Downloads/test.csv')
File without changes
File without changes
File without changes