imas-python 1.2.1.dev13__tar.gz → 2.0.0.post1__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 (228) hide show
  1. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/.github/workflows/linting.yml +8 -3
  2. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/.github/workflows/publish.yml +13 -6
  3. imas_python-2.0.0.post1/.github/workflows/test_with_pytest.yml +51 -0
  4. imas_python-2.0.0.post1/.github/workflows/verify_sphinx_doc.yml +53 -0
  5. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/CONTRIBUTING.md +6 -6
  6. {imas_python-1.2.1.dev13/imas_python.egg-info → imas_python-2.0.0.post1}/PKG-INFO +16 -8
  7. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/README.md +11 -5
  8. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/ci/run_pytest.sh +1 -1
  9. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/Makefile +1 -1
  10. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/changelog.rst +45 -25
  11. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/advanced/imas_snippets/tensorized_ids_to_xarray.py +34 -0
  12. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/advanced/xarray.rst +15 -3
  13. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/index.rst +5 -0
  14. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/installing.rst +1 -1
  15. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/intro.rst +51 -34
  16. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/netcdf.rst +76 -3
  17. imas_python-2.0.0.post1/imas/_to_xarray.py +73 -0
  18. imas_python-2.0.0.post1/imas/_version.py +21 -0
  19. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/assets/IDSDef.zip +0 -0
  20. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/backends/imas_core/al_context.py +13 -0
  21. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/backends/imas_core/db_entry_helpers.py +3 -7
  22. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/backends/imas_core/imas_interface.py +1 -1
  23. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/backends/imas_core/mdsplus_model.py +34 -35
  24. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/backends/netcdf/db_entry_nc.py +13 -12
  25. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/backends/netcdf/ids2nc.py +5 -160
  26. imas_python-2.0.0.post1/imas/backends/netcdf/ids_tensorizer.py +205 -0
  27. imas_python-2.0.0.post1/imas/backends/netcdf/iterators.py +98 -0
  28. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/backends/netcdf/nc2ids.py +176 -61
  29. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/backends/netcdf/nc_validate.py +2 -1
  30. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/ids_convert.py +2 -1
  31. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/ids_structure.py +8 -8
  32. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_ids_convert.py +2 -1
  33. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_lazy_loading.py +53 -4
  34. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_nbc_change.py +29 -8
  35. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_nc_validation.py +26 -17
  36. imas_python-2.0.0.post1/imas/test/test_to_xarray.py +94 -0
  37. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/util.py +75 -3
  38. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1/imas_python.egg-info}/PKG-INFO +16 -8
  39. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas_python.egg-info/SOURCES.txt +6 -0
  40. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas_python.egg-info/requires.txt +4 -1
  41. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/pyproject.toml +7 -2
  42. imas_python-1.2.1.dev13/imas/_version.py +0 -16
  43. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/.git-blame-ignore-revs +0 -0
  44. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/.git_archival.txt +0 -0
  45. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/.gitattributes +0 -0
  46. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/.gitignore +0 -0
  47. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/.pylintrc +0 -0
  48. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/.readthedocs.yml +0 -0
  49. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/CODE_OF_CONDUCT.md +0 -0
  50. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/LICENSE.txt +0 -0
  51. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/MANIFEST.in +0 -0
  52. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/asv.conf.json +0 -0
  53. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/benchmarks/__init__.py +0 -0
  54. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/benchmarks/core_profiles.py +0 -0
  55. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/benchmarks/edge_profiles.py +0 -0
  56. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/benchmarks/technical.py +0 -0
  57. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/benchmarks/utils.py +0 -0
  58. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/ci/build_dd_zip.sh +0 -0
  59. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/ci/build_docs_and_dist.sh +0 -0
  60. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/ci/linting.sh +0 -0
  61. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/ci/run_benchmark.sh +0 -0
  62. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/conftest.py +0 -0
  63. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/.gitignore +0 -0
  64. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/.gitignore +0 -0
  65. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/_static/imas.css +0 -0
  66. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/_static/imas_200x200.png +0 -0
  67. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/_templates/autosummary/accessor.rst +0 -0
  68. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/_templates/autosummary/accessor_attribute.rst +0 -0
  69. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/_templates/autosummary/accessor_callable.rst +0 -0
  70. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/_templates/autosummary/accessor_method.rst +0 -0
  71. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/_templates/autosummary/base.rst +0 -0
  72. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/_templates/custom-class-template.rst +0 -0
  73. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/_templates/custom-module-template.rst +0 -0
  74. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/_templates/layout.html +0 -0
  75. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/api-hidden.rst +0 -0
  76. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/api.rst +0 -0
  77. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/benchmarking.rst +0 -0
  78. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/ci_config.rst +0 -0
  79. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/cli.rst +0 -0
  80. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/code_style.rst +0 -0
  81. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/conf.py +0 -0
  82. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/configuring.rst +0 -0
  83. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/advanced/dd_versions.rst +0 -0
  84. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/advanced/explore.rst +0 -0
  85. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/advanced/hashing.rst +0 -0
  86. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/advanced/imas_snippets/alternative_coordinates.py +0 -0
  87. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/advanced/imas_snippets/autoconvert_get.py +0 -0
  88. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/advanced/imas_snippets/autoconvert_put.py +0 -0
  89. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/advanced/imas_snippets/calc_with_units.py +0 -0
  90. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/advanced/imas_snippets/coordinates.py +0 -0
  91. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/advanced/imas_snippets/dd_versions.py +0 -0
  92. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/advanced/imas_snippets/explore_data.py +0 -0
  93. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/advanced/imas_snippets/explore_structures.py +0 -0
  94. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/advanced/imas_snippets/hashing.py +0 -0
  95. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/advanced/imas_snippets/ids_convert.py +0 -0
  96. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/advanced/imas_snippets/ids_to_xarray.py +0 -0
  97. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/advanced/metadata.rst +0 -0
  98. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/advanced_user_training.rst +0 -0
  99. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/basic/analyze.rst +0 -0
  100. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/basic/core_profiles_ne_timeslice.png +0 -0
  101. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/basic/core_profiles_te.png +0 -0
  102. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/basic/create.rst +0 -0
  103. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/basic/explore.rst +0 -0
  104. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/basic/imas_inspect.png +0 -0
  105. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/basic/imas_snippets/create_core_profiles.py +0 -0
  106. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/basic/imas_snippets/explore_public_ec_launchers.py +0 -0
  107. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/basic/imas_snippets/explore_public_pf_active.py +0 -0
  108. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/basic/imas_snippets/explore_training_data.py +0 -0
  109. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/basic/imas_snippets/find_paths.py +0 -0
  110. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/basic/imas_snippets/iterate_core_profiles.py +0 -0
  111. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/basic/imas_snippets/plot_core_profiles_ne_timeslice.py +0 -0
  112. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/basic/imas_snippets/plot_core_profiles_te.py +0 -0
  113. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/basic/imas_snippets/print_idss.py +0 -0
  114. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/basic/imas_snippets/read_core_profiles_ne_timeslice.py +0 -0
  115. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/basic/imas_snippets/read_equilibrium_time_array.py +0 -0
  116. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/basic/imas_snippets/read_whole_equilibrium.py +0 -0
  117. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/basic/imas_snippets/transform_grid.py +0 -0
  118. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/basic/interactive_tab_core_profiles_toplevel.png +0 -0
  119. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/basic/print_tree_ids_properties.png +0 -0
  120. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/basic/setup.rst +0 -0
  121. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/basic/transform.rst +0 -0
  122. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/courses/basic_user_training.rst +0 -0
  123. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/identifiers.rst +0 -0
  124. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/imas_architecture.rst +0 -0
  125. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/imas_structure.png +0 -0
  126. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/lazy_loading.rst +0 -0
  127. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/mdsplus.rst +0 -0
  128. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/metadata.rst +0 -0
  129. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/multi-dd.rst +0 -0
  130. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/netcdf/conventions.rst +0 -0
  131. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/release_imas.rst +0 -0
  132. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/resampling.rst +0 -0
  133. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/docs/source/validation.rst +0 -0
  134. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/__init__.py +0 -0
  135. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/__main__.py +0 -0
  136. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/_util.py +0 -0
  137. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/assets/IDSDef2MDSpreTree.xsl +0 -0
  138. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/assets/IDS_fake_toplevel.xml +0 -0
  139. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/assets/IDS_minimal.xml +0 -0
  140. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/assets/IDS_minimal_2.xml +0 -0
  141. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/assets/IDS_minimal_struct_array.xml +0 -0
  142. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/assets/IDS_minimal_types.xml +0 -0
  143. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/assets/ITER_134173_106_core_profiles.ids +0 -0
  144. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/assets/ITER_134173_106_equilibrium.ids +0 -0
  145. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/assets/README.md +0 -0
  146. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/assets/core_profiles.ids +0 -0
  147. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/assets/equilibrium.ids +0 -0
  148. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/backends/__init__.py +0 -0
  149. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/backends/db_entry_impl.py +0 -0
  150. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/backends/imas_core/__init__.py +0 -0
  151. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/backends/imas_core/db_entry_al.py +0 -0
  152. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/backends/imas_core/uda_support.py +0 -0
  153. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/backends/netcdf/__init__.py +0 -0
  154. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/backends/netcdf/nc_metadata.py +0 -0
  155. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/command/cli.py +0 -0
  156. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/command/db_analysis.py +0 -0
  157. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/command/helpers.py +0 -0
  158. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/command/timer.py +0 -0
  159. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/db_entry.py +0 -0
  160. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/dd_helpers.py +0 -0
  161. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/dd_zip.py +0 -0
  162. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/exception.py +0 -0
  163. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/ids_base.py +0 -0
  164. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/ids_coordinates.py +0 -0
  165. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/ids_data_type.py +0 -0
  166. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/ids_defs.py +0 -0
  167. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/ids_factory.py +0 -0
  168. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/ids_identifiers.py +0 -0
  169. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/ids_metadata.py +0 -0
  170. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/ids_path.py +0 -0
  171. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/ids_primitive.py +0 -0
  172. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/ids_struct_array.py +0 -0
  173. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/ids_toplevel.py +0 -0
  174. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/setup_logging.py +0 -0
  175. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_all_dd_versions.py +0 -0
  176. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_cli.py +0 -0
  177. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_dbentry.py +0 -0
  178. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_dd_helpers.py +0 -0
  179. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_dd_zip.py +0 -0
  180. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_deepcopy.py +0 -0
  181. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_exception.py +0 -0
  182. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_get_sample.py +0 -0
  183. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_hash.py +0 -0
  184. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_helpers.py +0 -0
  185. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_identifiers.py +0 -0
  186. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_ids2nc.py +0 -0
  187. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_ids_ascii_data.py +0 -0
  188. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_ids_coordinates.py +0 -0
  189. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_ids_data_type.py +0 -0
  190. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_ids_factory.py +0 -0
  191. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_ids_metadata.py +0 -0
  192. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_ids_mixin.py +0 -0
  193. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_ids_path.py +0 -0
  194. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_ids_primitive.py +0 -0
  195. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_ids_struct_array.py +0 -0
  196. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_ids_structure.py +0 -0
  197. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_ids_toplevel.py +0 -0
  198. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_ids_validate.py +0 -0
  199. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_latest_dd_autofill.py +0 -0
  200. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_latest_dd_manual.py +0 -0
  201. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_latest_dd_resample.py +0 -0
  202. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_list_occurrences.py +0 -0
  203. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_minimal.py +0 -0
  204. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_minimal_conversion.py +0 -0
  205. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_minimal_io.py +0 -0
  206. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_minimal_struct_array_io.py +0 -0
  207. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_minimal_types.py +0 -0
  208. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_minimal_types_io.py +0 -0
  209. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_minimal_types_io_automatic.py +0 -0
  210. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_nc_autofill.py +0 -0
  211. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_nc_entry.py +0 -0
  212. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_nc_metadata.py +0 -0
  213. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_snippets.py +0 -0
  214. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_static_ids.py +0 -0
  215. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_str_1d.py +0 -0
  216. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_time_slicing.py +0 -0
  217. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_uda_support.py +0 -0
  218. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/test/test_util.py +0 -0
  219. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas/training.py +0 -0
  220. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas_python.egg-info/dependency_links.txt +0 -0
  221. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas_python.egg-info/entry_points.txt +0 -0
  222. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas_python.egg-info/not-zip-safe +0 -0
  223. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/imas_python.egg-info/top_level.txt +0 -0
  224. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/setup.cfg +0 -0
  225. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/setup.py +0 -0
  226. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/tools/compare_lowlevel_access_patterns.py +0 -0
  227. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/tools/extract_test_data.py +0 -0
  228. {imas_python-1.2.1.dev13 → imas_python-2.0.0.post1}/tools/get_tagnames.py +0 -0
@@ -1,11 +1,14 @@
1
1
  name: linting-and-code-formatting
2
2
 
3
- on: push
3
+ on:
4
+ push:
5
+ pull_request:
6
+ types: [opened, synchronize, reopened]
4
7
 
5
8
  jobs:
6
9
  build:
7
10
 
8
- runs-on: ubuntu-latest
11
+ runs-on: ubuntu-22.04
9
12
 
10
13
  steps:
11
14
  - name: Checkout IMAS-Python sources
@@ -14,7 +17,9 @@ jobs:
14
17
  - name: Set up Python
15
18
  uses: actions/setup-python@v5
16
19
  with:
17
- python-version: '3.x'
20
+ # until saxonche is available in 3.13
21
+ # https://saxonica.plan.io/issues/6561
22
+ python-version: "<3.13"
18
23
 
19
24
  - name: Display Python version
20
25
  run: python -c "import sys; print(sys.version)"
@@ -1,11 +1,14 @@
1
1
  name: build-wheel-and-publish-test-pypi
2
2
 
3
- on: push
3
+ on:
4
+ push:
5
+ pull_request:
6
+ types: [opened, synchronize, reopened]
4
7
 
5
8
  jobs:
6
9
  build:
7
10
  name: Build distribution
8
- runs-on: ubuntu-latest
11
+ runs-on: ubuntu-22.04
9
12
  steps:
10
13
  - uses: actions/checkout@v4
11
14
  with:
@@ -13,7 +16,9 @@ jobs:
13
16
  - name: Set up Python
14
17
  uses: actions/setup-python@v5
15
18
  with:
16
- python-version: "3.x"
19
+ # until saxonche is available in 3.13
20
+ # https://saxonica.plan.io/issues/6561
21
+ python-version: "<3.13"
17
22
  - name: Install pypa/build
18
23
  run: >-
19
24
  python3 -m pip install pip setuptools wheel build
@@ -27,9 +32,10 @@ jobs:
27
32
 
28
33
  publish-to-pypi:
29
34
  name: Publish IMAS-Python distribution to PyPI
35
+ if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
30
36
  needs:
31
37
  - build
32
- runs-on: ubuntu-latest
38
+ runs-on: ubuntu-22.04
33
39
  environment:
34
40
  name: pypi
35
41
  url: https://pypi.org/p/imas-python
@@ -46,9 +52,10 @@ jobs:
46
52
 
47
53
  publish-to-testpypi:
48
54
  name: Publish IMAS-Python distribution to TestPyPI
55
+ if: github.ref=='refs/heads/develop' # only publish to TestPyPI on develop pushes
49
56
  needs:
50
57
  - build
51
- runs-on: ubuntu-latest
58
+ runs-on: ubuntu-22.04
52
59
  environment:
53
60
  name: testpypi
54
61
  url: https://test.pypi.org/p/imas-python
@@ -64,4 +71,4 @@ jobs:
64
71
  uses: pypa/gh-action-pypi-publish@unstable/v1
65
72
  with:
66
73
  repository-url: https://test.pypi.org/legacy/
67
- verbose: true
74
+ verbose: true
@@ -0,0 +1,51 @@
1
+ name: Test using pytest
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+ types: [opened, synchronize, reopened]
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-22.04
11
+ strategy:
12
+ matrix:
13
+ python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] # Test on multiple Python versions
14
+
15
+ steps:
16
+ - name: Checkout repository
17
+ uses: actions/checkout@v4
18
+
19
+ - name: Set up Python ${{ matrix.python-version }}
20
+
21
+ uses: actions/setup-python@v4
22
+ with:
23
+ # until saxonche is available in 3.13
24
+ # https://saxonica.plan.io/issues/6561
25
+ python-version: ${{ matrix.python-version }}
26
+ - name: Display Python version
27
+ run: python -c "import sys; print(sys.version)"
28
+
29
+ - name: Install dependencies
30
+ run: |
31
+ python -m venv venv
32
+ source venv/bin/activate
33
+ pip install --upgrade pip setuptools wheel
34
+ pip install .[test]
35
+
36
+ - name: Run tests
37
+ run: |
38
+ source venv/bin/activate
39
+ python -m pytest -n=auto --cov=imas --cov-report=term-missing --cov-report=xml:coverage.xml --cov-report=html:htmlcov --junit-xml=junit.xml
40
+
41
+ - name: Upload coverage report ${{ matrix.python-version }}
42
+ uses: actions/upload-artifact@v4
43
+ with:
44
+ name: coverage-report-${{ matrix.python-version }}
45
+ path: htmlcov
46
+
47
+ - name: Upload test report ${{ matrix.python-version }}
48
+ uses: actions/upload-artifact@v4
49
+ with:
50
+ name: test-report-${{ matrix.python-version }}
51
+ path: junit.xml
@@ -0,0 +1,53 @@
1
+ name: verify-sphinx-doc-generation
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+ types: [opened, synchronize, reopened]
7
+
8
+ jobs:
9
+ build-and-test:
10
+ runs-on: ubuntu-22.04
11
+
12
+ steps:
13
+ - name: Checkout IMAS-Python sources
14
+ uses: actions/checkout@v4
15
+
16
+ - name: Set up Python
17
+ uses: actions/setup-python@v5
18
+ with:
19
+ with:
20
+ # until saxonche is available in 3.13
21
+ # https://saxonica.plan.io/issues/6561
22
+ python-version: "<3.13"
23
+
24
+ - name: Display Python version
25
+ run: python -c "import sys; print(sys.version)"
26
+
27
+
28
+ - name: Set up Python virtual environment
29
+ run: |
30
+ python -m venv venv
31
+ source venv/bin/activate
32
+
33
+ - name: Install build dependencies
34
+ run: |
35
+ pip install --upgrade pip setuptools wheel build
36
+
37
+ - name: Build package
38
+ run: |
39
+ rm -rf dist
40
+ python -m build .
41
+
42
+ - name: Install package and dependencies
43
+ run: |
44
+ pip install "$(readlink -f dist/*.whl)[docs,netcdf]"
45
+
46
+ - name: Debug dependencies
47
+ run: |
48
+ pip freeze
49
+
50
+ - name: Build Sphinx documentation
51
+ run: |
52
+ export SPHINXOPTS='-W -n --keep-going'
53
+ make -C docs clean html
@@ -9,28 +9,28 @@ Please first make sure you read and follow the
9
9
  ## You think you found a bug in the code, or have a question in its use
10
10
  1. use the [issue search](https://github.com/iterorganization/IMAS-Python/issues)
11
11
  to check if someone already created a similar issue;
12
- 3. if not, make a **new issue** to describe your problem or question.
12
+ 2. if not, make a **new issue** to describe your problem or question.
13
13
  In the case of a bug suspiscion, please try to give all the relevant
14
14
  information to allow reproducing the error or identifying
15
15
  its root cause (version of the IMAS-Python, OS and relevant
16
16
  dependencies, snippet of code);
17
- 4. apply relevant labels to the issue.
17
+ 3. apply relevant labels to the issue.
18
18
 
19
19
  ## You want to make or ask some change to the code
20
20
  1. use the [issue search](https://github.com/iterorganization/IMAS-Python/issues)
21
21
  to check if someone already proposed a similar idea/change;
22
- 3. if not, create a **new issue** to describe what change you would like to see
22
+ 2. if not, create a **new issue** to describe what change you would like to see
23
23
  implemented and specify it if you intend to work on it yourself or if some help
24
24
  will be needed;
25
- 4. wait until some kind of consensus is reached about your idea being relevant,
25
+ 3. wait until some kind of consensus is reached about your idea being relevant,
26
26
  at which time the issue will be assigned (to you or someone else who can work on
27
27
  this topic);
28
- 5. if you do the development yourself, fork the repository to your own Github
28
+ 4. if you do the development yourself, fork the repository to your own Github
29
29
  profile and create your own feature branch off of the latest develop commit.
30
30
  Make sure to regularly sync your branch with the latest commits from `develop`
31
31
  (find instructions
32
32
  [here](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork));
33
- 6. when your development is ready, create a pull request (find instructions
33
+ 5. when your development is ready, create a pull request (find instructions
34
34
  [here](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork)).
35
35
 
36
36
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: imas-python
3
- Version: 1.2.1.dev13
3
+ Version: 2.0.0.post1
4
4
  Summary: Pythonic wrappers for the IMAS Access Layer
5
5
  Author: ITER Organization
6
6
  Author-email: Karel Lucas van de Plassche <karelvandeplassche@gmail.com>, Daan van Vugt <dvanvugt@ignitioncomputing.com>, Maarten Sebregts <msebregts@ignitioncomputing.com>, imas-support@iter.org
@@ -215,7 +215,7 @@ Requires-Dist: xxhash>=2
215
215
  Requires-Dist: saxonche
216
216
  Requires-Dist: gitpython
217
217
  Provides-Extra: all
218
- Requires-Dist: imas[docs,h5py,imas-core,netcdf,test]; extra == "all"
218
+ Requires-Dist: imas-python[docs,test]; extra == "all"
219
219
  Provides-Extra: docs
220
220
  Requires-Dist: sphinx<7.0.0,>=6.0.0; extra == "docs"
221
221
  Requires-Dist: sphinx-autosummary-accessors>=0.1.2; extra == "docs"
@@ -225,6 +225,8 @@ Provides-Extra: netcdf
225
225
  Requires-Dist: netCDF4>=1.4.1; extra == "netcdf"
226
226
  Provides-Extra: h5py
227
227
  Requires-Dist: h5py; extra == "h5py"
228
+ Provides-Extra: xarray
229
+ Requires-Dist: xarray; extra == "xarray"
228
230
  Provides-Extra: test
229
231
  Requires-Dist: pytest>=5.4.1; extra == "test"
230
232
  Requires-Dist: pytest-cov>=0.6; extra == "test"
@@ -234,13 +236,13 @@ Requires-Dist: matplotlib; extra == "test"
234
236
  Requires-Dist: asv==0.6.1; extra == "test"
235
237
  Requires-Dist: virtualenv; extra == "test"
236
238
  Requires-Dist: pint; extra == "test"
237
- Requires-Dist: xarray; extra == "test"
239
+ Requires-Dist: imas-python[h5py,netcdf,xarray]; extra == "test"
238
240
 
239
241
  # IMAS-Python
240
242
 
241
- IMAS-Python is a pure-python library to handle arbitrarily nested data structures.
242
- It is designed for, but not necessarily bound to, interacting with Interface
243
- Data Structures (IDSs) as defined by the Integrated Modelling & Analysis Suite (IMAS)
243
+ IMAS-Python (formerly known as IMASPy its for versions < 2) is a pure-python library to handle
244
+ arbitrarily nested data structures. It is designed for, but not necessarily bound to, interacting
245
+ with Interface Data Structures (IDSs) as defined by the Integrated Modelling & Analysis Suite (IMAS)
244
246
  Data Model.
245
247
 
246
248
 
@@ -266,11 +268,17 @@ factory = imas.IDSFactory()
266
268
  equilibrium = factory.equilibrium()
267
269
  print(equilibrium)
268
270
 
269
- equilibrium.ids_properties.homogeneous_time = imas.ids_defs.IDS_TIME_MODE_HETEROGENEOUS
271
+ equilibrium.ids_properties.homogeneous_time = imas.ids_defs.IDS_TIME_MODE_HOMOGENEOUS
270
272
  equilibrium.ids_properties.comment = "testing"
273
+ equilibrium.time = [0.01]
271
274
 
272
- with imas.DBEntry("imas:hdf5?path=./testdb","w") as dbentry:
275
+ with imas.DBEntry("imas:hdf5?path=./testdb", "w") as dbentry:
273
276
  dbentry.put(equilibrium)
277
+
278
+ # or without imas_core dependency
279
+ with imas.DBEntry("./test.nc", "w") as dbentry:
280
+ dbentry.put(equilibrium)
281
+
274
282
  ```
275
283
 
276
284
  A quick 5 minutes introduction is available in the documentation generated from `/docs/sources/intro.rst`.
@@ -1,8 +1,8 @@
1
1
  # IMAS-Python
2
2
 
3
- IMAS-Python is a pure-python library to handle arbitrarily nested data structures.
4
- It is designed for, but not necessarily bound to, interacting with Interface
5
- Data Structures (IDSs) as defined by the Integrated Modelling & Analysis Suite (IMAS)
3
+ IMAS-Python (formerly known as IMASPy its for versions < 2) is a pure-python library to handle
4
+ arbitrarily nested data structures. It is designed for, but not necessarily bound to, interacting
5
+ with Interface Data Structures (IDSs) as defined by the Integrated Modelling & Analysis Suite (IMAS)
6
6
  Data Model.
7
7
 
8
8
 
@@ -28,11 +28,17 @@ factory = imas.IDSFactory()
28
28
  equilibrium = factory.equilibrium()
29
29
  print(equilibrium)
30
30
 
31
- equilibrium.ids_properties.homogeneous_time = imas.ids_defs.IDS_TIME_MODE_HETEROGENEOUS
31
+ equilibrium.ids_properties.homogeneous_time = imas.ids_defs.IDS_TIME_MODE_HOMOGENEOUS
32
32
  equilibrium.ids_properties.comment = "testing"
33
+ equilibrium.time = [0.01]
33
34
 
34
- with imas.DBEntry("imas:hdf5?path=./testdb","w") as dbentry:
35
+ with imas.DBEntry("imas:hdf5?path=./testdb", "w") as dbentry:
35
36
  dbentry.put(equilibrium)
37
+
38
+ # or without imas_core dependency
39
+ with imas.DBEntry("./test.nc", "w") as dbentry:
40
+ dbentry.put(equilibrium)
41
+
36
42
  ```
37
43
 
38
44
  A quick 5 minutes introduction is available in the documentation generated from `/docs/sources/intro.rst`.
@@ -13,7 +13,7 @@ source /etc/profile.d/modules.sh
13
13
  module purge
14
14
  # Modules are supplied as arguments in the CI job:
15
15
  if [ -z "$@" ]; then
16
- module load IMAS-AL-Core
16
+ module load IMAS-AL-Core Java MDSplus
17
17
  else
18
18
  module load $@
19
19
  fi
@@ -31,7 +31,7 @@ clean: Makefile
31
31
  # Seems to overwrite autosummary documentation though! So not using this rn
32
32
  MODULE_EXCLUDE="../imas/examples/**" "../imas/**"
33
33
  apidocs: Makefile
34
- sphinx-apidoc --implicit-namespaces -o "$(GENERATEDDIR)" "$(PROJECT_ROOT)/imaspy/" $(MODULE_EXCLUDE)
34
+ sphinx-apidoc --implicit-namespaces -o "$(GENERATEDDIR)" "$(PROJECT_ROOT)/imas/" $(MODULE_EXCLUDE)
35
35
 
36
36
  # Sphinx will run this automatically
37
37
  autogen: Makefile
@@ -3,13 +3,33 @@
3
3
  Changelog
4
4
  =========
5
5
 
6
- What's new in IMAS-Python 1.2.0
7
- --------------------------
6
+ What's new in IMAS-Python 2.0.0
7
+ -------------------------------
8
+
9
+ Breaking change
10
+ '''''''''''''''
11
+
12
+ The package name was changed from ``imaspy`` to ``imas`` while porting the code to `GitHub <https://github.com/iterorganization/IMAS-Python>`__. This shall only affect the import statements in your code.
13
+
14
+ New features and improvements
15
+ '''''''''''''''''''''''''''''
16
+
17
+ - Add :py:func:`imas.util.to_xarray` to convert a full IDS or only specific paths herein to a Xarray ``Dataset``. See :ref:`Convert IMAS-Python IDSs directly to Xarray Datasets` for more details.
18
+ - Implements automatic DD version conversion on :py:meth:`imas.db_entry.DBEntry.get` (conversion during :py:meth:`imas.db_entry.DBEntry.put` is not supported as this is rarely needed and easily worked around).
19
+ - Enable lazy loading when reading data from a netCDF file.
20
+ - Minor performance improvement loading data from a netCDF file.
21
+ - Replace versioneer by setuptools-scm to determine the version of the code.
22
+ - Use `saxonche <https://pypi.org/project/saxonche/>`__ instead of the JAR for XSL transforms (when building versions of the DD).
23
+ - Updating the README, CONTRIBUTING guidelines and documentation after making the code open access.
24
+
25
+
26
+ What's new in IMASPy 1.2.0
27
+ -------------------------------
8
28
 
9
29
  New features and improvements
10
30
  '''''''''''''''''''''''''''''
11
31
 
12
- - Add :py:func:`imaspy.DBEntry.get_sample` (requires imas_core >= 5.4.0)
32
+ - Add :py:func:`imaspy.DBEntry.get_sample <imas.db_entry.DBEntry.get_sample>` (requires imas_core >= 5.4.0)
13
33
  - Improved validation of netCDF files
14
34
  - Improve compatibility with the UDA backend in imas_core
15
35
  - Extend the support of netCDF to >= 1.4.1 (without complex numbers)
@@ -23,7 +43,7 @@ Bug fixes
23
43
 
24
44
 
25
45
 
26
- What's new in IMAS-Python 1.1.1
46
+ What's new in IMASPy 1.1.1
27
47
  -------------------------------
28
48
 
29
49
  This is a small release that mainly fixes issues related to the recent Data
@@ -39,7 +59,7 @@ Bug fixes
39
59
  Dictionary 4.0.0 and 3.42.0. In other cases, the Data Dictionary version is
40
60
  now explicitly indicated.
41
61
 
42
- - :issue:`IMAS-5560`: Fix a bug where IMAS-Python would not correctly recognize that
62
+ - :issue:`IMAS-5560`: Fix a bug where IMASPy would not correctly recognize that
43
63
  the UDA backend is used.
44
64
  - :issue:`IMAS-5541`: Fix a bug when converting a closed contour to Data
45
65
  Dictionary version 4.0.0.
@@ -49,7 +69,7 @@ Bug fixes
49
69
  recent Data Dictionary version than the on-disk data was stored with.
50
70
 
51
71
 
52
- What's new in IMAS-Python 1.1
72
+ What's new in IMASPy 1.1
53
73
  -----------------------------
54
74
 
55
75
  New features
@@ -57,7 +77,7 @@ New features
57
77
 
58
78
  - :ref:`1.1/improved performance`.
59
79
  - :ref:`1.1/improved conversion`.
60
- - IMAS-Python 1.1 adds support for Identifiers defined by the Data Dictionary. This
80
+ - IMASPy 1.1 adds support for Identifiers defined by the Data Dictionary. This
61
81
  functionality is described in detail in :ref:`Identifiers`.
62
82
  - Support for the new
63
83
  :py:const:`~imas.ids_defs.FLEXBUFFERS_SERIALIZER_PROTOCOL` that is
@@ -72,7 +92,7 @@ New features
72
92
  netCDF file, which can be used for sharing and/or archiving data.
73
93
 
74
94
  This feature is in `preview` status, meaning that it may change in upcoming
75
- minor releases of IMAS-Python.
95
+ minor releases of IMASPy.
76
96
 
77
97
  - Additional utility functions in :py:mod:`imas.util`:
78
98
 
@@ -91,18 +111,18 @@ New features
91
111
  - :py:func:`imas.util.get_data_dictionary_version` returns the Data
92
112
  Dictionary version for which an IDS was created.
93
113
 
94
- - Add support for IMAS Access Layer Core 5.2 and later. IMAS-Python can now be used
114
+ - Add support for IMAS Access Layer Core 5.2 and later. IMASPy can now be used
95
115
  with just the Access Layer Core package available, the full AL-Python HLI is
96
116
  no longer required.
97
117
 
98
118
  Since the Access Layer Core is now installable with ``pip`` as well (requires
99
119
  access to the git repository on
100
- `<https://github.com/iterorganization/imas-core>`__), you can install
101
- ``imas`` and ``imas_core`` in one go with:
120
+ `<https://git.iter.org/projects/IMAS/repos/al-core/>`__), you can install
121
+ ``imaspy`` and ``imas_core`` in one go with:
102
122
 
103
123
  .. code-block:: bash
104
124
 
105
- pip install 'imas[imas-core] @ git+ssh://git@github.com/iterorganization/imas-core.git'
125
+ pip install 'imaspy[imas-core] @ git+ssh://git@git.iter.org/imas/imaspy.git'
106
126
 
107
127
  - A diff tool for IDSs: :py:func:`imas.util.idsdiff`.
108
128
  - Implement ``==`` equality checking for IDS Structures and Arrays of Structures
@@ -111,12 +131,12 @@ New features
111
131
  backend.
112
132
 
113
133
  During a :py:meth:`~imas.db_entry.DBEntry.get` or
114
- :py:meth:`~imas.db_entry.DBEntry.get_slice`, IMAS-Python first reads the version
134
+ :py:meth:`~imas.db_entry.DBEntry.get_slice`, IMASPy first reads the version
115
135
  of the Data Dictionary that was used to store the IDS. When this version is
116
- not known to IMAS-Python, an error is raised. This error can now be ignored by
136
+ not known to IMASPy, an error is raised. This error can now be ignored by
117
137
  setting the parameter
118
138
  :py:param:`~imas.db_entry.DBEntry.get.ignore_unknown_dd_version` to
119
- ``True``, and IMAS-Python will do its best to load the data anyway.
139
+ ``True``, and IMASPy will do its best to load the data anyway.
120
140
 
121
141
  - A new command line tool exists for analyzing which Data Dictionary fields are
122
142
  used in provided Data Entries. This tool is explained in detail in
@@ -130,7 +150,7 @@ Breaking changes
130
150
 
131
151
  .. note::
132
152
 
133
- We attempt to keep the public API of IMAS-Python stable with minor releases. The
153
+ We attempt to keep the public API of IMASPy stable with minor releases. The
134
154
  following breaking change is the result of an upgrade of the IMAS Access Layer.
135
155
 
136
156
  - Starting with Access Layer 5.2 or newer, the Access Layer will raise
@@ -141,8 +161,8 @@ Breaking changes
141
161
  You may need to update the :py:class:`Exception` classes in ``try/except``
142
162
  blocks to the new Exception classes raised by ``imas_core``.
143
163
 
144
- When using an older version of the Access Layer, the behaviour of IMAS-Python is no
145
- different than in IMAS-Python 1.0.
164
+ When using an older version of the Access Layer, the behaviour of IMASPy is no
165
+ different than in IMASPy 1.0.
146
166
 
147
167
 
148
168
  Bug fixes
@@ -156,10 +176,10 @@ Bug fixes
156
176
  - Fixed a bug with :py:func:`~imas.ids_toplevel.IDSToplevel.serialize` when
157
177
  the IDS is in a non-default Data Dictionary version.
158
178
  - Fixed a bug when assigning ``nan`` to a FLT_0D, which would lead to a
159
- confusing and incorrect log message in IMAS-Python 1.0.
160
- - Fixed incorrect oldest supported DD version. Previously IMAS-Python indicated that
179
+ confusing and incorrect log message in IMASPy 1.0.
180
+ - Fixed incorrect oldest supported DD version. Previously IMASPy indicated that
161
181
  DD ``3.21.1`` was supported, however ``3.22.0`` is the oldest Data Dictionary
162
- tested (and provided) with IMAS-Python. :py:attr:`imas.OLDEST_SUPPORTED_VERSION`
182
+ tested (and provided) with IMASPy. :py:attr:`imas.OLDEST_SUPPORTED_VERSION`
163
183
  has been updated to reflect this.
164
184
  - Fixed a bug when using numpy functions, such as
165
185
  :external:py:func:`numpy.isclose` on scalar numbers. Previously an error was
@@ -178,11 +198,11 @@ Improved performance
178
198
  ''''''''''''''''''''
179
199
 
180
200
  - Improved performance of :py:meth:`~imas.ids_toplevel.IDSToplevel.validate`.
181
- - Improved creation of IMAS-Python IDS objects. This made filling IDSs and loading
201
+ - Improved creation of IMASPy IDS objects. This made filling IDSs and loading
182
202
  them with :py:meth:`~imas.db_entry.DBEntry.get` /
183
203
  :py:meth:`~imas.db_entry.DBEntry.get_slice` 10-20% faster.
184
204
  - Improved the performance of lazy loading. This is most noticeable with the
185
- ``HDF5`` backend, which is now up to 40x faster than with IMAS-Python 1.0.
205
+ ``HDF5`` backend, which is now up to 40x faster than with IMASPy 1.0.
186
206
  - Improved the performance of :py:meth:`~imas.db_entry.DBEntry.get` /
187
207
  :py:meth:`~imas.db_entry.DBEntry.get_slice` /
188
208
  :py:meth:`~imas.db_entry.DBEntry.put` /
@@ -200,7 +220,7 @@ Converting IDSs between Data Dictionary versions has several improvements for
200
220
  recent DD versions. Further details on IDS conversion can be found in
201
221
  :ref:`Conversion of IDSs between DD versions`.
202
222
 
203
- - The IMAS-Python Command Line Interface for converting Data Entries between different
223
+ - The IMASPy Command Line Interface for converting Data Entries between different
204
224
  versions of the Data Dictionary has been improved. See :ref:`Command line tool
205
225
  reference` or execute ``imas convert --help`` in a shell for further
206
226
  details.
@@ -210,7 +230,7 @@ recent DD versions. Further details on IDS conversion can be found in
210
230
  For example, in the ``pulse_schedule`` IDS, the node
211
231
  ``ec/beam/power_launched/reference`` in Data Dictionary ``3.40.0`` was renamed
212
232
  from ``ec/launcher/power/reference/data`` in Data Dictionary ``3.39.0``. This
213
- use case is now supported by IMAS-Python.
233
+ use case is now supported by IMASPy.
214
234
 
215
235
  - Automatically convert data between 0D and 1D when possible (`IMAS-5170
216
236
  <https://jira.iter.org/browse/IMAS-5170>`__).
@@ -1,6 +1,7 @@
1
1
  import os
2
2
 
3
3
  import matplotlib
4
+
4
5
  # To avoid possible display issues when Matplotlib uses a non-GUI backend
5
6
  if "DISPLAY" not in os.environ:
6
7
  matplotlib.use("agg")
@@ -17,6 +18,39 @@ import xarray
17
18
  entry = imas.training.get_training_db_entry()
18
19
  cp = entry.get("core_profiles")
19
20
 
21
+ #######################################################################################
22
+ # Steps 2, 3 and 4, using imas.util.to_xarray
23
+ # Create an xarray Dataset containing t_i_average and its coordinates
24
+ xrds = imas.util.to_xarray(cp, "profiles_1d/t_i_average")
25
+ # Note that profiles_1d.grid.rho_tor_norm is a 2D coordinate: its values may be
26
+ # different at different times.
27
+ #
28
+ # Since the values at different time slices differ only minutely in this example, we'll
29
+ # rename the `profiles_1d.grid.rho_tor_norm:i` dimension to `rho_tor_norm` and set the
30
+ # values to the values of rho_tor_norm of the first time slice:
31
+ xrds = xrds.rename({"profiles_1d.grid.rho_tor_norm:i": "rho_tor_norm"}).assign_coords(
32
+ {"rho_tor_norm": xrds["profiles_1d.grid.rho_tor_norm"].isel(time=0).data}
33
+ )
34
+
35
+ # Extract temperatures as an xarray DataArray
36
+ temperature = xrds["profiles_1d.t_i_average"]
37
+
38
+ # 5a. Select subset of temperature where 0.4 <= rho_tor_norm < 0.6:
39
+ print(temperature.sel(rho_tor_norm=slice(0.4, 0.6)))
40
+
41
+ # 5b. Interpolate temperature on a new grid: [0, 0.1, 0.2, ..., 0.9, 1.0]
42
+ print(temperature.interp(rho_tor_norm=numpy.linspace(0, 1, 11)))
43
+
44
+ # 5c. Interpolate temperature on a new time base: [10, 20]
45
+ print(temperature.interp(time=[10, 20]))
46
+
47
+ # 5d. Plot
48
+ temperature.plot(x="time", norm=matplotlib.colors.LogNorm())
49
+ plt.show()
50
+
51
+ #######################################################################################
52
+ # We can also manually build an xarray DataArray, this is shown below:
53
+
20
54
  # 2. Store the temperature of the first time slice
21
55
  temperature = cp.profiles_1d[0].t_i_average
22
56
 
@@ -3,9 +3,12 @@ Create ``xarray.DataArray`` from an IDS
3
3
 
4
4
  .. info::
5
5
 
6
- In this lesson you will create a ``DataArray`` manually. In a future version of
7
- IMAS-Python we plan to include functionality that will automatically do this for you.
8
- That should further simplify working with data inside IDSs.
6
+ This lesson was written before :py:func:`imas.util.to_xarray` was
7
+ implemented. This lesson is retained for educational purposes, however we
8
+ recommend to use :py:func:`imas.util.to_xarray` instead of manually creating
9
+ xarray ``DataArray``\ s.
10
+
11
+ See also: :ref:`Convert IMAS-Python IDSs directly to Xarray Datasets`.
9
12
 
10
13
  Let's start with an introduction of Xarray. According to `their website
11
14
  <https://docs.xarray.dev/en/stable/getting-started-guide/why-xarray.html>`_ (where you
@@ -61,6 +64,10 @@ Exercise 1: create a ``DataArray`` for ``profiles_1d/temperature``
61
64
 
62
65
  .. md-tab-item:: Solution
63
66
 
67
+ This exercise was created before the implementation of
68
+ :py:func:`imas.util.to_xarray`. The original approach is available below
69
+ for educational purposes.
70
+
64
71
  .. literalinclude:: imas_snippets/ids_to_xarray.py
65
72
 
66
73
 
@@ -96,4 +103,9 @@ the ``profiles_1d`` array of structures. When the grid is not changing in the ID
96
103
 
97
104
  .. md-tab-item:: Solution
98
105
 
106
+ This exercise was created before the implementation of
107
+ :py:func:`imas.util.to_xarray`. Below code sample is updated to provide
108
+ two alternatives: the first is based on :py:func:`imas.util.to_xarray`,
109
+ the second is the original, manual approach.
110
+
99
111
  .. literalinclude:: imas_snippets/tensorized_ids_to_xarray.py
@@ -11,6 +11,11 @@ data structures. IMAS-Python is designed for, but not necessarily bound to,
11
11
  interacting with Interface Data Structures (IDSs) as defined by the
12
12
  Integrated Modelling & Analysis Suite (IMAS) Data Model.
13
13
 
14
+ .. note::
15
+
16
+ IMAS-Python was formerly known as IMASPy, and was renamed with the release
17
+ of the major version 2.
18
+
14
19
  It provides:
15
20
 
16
21
  - An easy-to-install and easy-to-get started package by
@@ -56,7 +56,7 @@ This is how to run the IMAS-Python test suite:
56
56
  # inside the IMAS-Python git repository
57
57
  pytest imas --mini
58
58
 
59
- # run with a specific backend
59
+ # run with a specific backend, requires IMAS-Core installed
60
60
  pytest imas --ascii --mini
61
61
 
62
62
  And to build the IMAS-Python documentation, execute: