polytope-python 1.0.41__tar.gz → 1.1.0__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.
Files changed (120) hide show
  1. {polytope_python-1.0.41/polytope_python.egg-info → polytope_python-1.1.0}/PKG-INFO +1 -1
  2. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/backends/fdb.py +8 -13
  3. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/transformations/datacube_mappers/mapper_types/healpix_nested.py +1 -1
  4. polytope_python-1.1.0/polytope_feature/version.py +1 -0
  5. {polytope_python-1.0.41 → polytope_python-1.1.0/polytope_python.egg-info}/PKG-INFO +1 -1
  6. polytope_python-1.0.41/polytope_feature/version.py +0 -1
  7. {polytope_python-1.0.41 → polytope_python-1.1.0}/LICENSE +0 -0
  8. {polytope_python-1.0.41 → polytope_python-1.1.0}/MANIFEST.in +0 -0
  9. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/__init__.py +0 -0
  10. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/__init__.py +0 -0
  11. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/backends/__init__.py +0 -0
  12. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/backends/datacube.py +0 -0
  13. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/backends/mock.py +0 -0
  14. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/backends/xarray.py +0 -0
  15. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/datacube_axis.py +0 -0
  16. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/index_tree_pb2.py +0 -0
  17. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/tensor_index_tree.py +0 -0
  18. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/transformations/__init__.py +0 -0
  19. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/transformations/datacube_cyclic/__init__.py +0 -0
  20. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/transformations/datacube_cyclic/datacube_cyclic.py +0 -0
  21. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/transformations/datacube_mappers/__init__.py +0 -0
  22. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/transformations/datacube_mappers/datacube_mappers.py +0 -0
  23. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/transformations/datacube_mappers/mapper_types/__init__.py +0 -0
  24. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/transformations/datacube_mappers/mapper_types/healpix.py +0 -0
  25. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/transformations/datacube_mappers/mapper_types/local_regular.py +0 -0
  26. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/transformations/datacube_mappers/mapper_types/octahedral.py +0 -0
  27. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/transformations/datacube_mappers/mapper_types/reduced_gaussian.py +0 -0
  28. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/transformations/datacube_mappers/mapper_types/reduced_ll.py +0 -0
  29. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/transformations/datacube_mappers/mapper_types/regular.py +0 -0
  30. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/transformations/datacube_merger/__init__.py +0 -0
  31. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/transformations/datacube_merger/datacube_merger.py +0 -0
  32. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/transformations/datacube_reverse/__init__.py +0 -0
  33. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/transformations/datacube_reverse/datacube_reverse.py +0 -0
  34. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/transformations/datacube_transformations.py +0 -0
  35. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/transformations/datacube_type_change/__init__.py +0 -0
  36. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/transformations/datacube_type_change/datacube_type_change.py +0 -0
  37. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/datacube/tree_encoding.py +0 -0
  38. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/engine/__init__.py +0 -0
  39. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/engine/engine.py +0 -0
  40. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/engine/hullslicer.py +0 -0
  41. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/options.py +0 -0
  42. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/polytope.py +0 -0
  43. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/shapes.py +0 -0
  44. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/utility/__init__.py +0 -0
  45. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/utility/combinatorics.py +0 -0
  46. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/utility/exceptions.py +0 -0
  47. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/utility/geometry.py +0 -0
  48. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/utility/list_tools.py +0 -0
  49. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_feature/utility/profiling.py +0 -0
  50. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_python.egg-info/SOURCES.txt +0 -0
  51. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_python.egg-info/dependency_links.txt +0 -0
  52. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_python.egg-info/not-zip-safe +0 -0
  53. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_python.egg-info/requires.txt +0 -0
  54. {polytope_python-1.0.41 → polytope_python-1.1.0}/polytope_python.egg-info/top_level.txt +0 -0
  55. {polytope_python-1.0.41 → polytope_python-1.1.0}/pyproject.toml +0 -0
  56. {polytope_python-1.0.41 → polytope_python-1.1.0}/requirements.txt +0 -0
  57. {polytope_python-1.0.41 → polytope_python-1.1.0}/setup.cfg +0 -0
  58. {polytope_python-1.0.41 → polytope_python-1.1.0}/setup.py +0 -0
  59. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_axis_mappers.py +0 -0
  60. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_bad_request_error.py +0 -0
  61. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_combinatorics.py +0 -0
  62. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_cyclic_axis_over_negative_vals.py +0 -0
  63. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_cyclic_axis_slicer_not_0.py +0 -0
  64. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_cyclic_axis_slicing.py +0 -0
  65. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_cyclic_nearest.py +0 -0
  66. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_cyclic_simple.py +0 -0
  67. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_cyclic_snapping.py +0 -0
  68. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_datacube_axes_init.py +0 -0
  69. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_datacube_mock.py +0 -0
  70. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_datacube_xarray.py +0 -0
  71. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_date_time_unmerged.py +0 -0
  72. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_ecmwf_oper_data_fdb.py +0 -0
  73. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_engine_slicer.py +0 -0
  74. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_fdb_datacube.py +0 -0
  75. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_fdb_unmap_tree.py +0 -0
  76. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_float_type.py +0 -0
  77. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_healpix_mapper.py +0 -0
  78. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_healpix_nested_grid.py +0 -0
  79. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_hull_slicer.py +0 -0
  80. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_hullslicer_engine.py +0 -0
  81. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_incomplete_tree_fdb.py +0 -0
  82. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_local_grid_cyclic.py +0 -0
  83. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_local_regular_grid.py +0 -0
  84. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_local_swiss_grid.py +0 -0
  85. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_mappers.py +0 -0
  86. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_merge_cyclic_octahedral.py +0 -0
  87. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_merge_octahedral_one_axis.py +0 -0
  88. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_merge_transformation.py +0 -0
  89. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_multiple_param_fdb.py +0 -0
  90. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_octahedral_grid.py +0 -0
  91. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_override_md5_hash_options.py +0 -0
  92. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_point_nearest.py +0 -0
  93. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_point_shape.py +0 -0
  94. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_point_union.py +0 -0
  95. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_profiling_requesttree.py +0 -0
  96. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_reduced_ll_grid.py +0 -0
  97. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_regular_grid.py +0 -0
  98. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_regular_reduced_grid.py +0 -0
  99. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_request_tree.py +0 -0
  100. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_request_trees_after_slicing.py +0 -0
  101. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_reverse_transformation.py +0 -0
  102. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_shapes.py +0 -0
  103. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_slice_date_range_fdb.py +0 -0
  104. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_slice_date_range_fdb_v2.py +0 -0
  105. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_slice_fdb_box.py +0 -0
  106. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_slicer_engine.py +0 -0
  107. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_slicer_era5.py +0 -0
  108. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_slicer_xarray.py +0 -0
  109. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_slicing_unsliceable_axis.py +0 -0
  110. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_slicing_xarray_3D.py +0 -0
  111. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_slicing_xarray_4D.py +0 -0
  112. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_snapping.py +0 -0
  113. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_snapping_real_data.py +0 -0
  114. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_tree_protobuf.py +0 -0
  115. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_tree_protobuf_encoding.py +0 -0
  116. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_tree_protobuf_encoding_fdb.py +0 -0
  117. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_type_change_transformation.py +0 -0
  118. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_union_gj.py +0 -0
  119. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_union_point_box.py +0 -0
  120. {polytope_python-1.0.41 → polytope_python-1.1.0}/tests/test_wave_spectra_data.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: polytope-python
3
- Version: 1.0.41
3
+ Version: 1.1.0
4
4
  Summary: Polytope datacube feature extraction library
5
5
  Home-page: https://github.com/ecmwf/polytope
6
6
  Author: ECMWF
@@ -140,7 +140,7 @@ class FDBDatacube(Datacube):
140
140
  logging.debug("The requests we give GribJump are: %s", printed_list_to_gj)
141
141
  logging.info("Requests given to GribJump extract for %s", context)
142
142
  try:
143
- output_values = self.gj.extract(complete_list_complete_uncompressed_requests, context)
143
+ iterator = self.gj.extract(complete_list_complete_uncompressed_requests, context)
144
144
  except Exception as e:
145
145
  if "BadValue: Grid hash mismatch" in str(e):
146
146
  logging.info("Error is: %s", e)
@@ -152,10 +152,7 @@ class FDBDatacube(Datacube):
152
152
  raise e
153
153
 
154
154
  logging.info("Requests extracted from GribJump for %s", context)
155
- if logging.root.level <= logging.DEBUG:
156
- printed_output_values = output_values[::1000]
157
- logging.debug("GribJump outputs: %s", printed_output_values)
158
- self.assign_fdb_output_to_nodes(output_values, complete_fdb_decoding_info)
155
+ self.assign_fdb_output_to_nodes(iterator, complete_fdb_decoding_info)
159
156
 
160
157
  def get_fdb_requests(
161
158
  self,
@@ -205,11 +202,11 @@ class FDBDatacube(Datacube):
205
202
  original_fdb_node_range_vals = []
206
203
  new_current_start_idx = []
207
204
  for j, idx in enumerate(sub_lat_idxs):
208
- if idx.tolist() not in seen_indices:
205
+ if idx not in seen_indices:
209
206
  # NOTE: need to remove it from the values in the corresponding tree node
210
207
  # NOTE: need to read just the range we give to gj
211
208
  original_fdb_node_range_vals.append(actual_fdb_node[0].values[j])
212
- seen_indices.add(idx.tolist())
209
+ seen_indices.add(idx)
213
210
  new_current_start_idx.append(idx)
214
211
  if original_fdb_node_range_vals != []:
215
212
  actual_fdb_node[0].values = tuple(original_fdb_node_range_vals)
@@ -321,9 +318,8 @@ class FDBDatacube(Datacube):
321
318
  fdb_range_n[i].append(c)
322
319
  return (current_idx, fdb_range_n)
323
320
 
324
- def assign_fdb_output_to_nodes(self, output_values, fdb_requests_decoding_info):
325
- for k in range(len(output_values)):
326
- request_output_values = output_values[k]
321
+ def assign_fdb_output_to_nodes(self, output_iterator, fdb_requests_decoding_info):
322
+ for k, result in enumerate(output_iterator):
327
323
  (
328
324
  original_indices,
329
325
  fdb_node_ranges,
@@ -331,13 +327,12 @@ class FDBDatacube(Datacube):
331
327
  sorted_fdb_range_nodes = [fdb_node_ranges[i] for i in original_indices]
332
328
  for i in range(len(sorted_fdb_range_nodes)):
333
329
  n = sorted_fdb_range_nodes[i][0]
334
- if len(request_output_values[0]) == 0:
330
+ if len(result.values) == 0:
335
331
  # If we are here, no data was found for this path in the fdb
336
332
  none_array = [None] * len(n.values)
337
333
  n.result.extend(none_array)
338
334
  else:
339
- interm_request_output_values = request_output_values[0][i][0]
340
- n.result.extend(interm_request_output_values)
335
+ n.result.extend(result.values[i])
341
336
 
342
337
  def sort_fdb_request_ranges(self, current_start_idx, lat_length, fdb_node_ranges):
343
338
  (new_fdb_node_ranges, new_current_start_idx) = self.remove_duplicates_in_request_ranges(
@@ -113,7 +113,7 @@ class NestedHealpixGridMapper(DatacubeMapper):
113
113
  if not np.all(valid_mask):
114
114
  return None
115
115
  healpix_idxs = [self.axes_idx_to_healpix_idx(idx, sec_idx) for sec_idx in second_idxs]
116
- return self.ring_to_nested(np.asarray(healpix_idxs))
116
+ return self.ring_to_nested(np.asarray(healpix_idxs)).tolist()
117
117
 
118
118
  def div_03(self, a, b):
119
119
  """Vectorized version of div_03"""
@@ -0,0 +1 @@
1
+ __version__ = "1.1.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: polytope-python
3
- Version: 1.0.41
3
+ Version: 1.1.0
4
4
  Summary: Polytope datacube feature extraction library
5
5
  Home-page: https://github.com/ecmwf/polytope
6
6
  Author: ECMWF
@@ -1 +0,0 @@
1
- __version__ = "1.0.41"