Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
27d6de8
start to incorporate qubed latest
mathleur Feb 24, 2025
a13861a
start to incorporate qubed latest
mathleur Feb 24, 2025
c415f7b
add qubed tests
mathleur Feb 24, 2025
a411cc8
qubed tree slicing
mathleur Feb 25, 2025
422f4c1
add qubed slice operaiton
mathleur Feb 28, 2025
ec4285d
Merge branch 'develop' of github.com:ecmwf/polytope into feature/inte…
mathleur Mar 25, 2025
e46258e
include axes transformations and datacube axes in qubed slicing
mathleur Mar 25, 2025
6251edb
WIP
mathleur Mar 25, 2025
df39ace
WIP
mathleur Mar 26, 2025
ac32f00
make qubed test work
mathleur Mar 26, 2025
836f923
fix bugs
mathleur Apr 3, 2025
a4fd597
clean up
mathleur Apr 10, 2025
b4e52e5
WIP
mathleur Apr 16, 2025
a418337
fix slicing polytopes across several child nodes
mathleur Apr 17, 2025
3afaa2e
start adding grid axes
mathleur Apr 17, 2025
f2ada06
finish adding prototype of grid axes
mathleur Apr 17, 2025
6159237
clean up and start integrating into polytope fe
mathleur Apr 22, 2025
290bc82
integrate qubed more into a backend + slicer
mathleur Apr 22, 2025
21519f5
WIP extract data for qubed datacube
mathleur Apr 22, 2025
636f32a
use new gj iterator for qubed backend WIP
mathleur Apr 23, 2025
8acef9f
make prototype qubed integration work and compare against fdb
mathleur Apr 23, 2025
2e5c080
add the service part of the qubed like the pre-path
mathleur Apr 24, 2025
a8a06c9
clean up
mathleur Apr 25, 2025
1b4305a
start refactoring
mathleur Apr 25, 2025
d3548df
start incorporating transformations inside qubed
mathleur Apr 28, 2025
05948ac
add everything except grid transformations
mathleur Apr 28, 2025
931bc30
add support for cyclic axes on qubed datacube
mathleur Apr 29, 2025
e30f17f
remove unnecessary md5 hash assignment
mathleur Apr 29, 2025
edf527e
update gitignore
mathleur Jun 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,12 @@ new_polytope_venv
*.json
venv_python3_11
*.txt
tests/data
tests/data
venv_gj_iterator
new_venv_gj_iterator
**/build
*.so
*.lock
**/_version.py
rust_deployment_venv
**/target
7 changes: 7 additions & 0 deletions polytope_feature/datacube/backends/datacube.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ def get_indices(self, path: DatacubePath, axis, lower, upper, method=None):
e.g. returns integer discrete points between two floats
"""
path = self.fit_path(path)
print(path)
indexes = axis.find_indexes(path, self)

idx_between = axis.find_indices_between(indexes, lower, upper, self, method)
Expand Down Expand Up @@ -166,6 +167,12 @@ def create(datacube, config={}, axis_options={}, compressed_axes_options=[], alt
datacube, config, axis_options, compressed_axes_options, alternative_axes, context
)
return fdbdatacube
if type(datacube).__name__ == "QubedDatacube":
from .qubed import QubedDatacube
# TODO: here we create the qubeddatacube twice..., which we do not want
qubed_datacube = QubedDatacube(datacube.q, datacube.datacube_axes, datacube.datacube_transformations,
config, axis_options, compressed_axes_options, alternative_axes, context)
return qubed_datacube

def check_branching_axes(self, request):
pass
17 changes: 6 additions & 11 deletions polytope_feature/datacube/backends/fdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def get(self, requests: TensorIndexTree, context=None):
logging.debug("The requests we give GribJump are: %s", printed_list_to_gj)
logging.info("Requests given to GribJump extract for %s", context)
try:
output_values = self.gj.extract(complete_list_complete_uncompressed_requests, context)
iterator = self.gj.extract(complete_list_complete_uncompressed_requests, context)
except Exception as e:
if "BadValue: Grid hash mismatch" in str(e):
logging.info("Error is: %s", e)
Expand All @@ -152,10 +152,7 @@ def get(self, requests: TensorIndexTree, context=None):
raise e

logging.info("Requests extracted from GribJump for %s", context)
if logging.root.level <= logging.DEBUG:
printed_output_values = output_values[::1000]
logging.debug("GribJump outputs: %s", printed_output_values)
self.assign_fdb_output_to_nodes(output_values, complete_fdb_decoding_info)
self.assign_fdb_output_to_nodes(iterator, complete_fdb_decoding_info)

def get_fdb_requests(
self,
Expand Down Expand Up @@ -321,23 +318,21 @@ def get_last_layer_before_leaf(self, requests, leaf_path, current_idx, fdb_range
fdb_range_n[i].append(c)
return (current_idx, fdb_range_n)

def assign_fdb_output_to_nodes(self, output_values, fdb_requests_decoding_info):
for k in range(len(output_values)):
request_output_values = output_values[k]
def assign_fdb_output_to_nodes(self, output_iterator, fdb_requests_decoding_info):
for k, result in enumerate(output_iterator):
(
original_indices,
fdb_node_ranges,
) = fdb_requests_decoding_info[k]
sorted_fdb_range_nodes = [fdb_node_ranges[i] for i in original_indices]
for i in range(len(sorted_fdb_range_nodes)):
n = sorted_fdb_range_nodes[i][0]
if len(request_output_values[0]) == 0:
if len(result.values) == 0:
# If we are here, no data was found for this path in the fdb
none_array = [None] * len(n.values)
n.result.extend(none_array)
else:
interm_request_output_values = request_output_values[0][i][0]
n.result.extend(interm_request_output_values)
n.result.extend(result.values[i])

def sort_fdb_request_ranges(self, current_start_idx, lat_length, fdb_node_ranges):
(new_fdb_node_ranges, new_current_start_idx) = self.remove_duplicates_in_request_ranges(
Expand Down
Loading