polytope-python 1.0.10__tar.gz → 1.0.11__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.
- {polytope-python-1.0.10/polytope_python.egg-info → polytope-python-1.0.11}/PKG-INFO +1 -1
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/backends/datacube.py +5 -3
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/backends/fdb.py +9 -2
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/backends/xarray.py +1 -1
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/polytope.py +11 -9
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/utility/exceptions.py +6 -0
- polytope-python-1.0.11/polytope_feature/version.py +1 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11/polytope_python.egg-info}/PKG-INFO +1 -1
- polytope-python-1.0.10/polytope_feature/version.py +0 -1
- {polytope-python-1.0.10 → polytope-python-1.0.11}/LICENSE +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/MANIFEST.in +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/__init__.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/__init__.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/backends/__init__.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/backends/mock.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/datacube_axis.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/index_tree_pb2.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/tensor_index_tree.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/transformations/__init__.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/transformations/datacube_cyclic/__init__.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/transformations/datacube_cyclic/datacube_cyclic.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/transformations/datacube_mappers/__init__.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/transformations/datacube_mappers/datacube_mappers.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/transformations/datacube_mappers/mapper_types/__init__.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/transformations/datacube_mappers/mapper_types/healpix.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/transformations/datacube_mappers/mapper_types/healpix_nested.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/transformations/datacube_mappers/mapper_types/local_regular.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/transformations/datacube_mappers/mapper_types/octahedral.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/transformations/datacube_mappers/mapper_types/reduced_ll.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/transformations/datacube_mappers/mapper_types/regular.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/transformations/datacube_merger/__init__.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/transformations/datacube_merger/datacube_merger.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/transformations/datacube_reverse/__init__.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/transformations/datacube_reverse/datacube_reverse.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/transformations/datacube_transformations.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/transformations/datacube_type_change/__init__.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/transformations/datacube_type_change/datacube_type_change.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/tree_encoding.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/engine/__init__.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/engine/engine.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/engine/hullslicer.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/options.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/shapes.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/utility/__init__.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/utility/combinatorics.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/utility/geometry.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/utility/list_tools.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/utility/profiling.py +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_python.egg-info/SOURCES.txt +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_python.egg-info/dependency_links.txt +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_python.egg-info/not-zip-safe +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_python.egg-info/requires.txt +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_python.egg-info/top_level.txt +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/pyproject.toml +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/requirements.txt +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/setup.cfg +0 -0
- {polytope-python-1.0.10 → polytope-python-1.0.11}/setup.py +0 -0
{polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/backends/datacube.py
RENAMED
|
@@ -148,17 +148,19 @@ class Datacube(ABC):
|
|
|
148
148
|
return path
|
|
149
149
|
|
|
150
150
|
@staticmethod
|
|
151
|
-
def create(datacube, config={}, axis_options={}, compressed_axes_options=[], alternative_axes=[]):
|
|
151
|
+
def create(datacube, config={}, axis_options={}, compressed_axes_options=[], alternative_axes=[], context=None):
|
|
152
152
|
# TODO: get the configs as None for pre-determined value and change them to empty dictionary inside the function
|
|
153
153
|
if type(datacube).__name__ == "DataArray":
|
|
154
154
|
from .xarray import XArrayDatacube
|
|
155
155
|
|
|
156
|
-
xadatacube = XArrayDatacube(datacube, axis_options, compressed_axes_options)
|
|
156
|
+
xadatacube = XArrayDatacube(datacube, axis_options, compressed_axes_options, context)
|
|
157
157
|
return xadatacube
|
|
158
158
|
if type(datacube).__name__ == "GribJump":
|
|
159
159
|
from .fdb import FDBDatacube
|
|
160
160
|
|
|
161
|
-
fdbdatacube = FDBDatacube(
|
|
161
|
+
fdbdatacube = FDBDatacube(
|
|
162
|
+
datacube, config, axis_options, compressed_axes_options, alternative_axes, context
|
|
163
|
+
)
|
|
162
164
|
return fdbdatacube
|
|
163
165
|
|
|
164
166
|
def check_branching_axes(self, request):
|
|
@@ -3,14 +3,19 @@ import operator
|
|
|
3
3
|
from copy import deepcopy
|
|
4
4
|
from itertools import product
|
|
5
5
|
|
|
6
|
+
from ...utility.exceptions import BadRequestError
|
|
6
7
|
from ...utility.geometry import nearest_pt
|
|
7
8
|
from .datacube import Datacube, TensorIndexTree
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class FDBDatacube(Datacube):
|
|
11
|
-
def __init__(
|
|
12
|
+
def __init__(
|
|
13
|
+
self, gj, config=None, axis_options=None, compressed_axes_options=[], alternative_axes=[], context=None
|
|
14
|
+
):
|
|
12
15
|
if config is None:
|
|
13
16
|
config = {}
|
|
17
|
+
if context is None:
|
|
18
|
+
context = {}
|
|
14
19
|
|
|
15
20
|
super().__init__(axis_options, compressed_axes_options)
|
|
16
21
|
|
|
@@ -24,7 +29,9 @@ class FDBDatacube(Datacube):
|
|
|
24
29
|
|
|
25
30
|
self.gj = gj
|
|
26
31
|
if len(alternative_axes) == 0:
|
|
27
|
-
self.fdb_coordinates = self.gj.axes(partial_request)
|
|
32
|
+
self.fdb_coordinates = self.gj.axes(partial_request, ctx=context)
|
|
33
|
+
if len(self.fdb_coordinates) == 0:
|
|
34
|
+
raise BadRequestError(partial_request)
|
|
28
35
|
else:
|
|
29
36
|
self.fdb_coordinates = {}
|
|
30
37
|
for axis_config in alternative_axes:
|
{polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/backends/xarray.py
RENAMED
|
@@ -9,7 +9,7 @@ from .datacube import Datacube
|
|
|
9
9
|
class XArrayDatacube(Datacube):
|
|
10
10
|
"""Xarray arrays are labelled, axes can be defined as strings or integers (e.g. "time" or 0)."""
|
|
11
11
|
|
|
12
|
-
def __init__(self, dataarray: xr.DataArray, axis_options=None, compressed_axes_options=[]):
|
|
12
|
+
def __init__(self, dataarray: xr.DataArray, axis_options=None, compressed_axes_options=[], context=None):
|
|
13
13
|
super().__init__(axis_options, compressed_axes_options)
|
|
14
14
|
if axis_options is None:
|
|
15
15
|
axis_options = {}
|
|
@@ -39,7 +39,7 @@ class Request:
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
class Polytope:
|
|
42
|
-
def __init__(self, datacube, engine=None, options=None):
|
|
42
|
+
def __init__(self, datacube, engine=None, options=None, context=None):
|
|
43
43
|
from .datacube import Datacube
|
|
44
44
|
from .engine import Engine
|
|
45
45
|
|
|
@@ -48,7 +48,11 @@ class Polytope:
|
|
|
48
48
|
|
|
49
49
|
axis_options, compressed_axes_options, config, alternative_axes = PolytopeOptions.get_polytope_options(options)
|
|
50
50
|
|
|
51
|
-
self.
|
|
51
|
+
self.context = context
|
|
52
|
+
|
|
53
|
+
self.datacube = Datacube.create(
|
|
54
|
+
datacube, config, axis_options, compressed_axes_options, alternative_axes, self.context
|
|
55
|
+
)
|
|
52
56
|
self.engine = engine if engine is not None else Engine.default()
|
|
53
57
|
self.time = 0
|
|
54
58
|
|
|
@@ -56,14 +60,12 @@ class Polytope:
|
|
|
56
60
|
"""Low-level API which takes a polytope geometry object and uses it to slice the datacube"""
|
|
57
61
|
return self.engine.extract(self.datacube, polytopes)
|
|
58
62
|
|
|
59
|
-
def retrieve(self, request: Request, method="standard"
|
|
63
|
+
def retrieve(self, request: Request, method="standard"):
|
|
60
64
|
"""Higher-level API which takes a request and uses it to slice the datacube"""
|
|
61
|
-
|
|
62
|
-
context = {}
|
|
63
|
-
logging.info("Starting request for %s ", context)
|
|
65
|
+
logging.info("Starting request for %s ", self.context)
|
|
64
66
|
self.datacube.check_branching_axes(request)
|
|
65
67
|
request_tree = self.engine.extract(self.datacube, request.polytopes())
|
|
66
|
-
logging.info("Created request tree for %s ", context)
|
|
67
|
-
self.datacube.get(request_tree, context)
|
|
68
|
-
logging.info("Retrieved data for %s ", context)
|
|
68
|
+
logging.info("Created request tree for %s ", self.context)
|
|
69
|
+
self.datacube.get(request_tree, self.context)
|
|
70
|
+
logging.info("Retrieved data for %s ", self.context)
|
|
69
71
|
return request_tree
|
|
@@ -2,6 +2,12 @@ class PolytopeError(Exception):
|
|
|
2
2
|
pass
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
class BadRequestError(PolytopeError):
|
|
6
|
+
def __init__(self, pre_path):
|
|
7
|
+
self.pre_path = pre_path
|
|
8
|
+
self.message = f"No data for {pre_path} is available on the FDB."
|
|
9
|
+
|
|
10
|
+
|
|
5
11
|
class AxisOverdefinedError(PolytopeError, KeyError):
|
|
6
12
|
def __init__(self, axis):
|
|
7
13
|
self.axis = axis
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.0.11"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.0.10"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/backends/__init__.py
RENAMED
|
File without changes
|
{polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/backends/mock.py
RENAMED
|
File without changes
|
{polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/datacube_axis.py
RENAMED
|
File without changes
|
{polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/index_tree_pb2.py
RENAMED
|
File without changes
|
{polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/tensor_index_tree.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_feature/datacube/tree_encoding.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{polytope-python-1.0.10 → polytope-python-1.0.11}/polytope_python.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|