Skip to content

Commit

Permalink
Merge pull request #246 from ecmwf/develop
Browse files Browse the repository at this point in the history
v1.0.12
  • Loading branch information
mathleur authored Nov 8, 2024
2 parents cf1433a + 4276f23 commit 9a02d2b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
10 changes: 10 additions & 0 deletions polytope_feature/datacube/backends/fdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,22 @@ def __init__(

self.gj = gj
if len(alternative_axes) == 0:
logging.info("Find GribJump axes for %s", context)
self.fdb_coordinates = self.gj.axes(partial_request, ctx=context)
logging.info("Retrieved available GribJump axes for %s", context)
if len(self.fdb_coordinates) == 0:
raise BadRequestError(partial_request)
else:
self.fdb_coordinates = {}
for axis_config in alternative_axes:
self.fdb_coordinates[axis_config.axis_name] = axis_config.values

fdb_coordinates_copy = deepcopy(self.fdb_coordinates)
for axis, vals in fdb_coordinates_copy.items():
if len(vals) == 1:
if vals[0] == "":
self.fdb_coordinates.pop(axis)

logging.info("Axes returned from GribJump are: " + str(self.fdb_coordinates))

self.fdb_coordinates["values"] = []
Expand Down Expand Up @@ -117,7 +125,9 @@ def get(self, requests: TensorIndexTree, context=None):
complete_list_complete_uncompressed_requests.append(complete_uncompressed_request)
complete_fdb_decoding_info.append(fdb_requests_decoding_info[j])
logging.debug("The requests we give GribJump are: %s", complete_list_complete_uncompressed_requests)
logging.info("Requests given to GribJump extract for %s", context)
output_values = self.gj.extract(complete_list_complete_uncompressed_requests, context)
logging.info("Requests extracted from GribJump for %s", context)
logging.debug("GribJump outputs: %s", output_values)
self.assign_fdb_output_to_nodes(output_values, complete_fdb_decoding_info)

Expand Down
2 changes: 1 addition & 1 deletion polytope_feature/shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ConvexPolytope(Shape):
def __init__(self, axes, points, method=None, is_orthogonal=False):
self._axes = list(axes)
self.is_flat = False
if len(self._axes) == 1:
if len(self._axes) == 1 and len(points) == 1:
self.is_flat = True
self.points = points
self.method = method
Expand Down
2 changes: 1 addition & 1 deletion polytope_feature/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.0.11"
__version__ = "1.0.12"
1 change: 0 additions & 1 deletion tests/requirements_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ cffi
eccodes
h5netcdf
h5py
earthkit
earthkit-data
2 changes: 1 addition & 1 deletion tests/test_datacube_axes_init.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import earthkit.data as data
import pytest
from earthkit import data
from helper_functions import download_test_data

from polytope_feature.datacube.datacube_axis import FloatDatacubeAxis
Expand Down

0 comments on commit 9a02d2b

Please sign in to comment.