polytope-python 1.1.1__tar.gz → 2.0.2__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 (286) hide show
  1. polytope_python-2.0.2/.github/ci-config.yml +13 -0
  2. polytope_python-2.0.2/.github/ci-hpc-config.yml +21 -0
  3. polytope_python-2.0.2/.github/workflows/cd.yml +30 -0
  4. polytope_python-2.0.2/.github/workflows/downstream-ci.yml +40 -0
  5. polytope_python-2.0.2/.github/workflows/label-public-pr.yml +10 -0
  6. polytope_python-2.0.2/.github/workflows/test-pypi.yml +32 -0
  7. polytope_python-2.0.2/.gitignore +78 -0
  8. polytope_python-2.0.2/.pre-commit-config.yaml +16 -0
  9. polytope_python-2.0.2/.readthedocs.yaml +33 -0
  10. polytope_python-2.0.2/ACKNOWLEDGEMENTS.rst +8 -0
  11. polytope_python-2.0.2/CONTRIBUTING.rst +20 -0
  12. polytope_python-2.0.2/Makefile +20 -0
  13. polytope_python-2.0.2/PKG-INFO +248 -0
  14. polytope_python-2.0.2/README.md +203 -0
  15. polytope_python-2.0.2/codecov.yml +15 -0
  16. polytope_python-2.0.2/docs/Algorithm/Developer_Guide/API.md +52 -0
  17. polytope_python-2.0.2/docs/Algorithm/Developer_Guide/Axis_types.md +99 -0
  18. polytope_python-2.0.2/docs/Algorithm/Developer_Guide/Datacube.md +38 -0
  19. polytope_python-2.0.2/docs/Algorithm/Developer_Guide/Overview.md +19 -0
  20. polytope_python-2.0.2/docs/Algorithm/Developer_Guide/Slicer.md +46 -0
  21. polytope_python-2.0.2/docs/Algorithm/Developer_Guide/images/Polytope_APIs_3.png +0 -0
  22. polytope_python-2.0.2/docs/Algorithm/Developer_Guide/images/polytope_components_5.png +0 -0
  23. polytope_python-2.0.2/docs/Algorithm/Developer_Guide/images/slicing_process.png +0 -0
  24. polytope_python-2.0.2/docs/Algorithm/Developer_Guide/shapes.md +190 -0
  25. polytope_python-2.0.2/docs/Algorithm/Overview/Overview.md +38 -0
  26. polytope_python-2.0.2/docs/Algorithm/Overview/Polytope_at_ECMWF.md +32 -0
  27. polytope_python-2.0.2/docs/Algorithm/Overview/images_overview/ecmwf_datacube.png +0 -0
  28. polytope_python-2.0.2/docs/Algorithm/Overview/images_overview/ecmwf_polytope.png +0 -0
  29. polytope_python-2.0.2/docs/Algorithm/User_Guide/Building_Features.md +41 -0
  30. polytope_python-2.0.2/docs/Algorithm/User_Guide/Example.md +51 -0
  31. polytope_python-2.0.2/docs/Algorithm/User_Guide/Getting_started.md +42 -0
  32. polytope_python-2.0.2/docs/Algorithm/User_Guide/Overview.md +33 -0
  33. polytope_python-2.0.2/docs/Algorithm/User_Guide/images_users/shipping_route.png +0 -0
  34. polytope_python-2.0.2/docs/Service/Data_Portfolio.md +150 -0
  35. polytope_python-2.0.2/docs/Service/Design_doc.md +484 -0
  36. polytope_python-2.0.2/docs/Service/Examples/OpenData/od_boundingbox_example.ipynb +703 -0
  37. polytope_python-2.0.2/docs/Service/Examples/OpenData/od_country_example.ipynb +578 -0
  38. polytope_python-2.0.2/docs/Service/Examples/OpenData/od_polygon_example.ipynb +675 -0
  39. polytope_python-2.0.2/docs/Service/Examples/OpenData/od_timeseries_example.ipynb +188 -0
  40. polytope_python-2.0.2/docs/Service/Examples/OpenData/od_trajectory_example.ipynb +571 -0
  41. polytope_python-2.0.2/docs/Service/Examples/OpenData/od_vertical_profile_example.ipynb +152 -0
  42. polytope_python-2.0.2/docs/Service/Examples/boundingbox_example.ipynb +560 -0
  43. polytope_python-2.0.2/docs/Service/Examples/country_example.ipynb +558 -0
  44. polytope_python-2.0.2/docs/Service/Examples/examples.md +23 -0
  45. polytope_python-2.0.2/docs/Service/Examples/polygon_example.ipynb +547 -0
  46. polytope_python-2.0.2/docs/Service/Examples/timeseries_example.ipynb +191 -0
  47. polytope_python-2.0.2/docs/Service/Examples/trajectory_example.ipynb +562 -0
  48. polytope_python-2.0.2/docs/Service/Examples/vertical_profile_example.ipynb +123 -0
  49. polytope_python-2.0.2/docs/Service/Features/boundingbox.md +86 -0
  50. polytope_python-2.0.2/docs/Service/Features/feature.md +22 -0
  51. polytope_python-2.0.2/docs/Service/Features/polygon.md +85 -0
  52. polytope_python-2.0.2/docs/Service/Features/timeseries.md +113 -0
  53. polytope_python-2.0.2/docs/Service/Features/trajectory.md +139 -0
  54. polytope_python-2.0.2/docs/Service/Features/vertical_profile.md +107 -0
  55. polytope_python-2.0.2/docs/Service/Installation.md +55 -0
  56. polytope_python-2.0.2/docs/Service/Overview.md +42 -0
  57. polytope_python-2.0.2/docs/Service/Quick_Start.md +72 -0
  58. polytope_python-2.0.2/docs/extra.css +25 -0
  59. polytope_python-2.0.2/docs/images/flight_path.png +0 -0
  60. polytope_python-2.0.2/docs/images/greece.png +0 -0
  61. polytope_python-2.0.2/docs/images/logo.gif +0 -0
  62. polytope_python-2.0.2/docs/images/polytope_feature.png +0 -0
  63. polytope_python-2.0.2/docs/images/polytope_logo_new_animated_AdobeExpress_3.gif +0 -0
  64. polytope_python-2.0.2/docs/images/timeseries.png +0 -0
  65. polytope_python-2.0.2/docs/images/timeseries_example.png +0 -0
  66. polytope_python-2.0.2/docs/images/timeseries_qs.png +0 -0
  67. polytope_python-2.0.2/docs/index.md +70 -0
  68. polytope_python-2.0.2/docs/requirements.txt +3 -0
  69. polytope_python-2.0.2/examples/3D_shipping_route.py +96 -0
  70. polytope_python-2.0.2/examples/3D_shipping_route_wave_model.py +131 -0
  71. polytope_python-2.0.2/examples/4D_flight_path.py +150 -0
  72. polytope_python-2.0.2/examples/country_slicing.py +99 -0
  73. polytope_python-2.0.2/examples/cyclic_route_around_earth.py +58 -0
  74. polytope_python-2.0.2/examples/data/EMODnet_HA_WindFarms_pg_20220324.shp +3 -0
  75. polytope_python-2.0.2/examples/data/EMODnet_HA_WindFarms_pg_20220324.shx +0 -0
  76. polytope_python-2.0.2/examples/data/Shipping-Lanes-v1.shp +3 -0
  77. polytope_python-2.0.2/examples/data/Shipping-Lanes-v1.shx +0 -0
  78. polytope_python-2.0.2/examples/data/World_Countries__Generalized_.shp +3 -0
  79. polytope_python-2.0.2/examples/data/World_Countries__Generalized_.shx +0 -0
  80. polytope_python-2.0.2/examples/data/earth_image.jpg +3 -0
  81. polytope_python-2.0.2/examples/data/map_earth_4k.jpg +3 -0
  82. polytope_python-2.0.2/examples/data/mars_req_9km_wind.req +12 -0
  83. polytope_python-2.0.2/examples/data/mars_req_levels.req +13 -0
  84. polytope_python-2.0.2/examples/data/mars_req_timeseries.req +12 -0
  85. polytope_python-2.0.2/examples/data/output4.grib +3 -0
  86. polytope_python-2.0.2/examples/data/output4.req +12 -0
  87. polytope_python-2.0.2/examples/data/output8.grib +3 -0
  88. polytope_python-2.0.2/examples/data/output8.req +12 -0
  89. polytope_python-2.0.2/examples/data/temp_model_levels.grib +3 -0
  90. polytope_python-2.0.2/examples/data/timeseries_t2m.grib +3 -0
  91. polytope_python-2.0.2/examples/data/winds.grib +3 -0
  92. polytope_python-2.0.2/examples/healpix_grid_box_example.py +83 -0
  93. polytope_python-2.0.2/examples/octahedral_grid_box_example.py +94 -0
  94. polytope_python-2.0.2/examples/octahedral_grid_country_example.py +116 -0
  95. polytope_python-2.0.2/examples/plotting_country_data.py +201 -0
  96. polytope_python-2.0.2/examples/read_me_example.py +24 -0
  97. polytope_python-2.0.2/examples/requirements_examples.txt +13 -0
  98. polytope_python-2.0.2/examples/slicing_all_ecmwf_countries.py +157 -0
  99. polytope_python-2.0.2/examples/timeseries_example.py +226 -0
  100. polytope_python-2.0.2/examples/wind_farms.py +94 -0
  101. polytope_python-2.0.2/mkdocs.yml +44 -0
  102. polytope_python-2.0.2/performance/fdb_performance.py +47 -0
  103. polytope_python-2.0.2/performance/fdb_performance_3D.py +49 -0
  104. polytope_python-2.0.2/performance/fdb_scalability_plot.py +16 -0
  105. polytope_python-2.0.2/performance/fdb_slice_many_numbers_timeseries.py +77 -0
  106. polytope_python-2.0.2/performance/performance_many_num_steps.py +59 -0
  107. polytope_python-2.0.2/performance/plotting_scalability.py +71 -0
  108. polytope_python-2.0.2/performance/scalability_test.py +490 -0
  109. polytope_python-2.0.2/performance/scalability_test_2.py +104 -0
  110. polytope_python-2.0.2/performance_unstructured/octahedral_vs_unstructured_slicing.py +350 -0
  111. polytope_python-2.0.2/performance_unstructured/plot_structured_vs_unstructured_slicing.py +32 -0
  112. polytope_python-2.0.2/polytope_feature/__init__.py +2 -0
  113. polytope_python-2.0.2/polytope_feature/_version.py +2 -0
  114. polytope_python-2.0.2/polytope_feature/datacube/backends/catalogue_helper.py +38 -0
  115. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/backends/datacube.py +35 -5
  116. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/backends/fdb.py +32 -8
  117. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/backends/mock.py +8 -5
  118. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/backends/xarray.py +31 -14
  119. polytope_python-2.0.2/polytope_feature/datacube/index_tree.proto +13 -0
  120. polytope_python-2.0.2/polytope_feature/datacube/quadtree/quad_tree.py +174 -0
  121. polytope_python-2.0.2/polytope_feature/datacube/quadtree/quadtree_additional_operations.py +57 -0
  122. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/tensor_index_tree.py +5 -6
  123. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/transformations/datacube_mappers/datacube_mappers.py +45 -13
  124. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/transformations/datacube_mappers/mapper_types/healpix.py +8 -2
  125. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/transformations/datacube_mappers/mapper_types/healpix_nested.py +65 -29
  126. polytope_python-2.0.2/polytope_feature/datacube/transformations/datacube_mappers/mapper_types/irregular.py +63 -0
  127. polytope_python-2.0.2/polytope_feature/datacube/transformations/datacube_mappers/mapper_types/irregular_mapper_types/__init__.py +1 -0
  128. polytope_python-2.0.2/polytope_feature/datacube/transformations/datacube_mappers/mapper_types/irregular_mapper_types/icon.py +45 -0
  129. polytope_python-2.0.2/polytope_feature/datacube/transformations/datacube_mappers/mapper_types/irregular_mapper_types/lambert_conformal.py +274 -0
  130. polytope_python-2.0.2/polytope_feature/datacube/transformations/datacube_mappers/mapper_types/irregular_mapper_types/unstructured.py +32 -0
  131. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/transformations/datacube_mappers/mapper_types/local_regular.py +9 -2
  132. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/transformations/datacube_mappers/mapper_types/octahedral.py +59 -36
  133. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/transformations/datacube_mappers/mapper_types/reduced_gaussian.py +8 -2
  134. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/transformations/datacube_mappers/mapper_types/reduced_ll.py +8 -2
  135. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/transformations/datacube_mappers/mapper_types/regular.py +8 -3
  136. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/transformations/datacube_type_change/datacube_type_change.py +101 -0
  137. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/tree_encoding.py +0 -1
  138. polytope_python-2.0.2/polytope_feature/engine/engine.py +43 -0
  139. polytope_python-2.0.2/polytope_feature/engine/hullslicer.py +156 -0
  140. polytope_python-2.0.2/polytope_feature/engine/optimised_point_in_polygon_slicer.py +119 -0
  141. polytope_python-2.0.2/polytope_feature/engine/optimised_quadtree_slicer.py +94 -0
  142. polytope_python-2.0.2/polytope_feature/engine/point_in_polygon_slicer.py +103 -0
  143. polytope_python-2.0.2/polytope_feature/engine/quadtree_slicer.py +72 -0
  144. polytope_python-2.0.2/polytope_feature/engine/slicing_tools.py +136 -0
  145. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/options.py +39 -7
  146. polytope_python-2.0.2/polytope_feature/polytope.py +239 -0
  147. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/shapes.py +90 -12
  148. polytope_python-2.0.2/polytope_feature/utility/engine_tools.py +31 -0
  149. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/utility/exceptions.py +7 -0
  150. polytope_python-2.0.2/polytope_python.egg-info/PKG-INFO +248 -0
  151. polytope_python-2.0.2/polytope_python.egg-info/SOURCES.txt +269 -0
  152. polytope_python-2.0.2/polytope_python.egg-info/requires.txt +19 -0
  153. polytope_python-2.0.2/pyproject.toml +98 -0
  154. polytope_python-2.0.2/rust/Cargo.toml +13 -0
  155. polytope_python-2.0.2/rust/src/distance.rs +33 -0
  156. polytope_python-2.0.2/rust/src/healpix_nested.rs +273 -0
  157. polytope_python-2.0.2/rust/src/lambert_conformal.rs +224 -0
  158. polytope_python-2.0.2/rust/src/lib.rs +40 -0
  159. polytope_python-2.0.2/rust/src/list_tools.rs +20 -0
  160. polytope_python-2.0.2/rust/src/octahedral.rs +7979 -0
  161. polytope_python-2.0.2/rust/src/point_in_polygon.rs +102 -0
  162. polytope_python-2.0.2/rust/src/quadtree_mod.rs +396 -0
  163. polytope_python-2.0.2/rust/src/slicing_tools.rs +191 -0
  164. polytope_python-2.0.2/setup.py +40 -0
  165. polytope_python-2.0.2/tests/conftest.py +113 -0
  166. polytope_python-2.0.2/tests/fdb_data/schema +55 -0
  167. polytope_python-2.0.2/tests/helper_functions.py +54 -0
  168. polytope_python-2.0.2/tests/profiled_quadtree.profile +0 -0
  169. polytope_python-2.0.2/tests/quadtree_slicer_profiler.py +97 -0
  170. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_bad_request_error.py +0 -5
  171. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_cyclic_axis_over_negative_vals.py +1 -1
  172. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_cyclic_axis_slicer_not_0.py +0 -3
  173. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_cyclic_axis_slicing.py +0 -3
  174. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_cyclic_nearest.py +4 -9
  175. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_cyclic_simple.py +0 -3
  176. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_cyclic_snapping.py +1 -3
  177. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_datacube_axes_init.py +1 -4
  178. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_datacube_xarray.py +2 -2
  179. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_date_time_unmerged.py +0 -3
  180. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_ecmwf_oper_data_fdb.py +1 -11
  181. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_engine_slicer.py +21 -25
  182. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_fdb_datacube.py +0 -6
  183. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_fdb_unmap_tree.py +0 -3
  184. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_float_type.py +1 -3
  185. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_healpix_mapper.py +1 -4
  186. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_healpix_nested_grid.py +1 -2
  187. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_hullslicer_engine.py +2 -4
  188. polytope_python-2.0.2/tests/test_icon_grid_unstructured.py +109 -0
  189. polytope_python-2.0.2/tests/test_icon_grid_unstructured_fdb.py +104 -0
  190. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_incomplete_tree_fdb.py +1 -6
  191. polytope_python-2.0.2/tests/test_lambert_lam_grid_unstructured_fdb.py +208 -0
  192. polytope_python-2.0.2/tests/test_lambert_lam_grid_unstructured_fdb_optimised_quadtree.py +109 -0
  193. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_local_grid_cyclic.py +0 -6
  194. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_local_regular_grid.py +0 -22
  195. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_local_swiss_grid.py +0 -1
  196. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_merge_octahedral_one_axis.py +1 -4
  197. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_merge_transformation.py +0 -3
  198. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_multiple_param_fdb.py +0 -4
  199. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_octahedral_grid.py +1 -4
  200. polytope_python-2.0.2/tests/test_orca_irregular_grid.py +94 -0
  201. polytope_python-2.0.2/tests/test_orca_irregular_grid_optimised_point_in_polygon.py +95 -0
  202. polytope_python-2.0.2/tests/test_orca_irregular_grid_point_in_polygon.py +94 -0
  203. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_override_md5_hash_options.py +0 -4
  204. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_point_nearest.py +9 -24
  205. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_point_shape.py +1 -4
  206. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_point_union.py +0 -4
  207. polytope_python-2.0.2/tests/test_polytope_extract.py +56 -0
  208. polytope_python-2.0.2/tests/test_polytope_extract_fdb.py +95 -0
  209. polytope_python-2.0.2/tests/test_quad_tree.py +200 -0
  210. polytope_python-2.0.2/tests/test_quadtree_edge_cases.py +65 -0
  211. polytope_python-2.0.2/tests/test_quadtree_indices.py +115 -0
  212. polytope_python-2.0.2/tests/test_quadtree_optimisation.py +57 -0
  213. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_reduced_ll_grid.py +1 -1
  214. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_regular_grid.py +1 -4
  215. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_regular_reduced_grid.py +7 -4
  216. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_request_tree.py +3 -65
  217. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_request_trees_after_slicing.py +8 -10
  218. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_reverse_transformation.py +1 -1
  219. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_shapes.py +5 -10
  220. polytope_python-2.0.2/tests/test_shapes_volume.py +21 -0
  221. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_slice_date_range_fdb.py +21 -35
  222. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_slice_date_range_fdb_v2.py +0 -4
  223. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_slice_fdb_box.py +0 -1
  224. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_slicer_engine.py +2 -4
  225. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_slicer_era5.py +1 -4
  226. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_slicer_xarray.py +1 -3
  227. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_slicing_unsliceable_axis.py +13 -5
  228. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_slicing_xarray_3D.py +43 -4
  229. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_slicing_xarray_4D.py +1 -3
  230. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_snapping.py +1 -3
  231. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_snapping_real_data.py +8 -10
  232. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_tree_protobuf_encoding.py +0 -3
  233. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_tree_protobuf_encoding_fdb.py +0 -4
  234. polytope_python-2.0.2/tests/test_type_change_transformation.py +70 -0
  235. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_union_gj.py +0 -8
  236. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_union_point_box.py +0 -4
  237. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_wave_spectra_data.py +6 -3
  238. polytope_python-2.0.2/tox.ini +10 -0
  239. polytope_python-1.1.1/MANIFEST.in +0 -1
  240. polytope_python-1.1.1/PKG-INFO +0 -21
  241. polytope_python-1.1.1/polytope_feature/__init__.py +0 -1
  242. polytope_python-1.1.1/polytope_feature/engine/engine.py +0 -19
  243. polytope_python-1.1.1/polytope_feature/engine/hullslicer.py +0 -327
  244. polytope_python-1.1.1/polytope_feature/polytope.py +0 -78
  245. polytope_python-1.1.1/polytope_feature/version.py +0 -1
  246. polytope_python-1.1.1/polytope_python.egg-info/PKG-INFO +0 -21
  247. polytope_python-1.1.1/polytope_python.egg-info/SOURCES.txt +0 -117
  248. polytope_python-1.1.1/polytope_python.egg-info/not-zip-safe +0 -1
  249. polytope_python-1.1.1/polytope_python.egg-info/requires.txt +0 -8
  250. polytope_python-1.1.1/pyproject.toml +0 -8
  251. polytope_python-1.1.1/requirements.txt +0 -8
  252. polytope_python-1.1.1/setup.py +0 -29
  253. polytope_python-1.1.1/tests/test_type_change_transformation.py +0 -31
  254. {polytope_python-1.1.1 → polytope_python-2.0.2}/LICENSE +0 -0
  255. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/__init__.py +0 -0
  256. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/backends/__init__.py +0 -0
  257. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/datacube_axis.py +0 -0
  258. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/index_tree_pb2.py +0 -0
  259. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/transformations/__init__.py +0 -0
  260. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/transformations/datacube_cyclic/__init__.py +0 -0
  261. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/transformations/datacube_cyclic/datacube_cyclic.py +0 -0
  262. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/transformations/datacube_mappers/__init__.py +0 -0
  263. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/transformations/datacube_mappers/mapper_types/__init__.py +0 -0
  264. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/transformations/datacube_merger/__init__.py +0 -0
  265. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/transformations/datacube_merger/datacube_merger.py +0 -0
  266. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/transformations/datacube_reverse/__init__.py +0 -0
  267. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/transformations/datacube_reverse/datacube_reverse.py +0 -0
  268. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/transformations/datacube_transformations.py +0 -0
  269. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/datacube/transformations/datacube_type_change/__init__.py +0 -0
  270. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/engine/__init__.py +0 -0
  271. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/utility/__init__.py +0 -0
  272. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/utility/combinatorics.py +0 -0
  273. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/utility/geometry.py +0 -0
  274. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/utility/list_tools.py +0 -0
  275. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_feature/utility/profiling.py +0 -0
  276. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_python.egg-info/dependency_links.txt +0 -0
  277. {polytope_python-1.1.1 → polytope_python-2.0.2}/polytope_python.egg-info/top_level.txt +0 -0
  278. {polytope_python-1.1.1 → polytope_python-2.0.2}/setup.cfg +0 -0
  279. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_axis_mappers.py +0 -0
  280. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_combinatorics.py +0 -0
  281. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_datacube_mock.py +0 -0
  282. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_hull_slicer.py +0 -0
  283. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_mappers.py +0 -0
  284. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_merge_cyclic_octahedral.py +0 -0
  285. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_profiling_requesttree.py +0 -0
  286. {polytope_python-1.1.1 → polytope_python-2.0.2}/tests/test_tree_protobuf.py +0 -0
@@ -0,0 +1,13 @@
1
+ dependencies: |
2
+ ecmwf/ecbuild
3
+ MathisRosenhauer/libaec@refs/tags/v1.1.3
4
+ ecmwf/eccodes
5
+ ecmwf/eckit@develop
6
+ ecmwf/metkit
7
+ ecmwf/fdb
8
+ ecmwf/gribjump
9
+ dependency_cmake_options: |
10
+ ecmwf/gribjump: "-DENABLE_FDB_BUILD_TOOLS=ON"
11
+ dependency_branch: develop
12
+ parallelism_factor: 8
13
+ self_build: false
@@ -0,0 +1,21 @@
1
+ build:
2
+ python: "3.10"
3
+ modules:
4
+ - ninja
5
+ - aec
6
+ dependencies:
7
+ - ecmwf/ecbuild@develop
8
+ - ecmwf/eccodes@develop
9
+ - ecmwf/eckit@develop
10
+ - ecmwf/metkit@develop
11
+ - ecmwf/fdb@develop
12
+ - ecmwf/gribjump@develop
13
+ dependency_cmake_options:
14
+ - "ecmwf/gribjump: '-DENABLE_FDB_BUILD_TOOLS=ON'"
15
+ - "ecmwf/fdb: '-DENABLE_LUSTRE=OFF'"
16
+ parallel: 64
17
+ env:
18
+ - ECCODES_SAMPLES_PATH=$ECCODES_DIR/share/eccodes/samples
19
+ - ECCODES_DEFINITION_PATH=$ECCODES_DIR/share/eccodes/definitions
20
+ pytest_cmd: |
21
+ python -m pytest -m 'not fdb' tests --cov=./ --cov-report=xml
@@ -0,0 +1,30 @@
1
+ name: cd
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - '**'
7
+
8
+ jobs:
9
+ pypi_binwheels:
10
+ uses: ecmwf/reusable-workflows/.github/workflows/cd-pypi-binwheel.yml@v2
11
+ secrets: inherit
12
+ with:
13
+ platforms: "['ubuntu-latest','macos-latest']"
14
+ pyversions: "['38','39','310','311','312']"
15
+ env_vars: |
16
+ {
17
+ "USE_RUST": "1",
18
+ "SETUPTOOLS_RUST_CARGO_PROFILE": "release"
19
+ }
20
+
21
+ pypi_purepython:
22
+ needs: pypi_binwheels
23
+ uses: ecmwf/reusable-workflows/.github/workflows/cd-pypi.yml@v2
24
+ secrets: inherit
25
+ with:
26
+ env_vars: |
27
+ {
28
+ "USE_RUST": "0",
29
+ "SETUPTOOLS_RUST_CARGO_PROFILE": "release"
30
+ }
@@ -0,0 +1,40 @@
1
+ name: ci
2
+
3
+ on:
4
+ # Trigger the workflow on push to master or develop, except tag creation
5
+ push:
6
+ branches:
7
+ - "main"
8
+ - "develop"
9
+ tags-ignore:
10
+ - "**"
11
+
12
+ # Trigger the workflow on pull request
13
+ pull_request: ~
14
+
15
+ # Trigger the workflow manually
16
+ workflow_dispatch: ~
17
+
18
+ # Trigger after public PR approved for CI
19
+ pull_request_target:
20
+ types: [labeled]
21
+
22
+ jobs:
23
+ # Run CI including downstream packages on self-hosted runners
24
+ downstream-ci:
25
+ name: downstream-ci
26
+ if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
27
+ uses: ecmwf/downstream-ci/.github/workflows/downstream-ci.yml@main
28
+ with:
29
+ polytope: ecmwf/polytope@${{ github.event.pull_request.head.sha || github.sha }}
30
+ # codecov_upload: true
31
+ python_qa: true
32
+ secrets: inherit
33
+
34
+ downstream-ci-hpc:
35
+ name: downstream-ci-hpc
36
+ if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
37
+ uses: ecmwf/downstream-ci/.github/workflows/downstream-ci-hpc.yml@main
38
+ with:
39
+ polytope: ecmwf/polytope@${{ github.event.pull_request.head.sha || github.sha }}
40
+ secrets: inherit
@@ -0,0 +1,10 @@
1
+ # Manage labels of pull requests that originate from forks
2
+ name: label-public-pr
3
+
4
+ on:
5
+ pull_request_target:
6
+ types: [opened, synchronize]
7
+
8
+ jobs:
9
+ label:
10
+ uses: ecmwf-actions/reusable-workflows/.github/workflows/label-pr.yml@v2
@@ -0,0 +1,32 @@
1
+
2
+ name: test-cd
3
+
4
+ on:
5
+ pull_request:
6
+ branches: [ "main"]
7
+
8
+ jobs:
9
+ pypi_binwheels:
10
+ uses: ecmwf/reusable-workflows/.github/workflows/cd-pypi-binwheel.yml@v2
11
+ secrets: inherit
12
+ with:
13
+ platforms: "['ubuntu-latest','macos-latest']"
14
+ pyversions: "['38','39','310','311','312']"
15
+ testpypi: true
16
+ env_vars: |
17
+ {
18
+ "USE_RUST": "1",
19
+ "SETUPTOOLS_RUST_CARGO_PROFILE": "release"
20
+ }
21
+
22
+ pypi_purepython:
23
+ needs: pypi_binwheels
24
+ uses: ecmwf/reusable-workflows/.github/workflows/cd-pypi.yml@v2
25
+ secrets: inherit
26
+ with:
27
+ testpypi: true
28
+ env_vars: |
29
+ {
30
+ "USE_RUST": "0",
31
+ "SETUPTOOLS_RUST_CARGO_PROFILE": "release"
32
+ }
@@ -0,0 +1,78 @@
1
+ *.py[cod]
2
+ *.swp
3
+ *.grib
4
+ *.gif
5
+ *.html
6
+ *.req
7
+ *.prof
8
+ *.idx
9
+ *.grib
10
+ *.xml
11
+ *.pstats
12
+ *.profile
13
+ *.egg-info
14
+ *.json
15
+ *.txt
16
+ *.gz
17
+
18
+ .coverage
19
+ .mypy_cache
20
+ .vscode
21
+ .pytest_cache
22
+
23
+ __pycache__/
24
+ .ipynb_checkpoints/
25
+
26
+ _version.py
27
+ target/
28
+ dist/
29
+ build/
30
+
31
+ Cargo.lock
32
+ .DS_Store
33
+
34
+ site
35
+ example_eo
36
+ example_mri
37
+ new_test_venv_polytope
38
+ new_venv_polytope
39
+ new_polytope_venv
40
+ polytope_venv
41
+ polytope_venv_latest
42
+ new_updated_numpy_venv
43
+ newest-polytope-venv
44
+ serializedTree
45
+ new_polytope_venv
46
+ newest-polytope-venv
47
+ new_polytope_venv
48
+ polytope_feature/datacube/quadtree/target
49
+ venv_python3_11
50
+ venv_gj_iterator
51
+ *.json
52
+ venv_python3_11
53
+ *.txt
54
+ tests/data
55
+ venv_gj_iterator
56
+ target
57
+ rust_deployment_venv
58
+ *.so
59
+ *.nc
60
+
61
+ test_w_qubed
62
+ rust_venv
63
+ new_rust_test_venv
64
+ *.so
65
+ rust_deployment_venv
66
+ *.lock
67
+ **/target
68
+ **/build
69
+ _version.py
70
+ *.DS_Store
71
+ icon_grids
72
+ rust_venv
73
+ test_w_qubed
74
+ performance_plots_qubed
75
+ *.nc
76
+ **/*venv*
77
+
78
+ icon_grids
@@ -0,0 +1,16 @@
1
+ repos:
2
+ - repo: https://github.com/pycqa/isort
3
+ rev: 5.13.2
4
+ hooks:
5
+ - id: isort
6
+ name: isort (python)
7
+
8
+ - repo: https://github.com/psf/black
9
+ rev: 24.8.0 # Use the latest version of black
10
+ hooks:
11
+ - id: black
12
+
13
+ - repo: https://github.com/pycqa/flake8
14
+ rev: 7.1.1 # Use the latest version of flake8
15
+ hooks:
16
+ - id: flake8
@@ -0,0 +1,33 @@
1
+ # Read the Docs configuration file for MkDocs projects
2
+
3
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4
+
5
+
6
+ # Required
7
+
8
+ version: 2
9
+
10
+
11
+ # Set the version of Python and other tools you might need
12
+
13
+ build:
14
+
15
+ os: ubuntu-22.04
16
+
17
+ tools:
18
+
19
+ python: "3.12"
20
+
21
+
22
+ mkdocs:
23
+
24
+ configuration: mkdocs.yml
25
+
26
+
27
+ # Optionally declare the Python requirements required to build your docs
28
+
29
+ python:
30
+
31
+ install:
32
+
33
+ - requirements: docs/requirements.txt
@@ -0,0 +1,8 @@
1
+ Acknowledgements
2
+ ================
3
+
4
+ Destination Earth
5
+ This software is developed with co-funding by the European Union under the Destination Earth initiative.
6
+
7
+ LEXIS
8
+ This software is part of a project that has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement No 825532.
@@ -0,0 +1,20 @@
1
+ Contributing to *polytope*
2
+ ========================================
3
+
4
+ Please report bug_ reports or pull-requests_ on GitHub_
5
+
6
+ .. _bug: https://github.com/ecmwf/polytope/issues
7
+
8
+ .. _pull-requests: https://github.com/ecmwf/polytope/pulls
9
+
10
+ .. _GitHub: https://github.com/ecmwf/polytope
11
+
12
+ We want your feedback, please e-mail: user-services@ecmwf.int
13
+
14
+ The package is installed from PyPI with::
15
+
16
+ $ pip install polytope-python
17
+
18
+ How you could use polytope:
19
+ * plot outputs, examples are provided in the examples folder
20
+ * go further than our examples and let us know how it goes
@@ -0,0 +1,20 @@
1
+ testk:
2
+ python3 -m pytest -vsrA tests/* -k $(filter-out $@, $(MAKECMDGOALS)) -W ignore::DeprecationWarning -W ignore::FutureWarning --log-cli-level=DEBUG
3
+
4
+ testx:
5
+ python3 -m pytest -vsx tests/* -W ignore::DeprecationWarning -W ignore::FutureWarning --log-cli-level=DEBUG
6
+
7
+ test:
8
+ python3 -m pytest -vsrA tests/* -W ignore::DeprecationWarning -W ignore::FutureWarning --log-cli-level=DEBUG
9
+
10
+ examples:
11
+ python3 -m pytest -vsrA examples/* -W ignore::DeprecationWarning -W ignore::FutureWarning --log-cli-level=DEBUG
12
+
13
+ performance:
14
+ python3 -m pytest -vsrA performance/* -W ignore::DeprecationWarning -W ignore::FutureWarning --log-cli-level=DEBUG
15
+
16
+ docs:
17
+ mkdocs build
18
+ mkdocs serve
19
+
20
+ .PHONY: init test docs
@@ -0,0 +1,248 @@
1
+ Metadata-Version: 2.4
2
+ Name: polytope-python
3
+ Version: 2.0.2
4
+ Summary: Polytope datacube feature extraction library
5
+ Author-email: "European Centre for Medium-Range Weather Forecasts (ECMWF)" <software.support@ecmwf.int>
6
+ Maintainer-email: James Hawkes <James.Hawkes@ecmwf.int>, Mathilde Leuridan <Mathilde.Leuridan@ecmwf.int>
7
+ License: Apache License Version 2.0
8
+ Project-URL: repository, https://github.com/ecmwf/polytope
9
+ Project-URL: documentation, https://polytope.readthedocs.io/en/latest/
10
+ Project-URL: issues, https://github.com/ecmwf/polytope/issues
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: Natural Language :: English
14
+ Classifier: License :: OSI Approved :: Apache Software License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Topic :: Scientific/Engineering
23
+ Requires-Python: >3.8
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: numpy>=1.26
27
+ Requires-Dist: pandas
28
+ Requires-Dist: scipy
29
+ Requires-Dist: sortedcontainers
30
+ Requires-Dist: tripy
31
+ Requires-Dist: xarray
32
+ Requires-Dist: conflator
33
+ Requires-Dist: protobuf
34
+ Provides-Extra: tests
35
+ Requires-Dist: pytest; extra == "tests"
36
+ Requires-Dist: pytest-cov; extra == "tests"
37
+ Requires-Dist: cffi; extra == "tests"
38
+ Requires-Dist: eccodes; extra == "tests"
39
+ Requires-Dist: h5netcdf; extra == "tests"
40
+ Requires-Dist: h5py; extra == "tests"
41
+ Requires-Dist: earthkit-data; extra == "tests"
42
+ Requires-Dist: matplotlib; extra == "tests"
43
+ Requires-Dist: pyfdb; extra == "tests"
44
+ Dynamic: license-file
45
+
46
+
47
+ <h3 align="center">
48
+ <img src="./docs/images/polytope_logo_new_animated_AdobeExpress_3.gif" width=60%>
49
+ </br>
50
+
51
+ </h3>
52
+
53
+ <p align="center">
54
+ <a href="https://github.com/ecmwf/codex/raw/refs/heads/main/Project%20Maturity">
55
+ <img src="https://github.com/ecmwf/codex/raw/refs/heads/main/Project%20Maturity/incubating_badge.svg" alt="Project Maturity">
56
+ </a>
57
+ <a href="https://github.com/ecmwf/codex/raw/refs/heads/main/ESEE"> <img src="https://github.com/ecmwf/codex/raw/refs/heads/main/ESEE/data_provision_badge.svg" alt="ESEE">
58
+ </p>
59
+
60
+ <p align="center">
61
+ <a href="https://github.com/ecmwf/polytope/actions/workflows/downstream-ci.yml">
62
+ <img src="https://github.com/ecmwf/polytope/actions/workflows/downstream-ci.yml/badge.svg" alt="ci">
63
+ </a>
64
+ <a href="https://codecov.io/gh/ecmwf/polytope"><img src="https://codecov.io/gh/ecmwf/polytope/branch/develop/graph/badge.svg"></a>
65
+ <a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"></a>
66
+ <a href="https://github.com/ecmwf/polytope/releases"><img src="https://img.shields.io/github/v/release/ecmwf/polytope?color=blue&label=Release&style=flat-square"></a>
67
+ <a href='https://polytope.readthedocs.io/en/latest/?badge=latest'><img src='https://readthedocs.org/projects/polytope/badge/?version=latest' alt='Documentation Status' /></a>
68
+ </p>
69
+ <p align="center">
70
+ <a href="#concept">Concept</a> •
71
+ <a href="#installation">Installation</a> •
72
+ <a href="#example">Example</a> •
73
+ <a href="#testing">Testing</a> •
74
+ <a href="https://polytope.readthedocs.io/en/latest/">Documentation</a>
75
+ </p>
76
+
77
+ Polytope is a library for extracting complex data from datacubes. It provides an API for non-orthogonal access to data, where the stencil used to extract data from the datacube can be any arbitrary *n*-dimensional polygon (called a *polytope*). This can be used to efficiently extract complex features from a datacube, such as polygon regions or spatio-temporal paths.
78
+
79
+ Polytope is designed to extend different datacube backends:
80
+ * XArray dataarrays
81
+ * FDB object stores (through the GribJump software)
82
+
83
+ Polytope supports datacubes which have branching, non-uniform indexing, and even cyclic axes. If the datacube backend supports byte-addressability and efficient random access (either in-memory or direct from storage), **Polytope** can be used to dramatically decrease overall I/O load.
84
+
85
+ > \[!IMPORTANT\]
86
+ > This software is **Incubating** and subject to ECMWF's guidelines on [Software Maturity](https://github.com/ecmwf/codex/raw/refs/heads/main/Project%20Maturity).
87
+
88
+ <!-- > [!WARNING]
89
+ > This project is BETA and will be experimental for the foreseeable future. Interfaces and functionality are likely to change, and the project itself may be scrapped. DO NOT use this software in any project/software that is operational. -->
90
+
91
+ ## Concept
92
+
93
+ Polytope is designed to enable extraction of arbitrary extraction of data from a datacube. Instead of the typical range-based bounding-box approach, Polytope can extract any shape of data from a datacube using a "polytope" (*n*-dimensional polygon) stencil.
94
+
95
+ <p align="center">
96
+ <img src="./docs/Algorithm/Overview/images_overview/ecmwf_polytope.png" alt="Polytope Concept" width="450"/>
97
+ </p>
98
+
99
+ The Polytope algorithm can for example be used to extract:
100
+
101
+ - 2D cut-outs, such as country cut-outs, from a datacube
102
+ <p align="center">
103
+ <img src="./docs/images/greece.png" alt="Greece cut-out" width="250"/>
104
+ </p>
105
+
106
+ - timeseries from a datacube
107
+ <p align="center">
108
+ <img src="./docs/images/timeseries.png" alt="Timeseries" width="350"/>
109
+ </p>
110
+
111
+ - more complicated spatio-temporal paths, such as flight paths, from a datacube
112
+ <p align="center">
113
+ <img src="./docs/images/flight_path.png" alt="Flight path" width="350"/>
114
+ </p>
115
+
116
+ - and many more high-dimensional shapes in arbitrary dimensions...
117
+
118
+ For more information about the Polytope algorithm, refer to our [paper](https://arxiv.org/abs/2306.11553).
119
+ If this project is useful for your work, please consider citing this paper.
120
+
121
+ ## Installation
122
+
123
+ Install the polytope software with Python 3 (>=3.7) from GitHub directly with the command
124
+
125
+ python3 -m pip install git+ssh://git@github.com/ecmwf/polytope.git@develop
126
+
127
+ or from PyPI with the command
128
+
129
+ python3 -m pip install polytope-python
130
+
131
+ ## Example
132
+
133
+ Here is a step-by-step example of how to use this software.
134
+
135
+ 1. In this example, we first specify the data which will be in our Xarray datacube. Note that the data here comes from the GRIB file called "winds.grib", which is 3-dimensional with dimensions: step, latitude and longitude.
136
+ ```Python
137
+ import xarray as xr
138
+
139
+ array = xr.open_dataset("winds.grib", engine="cfgrib")
140
+ ```
141
+
142
+ We then construct the Polytope object, passing in some additional metadata describing properties of the longitude axis.
143
+ ```Python
144
+ options = {"longitude": {"cyclic": [0, 360.0]}}
145
+
146
+ from polytope_feature.polytope import Polytope
147
+
148
+ p = Polytope(datacube=array, axis_options=options)
149
+ ```
150
+
151
+ 2. Next, we create a request shape to extract from the datacube.
152
+ In this example, we want to extract a simple 2D box in latitude and longitude at step 0. We thus create the two relevant shapes we need to build this 3-dimensional object,
153
+ ```Python
154
+ import numpy as np
155
+ from polytope_feature.shapes import Box, Select
156
+
157
+ box = Box(["latitude", "longitude"], [0, 0], [1, 1])
158
+ step_point = Select("step", [np.timedelta64(0, "s")])
159
+ ```
160
+
161
+ which we then incorporate into a Polytope request.
162
+ ```Python
163
+ from polytope_feature.polytope import Request
164
+
165
+ request = Request(box, step_point)
166
+ ```
167
+
168
+ 3. Finally, extract the request from the datacube.
169
+ ```Python
170
+ result = p.retrieve(request)
171
+ ```
172
+
173
+ The result is stored as an IndexTree containing the retrieved data organised hierarchically with axis indices for each point.
174
+ ```Python
175
+ result.pprint()
176
+
177
+
178
+ Output IndexTree:
179
+
180
+ ↳root=None
181
+ ↳step=0 days 00:00:00
182
+ ↳latitude=0.0
183
+ ↳longitude=0.0
184
+ ↳longitude=1.0
185
+ ↳latitude=1.0
186
+ ↳longitude=0.0
187
+ ↳longitude=1.0
188
+ ```
189
+
190
+ ## Testing
191
+
192
+ #### Additional Dependencies
193
+
194
+ The Polytope tests and examples require additional Python packages compared to the main Polytope algorithm.
195
+ The additional dependencies are provided in the requirements_test.txt and requirements_examples.txt files, which can respectively be found in the tests and examples folders.
196
+ Moreover, Polytope's tests and examples also require the installation of eccodes and GDAL.
197
+ It is possible to install both of these dependencies using either a package manager or manually.
198
+
199
+ ## Contributing
200
+
201
+ The main repository is hosted on GitHub; testing, bug reports and contributions are highly welcomed and appreciated.
202
+ Please see the [Contributing](./CONTRIBUTING.rst) document for the best way to help.
203
+
204
+ Main contributors:
205
+
206
+ - Mathilde Leuridan - [ECMWF](https://www.ecmwf.int)
207
+ - James Hawkes - [ECMWF](https://www.ecmwf.int)
208
+ - Simon Smart - [ECMWF](www.ecmwf.int)
209
+ - Emanuele Danovaro - [ECMWF](www.ecmwf.int)
210
+ - Tiago Quintino - [ECMWF](www.ecmwf.int)
211
+
212
+ See also the [contributors](https://github.com/ecmwf/polytope/contributors) for a more complete list.
213
+
214
+ ## License
215
+
216
+ ```
217
+ Copyright 2021 European Centre for Medium-Range Weather Forecasts (ECMWF)
218
+
219
+ Licensed under the Apache License, Version 2.0 (the "License");
220
+ you may not use this file except in compliance with the License.
221
+ You may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0).
222
+
223
+ Unless required by applicable law or agreed to in writing, software
224
+ distributed under the License is distributed on an "AS IS" BASIS,
225
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
226
+ See the License for the specific language governing permissions and
227
+ limitations under the License.
228
+
229
+ In applying this licence, ECMWF does not waive the privileges and immunities
230
+ granted to it by virtue of its status as an intergovernmental organisation nor
231
+ does it submit to any jurisdiction.
232
+ ```
233
+
234
+ ## Citing
235
+
236
+ If this software is useful in your work, please consider citing our paper as
237
+
238
+ > Leuridan, M., Hawkes, J., Smart, S., Danovaro, E., and Quintino, T., [“Polytope: An Algorithm for Efficient Feature Extraction on Hypercubes”](https://arxiv.org/abs/2306.11553), <i>arXiv e-prints</i>, 2023. doi:10.48550/arXiv.2306.11553.
239
+
240
+ Other papers include:
241
+
242
+ > Leuridan, M., Bradley, C., Hawkes, J., Quintino, T., & Schultz, M. (2025, June). [Performance Analysis of an Efficient Algorithm for Feature Extraction from Large Scale Meteorological Data Stores.](https://dl.acm.org/doi/abs/10.1145/3732775.3733573) In Proceedings of the Platform for Advanced Scientific Computing Conference (pp. 1-9).
243
+
244
+ ## Acknowledgements
245
+
246
+ Past and current funding and support for **Polytope** is listed in the adjoining [Acknowledgements](./ACKNOWLEDGEMENTS.rst).
247
+
248
+