h5rdmtoolbox 2.3.1__tar.gz → 2.4.0rc2__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 (151) hide show
  1. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/PKG-INFO +27 -22
  2. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/README.md +8 -5
  3. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/__init__.py +32 -35
  4. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/_cfg.py +2 -2
  5. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/convention/core.py +14 -17
  6. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/convention/utils.py +2 -2
  7. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/data/tutorial_convention.yaml +1 -1
  8. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/data/tutorial_standard_name_table.yaml +3 -3
  9. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/extensions/units.py +4 -1
  10. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/ld/__init__.py +57 -4
  11. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/ld/hdf/attributes.py +6 -5
  12. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/ld/hdf/datasets.py +2 -3
  13. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/ld/hdf/file.py +3 -3
  14. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/ld/hdf/groups.py +2 -3
  15. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/ld/rdf.py +90 -36
  16. h5rdmtoolbox-2.4.0rc2/h5rdmtoolbox/ld/user/attributes.py +195 -0
  17. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/ld/user/datasets.py +7 -1
  18. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/ld/user/groups.py +14 -4
  19. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/ld/utils.py +6 -2
  20. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/protocols.py +26 -2
  21. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/repository/__init__.py +1 -2
  22. h5rdmtoolbox-2.4.0rc2/h5rdmtoolbox/repository/default_metamapper.py +55 -0
  23. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/repository/interface.py +8 -12
  24. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/repository/utils.py +1 -1
  25. h5rdmtoolbox-2.4.0rc2/h5rdmtoolbox/repository/zenodo/__init__.py +5 -0
  26. h5rdmtoolbox-2.4.0rc2/h5rdmtoolbox/repository/zenodo/core.py +447 -0
  27. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/repository/zenodo/metadata.py +2 -2
  28. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/wrapper/h5attr.py +8 -2
  29. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/wrapper/jsonld.py +2 -2
  30. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox.egg-info/PKG-INFO +27 -22
  31. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox.egg-info/SOURCES.txt +1 -0
  32. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox.egg-info/requires.txt +14 -15
  33. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/setup.cfg +11 -9
  34. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/conventions/test_conventions.py +13 -7
  35. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/ld/test_ld.py +31 -9
  36. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/ld/test_rdf.py +1 -3
  37. h5rdmtoolbox-2.4.0rc2/tests/ld/test_user_graph.py +275 -0
  38. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/repository/test_zenodo.py +70 -24
  39. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/test_cli.py +1 -3
  40. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/test_config.py +10 -3
  41. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/test_version.py +9 -4
  42. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/test_xarray_export.py +6 -3
  43. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/wrapper/test_core.py +2 -2
  44. h5rdmtoolbox-2.3.1/h5rdmtoolbox/ld/user/attributes.py +0 -117
  45. h5rdmtoolbox-2.3.1/h5rdmtoolbox/repository/zenodo/__init__.py +0 -5
  46. h5rdmtoolbox-2.3.1/h5rdmtoolbox/repository/zenodo/core.py +0 -825
  47. h5rdmtoolbox-2.3.1/tests/ld/test_user_graph.py +0 -74
  48. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/LICENSE +0 -0
  49. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/_repr.py +0 -0
  50. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/_version.py +0 -0
  51. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/cli.py +0 -0
  52. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/consts.py +0 -0
  53. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/convention/__init__.py +0 -0
  54. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/convention/cfg.py +0 -0
  55. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/convention/consts.py +0 -0
  56. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/convention/errors.py +0 -0
  57. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/convention/generate.py +0 -0
  58. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/convention/ontology/__init__.py +0 -0
  59. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/convention/ontology/h5ontocls.py +0 -0
  60. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/convention/ontology/hdf_datatypes.py +0 -0
  61. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/convention/references.py +0 -0
  62. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/convention/standard_attributes.py +0 -0
  63. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/convention/toolbox_validators.py +0 -0
  64. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/data/def_icon.png +0 -0
  65. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/data/fluid-v1.yml +0 -0
  66. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/data/h5tbx.yaml +0 -0
  67. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/data/id_icon.png +0 -0
  68. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/data/iri_icon.png +0 -0
  69. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/data/ld_icon.png +0 -0
  70. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/data/piv-v1.yml +0 -0
  71. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/data/style.css +0 -0
  72. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/data/type_icon.png +0 -0
  73. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/database/__init__.py +0 -0
  74. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/database/hdfdb/__init__.py +0 -0
  75. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/database/hdfdb/filedb.py +0 -0
  76. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/database/hdfdb/objdb.py +0 -0
  77. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/database/hdfdb/query.py +0 -0
  78. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/database/hdfdb/utils.py +0 -0
  79. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/database/interface.py +0 -0
  80. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/database/lazy.py +0 -0
  81. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/database/mongo.py +0 -0
  82. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/errors.py +0 -0
  83. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/extensions/__init__.py +0 -0
  84. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/extensions/magnitude.py +0 -0
  85. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/extensions/normalize.py +0 -0
  86. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/extensions/onto.py +0 -0
  87. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/extensions/vector.py +0 -0
  88. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/gui/__init__.py +0 -0
  89. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/gui/fairify.py +0 -0
  90. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/gui/src/__init__.py +0 -0
  91. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/gui/src/main.py +0 -0
  92. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/identifiers.py +0 -0
  93. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/layout/__init__.py +0 -0
  94. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/layout/core.py +0 -0
  95. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/ld/globals.py +0 -0
  96. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/ld/hdf/__init__.py +0 -0
  97. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/ld/user/__init__.py +0 -0
  98. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/ld/user/file.py +0 -0
  99. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/plotting.py +0 -0
  100. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/protected_attributes.py +0 -0
  101. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/repository/zenodo/tokens.py +0 -0
  102. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/repository/zenodo/utils.py +0 -0
  103. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/tutorial.py +0 -0
  104. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/user.py +0 -0
  105. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/utils.py +0 -0
  106. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/wrapper/__init__.py +0 -0
  107. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/wrapper/accessor.py +0 -0
  108. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/wrapper/accessors/__init__.py +0 -0
  109. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/wrapper/accessors/provenance.py +0 -0
  110. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/wrapper/core.py +0 -0
  111. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/wrapper/ds_decoder.py +0 -0
  112. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/wrapper/h5ext.py +0 -0
  113. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/wrapper/h5utils.py +0 -0
  114. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/wrapper/h5yaml.py +0 -0
  115. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox/wrapper/xr2hdf.py +0 -0
  116. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox.egg-info/dependency_links.txt +0 -0
  117. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox.egg-info/entry_points.txt +0 -0
  118. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/h5rdmtoolbox.egg-info/top_level.txt +0 -0
  119. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/pyproject.toml +0 -0
  120. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/setup.py +0 -0
  121. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/__init__.py +0 -0
  122. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/clean_zenodo_sandbox.py +0 -0
  123. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/conventions/__init__.py +0 -0
  124. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/conventions/test_convention_vfuncs.py +0 -0
  125. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/conventions/test_engmeta.py +0 -0
  126. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/conventions/test_references.py +0 -0
  127. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/conventions/test_toolbox_validators.py +0 -0
  128. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/conventions/test_utils.py +0 -0
  129. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/database/__init__.py +0 -0
  130. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/database/test_find_rdf.py +0 -0
  131. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/database/test_hdfDB.py +0 -0
  132. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/database/test_mongo.py +0 -0
  133. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/layouts/__init__.py +0 -0
  134. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/layouts/test_core.py +0 -0
  135. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/layouts/test_docs.py +0 -0
  136. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/ld/__init__.py +0 -0
  137. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/ld/test_utils.py +0 -0
  138. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/repository/__init__.py +0 -0
  139. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/test_extensions.py +0 -0
  140. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/test_identifiers.py +0 -0
  141. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/test_plotting.py +0 -0
  142. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/test_repr.py +0 -0
  143. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/test_user.py +0 -0
  144. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/test_utils.py +0 -0
  145. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/wrapper/__init__.py +0 -0
  146. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/wrapper/test_dump.py +0 -0
  147. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/wrapper/test_file.py +0 -0
  148. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/wrapper/test_h5ext.py +0 -0
  149. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/wrapper/test_lazy.py +0 -0
  150. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/wrapper/test_namespaces.py +0 -0
  151. {h5rdmtoolbox-2.3.1 → h5rdmtoolbox-2.4.0rc2}/tests/wrapper/test_xr2df.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: h5rdmtoolbox
3
- Version: 2.3.1
3
+ Version: 2.4.0rc2
4
4
  Summary: Supporting a FAIR Research Data lifecycle using Python and HDF5.
5
5
  Home-page: https://h5rdmtoolbox.readthedocs.io/en/latest/
6
6
  Author: Matthias Probst
@@ -9,31 +9,33 @@ Classifier: Programming Language :: Python :: 3.9
9
9
  Classifier: Programming Language :: Python :: 3.10
10
10
  Classifier: Programming Language :: Python :: 3.11
11
11
  Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
12
13
  Classifier: License :: OSI Approved :: MIT License
13
14
  Classifier: Operating System :: OS Independent
14
15
  Classifier: Development Status :: 4 - Beta
15
16
  Classifier: Topic :: Scientific/Engineering
16
- Requires-Python: <3.13,>=3.9
17
+ Requires-Python: <3.14,>=3.9
17
18
  Description-Content-Type: text/markdown
18
19
  License-File: LICENSE
19
20
  Requires-Dist: appdirs~=1.4
20
21
  Requires-Dist: importlib_resources<7.0.0,>=6.5.2
21
- Requires-Dist: numpy<2.0.0,>=1.20
22
+ Requires-Dist: numpy<3.0.0,>=1.20
22
23
  Requires-Dist: h5py~=3.8
23
24
  Requires-Dist: matplotlib>=3.5.2
24
25
  Requires-Dist: IPython>=7.34.0
25
26
  Requires-Dist: pyyaml>=6.0
26
27
  Requires-Dist: xarray>=2022.3.0
27
- Requires-Dist: pint==0.21.1
28
- Requires-Dist: pint_xarray<=0.4.0,>=0.2.1
28
+ Requires-Dist: pint>=0.24.4
29
+ Requires-Dist: pint_xarray<=0.6.0,>=0.2.1
29
30
  Requires-Dist: regex>=2020.7.9
30
31
  Requires-Dist: packaging>=24.1
31
- Requires-Dist: ontolutils<0.20.0,>=0.19.2
32
+ Requires-Dist: ontolutils<1.0.0,>=0.21.1
32
33
  Requires-Dist: python-forge==18.6.0
33
34
  Requires-Dist: requests>=2.32.4
34
35
  Requires-Dist: pydantic~=2.8
35
36
  Requires-Dist: rdflib~=7.1
36
- Requires-Dist: click==8.1.7
37
+ Requires-Dist: click>=8.1.7
38
+ Requires-Dist: cftime>=1.6.4
37
39
  Provides-Extra: database
38
40
  Requires-Dist: pymongo<=4.10.1,>=4.2.0; extra == "database"
39
41
  Provides-Extra: layout-validation
@@ -51,12 +53,12 @@ Provides-Extra: test
51
53
  Requires-Dist: pytest>=8.3.3; extra == "test"
52
54
  Requires-Dist: pytest-cov>=5.0.0; extra == "test"
53
55
  Requires-Dist: pylint; extra == "test"
54
- Requires-Dist: scikit-image; extra == "test"
55
- Requires-Dist: ssnolib>=1.5.1.2; extra == "test"
56
+ Requires-Dist: ssnolib>=1.5.1.4; extra == "test"
56
57
  Requires-Dist: mongomock==4.1.2; extra == "test"
57
58
  Requires-Dist: xmltodict<=0.13.0; extra == "test"
58
59
  Requires-Dist: scipy>=1.10.1; extra == "test"
59
60
  Requires-Dist: scikit-image>=0.21.0; extra == "test"
61
+ Requires-Dist: scikit-learn; extra == "test"
60
62
  Requires-Dist: pandas>=1.4.3; extra == "test"
61
63
  Requires-Dist: xmltodict<=0.13.0; extra == "test"
62
64
  Requires-Dist: tabulate<=0.9.0,>=0.8.10; extra == "test"
@@ -73,12 +75,12 @@ Requires-Dist: pymongo<=4.10.1,>=4.2.0; extra == "docs"
73
75
  Requires-Dist: pytest>=8.3.3; extra == "docs"
74
76
  Requires-Dist: pytest-cov>=5.0.0; extra == "docs"
75
77
  Requires-Dist: pylint; extra == "docs"
76
- Requires-Dist: scikit-image; extra == "docs"
77
- Requires-Dist: ssnolib>=1.5.1.2; extra == "docs"
78
+ Requires-Dist: ssnolib>=1.5.1.4; extra == "docs"
78
79
  Requires-Dist: mongomock==4.1.2; extra == "docs"
79
80
  Requires-Dist: xmltodict<=0.13.0; extra == "docs"
80
81
  Requires-Dist: scipy>=1.10.1; extra == "docs"
81
82
  Requires-Dist: scikit-image>=0.21.0; extra == "docs"
83
+ Requires-Dist: scikit-learn; extra == "docs"
82
84
  Requires-Dist: pandas>=1.4.3; extra == "docs"
83
85
  Requires-Dist: xmltodict<=0.13.0; extra == "docs"
84
86
  Requires-Dist: tabulate<=0.9.0,>=0.8.10; extra == "docs"
@@ -99,12 +101,12 @@ Requires-Dist: PyQt5==5.15.10; extra == "complete"
99
101
  Requires-Dist: pytest>=8.3.3; extra == "complete"
100
102
  Requires-Dist: pytest-cov>=5.0.0; extra == "complete"
101
103
  Requires-Dist: pylint; extra == "complete"
102
- Requires-Dist: scikit-image; extra == "complete"
103
- Requires-Dist: ssnolib>=1.5.1.2; extra == "complete"
104
+ Requires-Dist: ssnolib>=1.5.1.4; extra == "complete"
104
105
  Requires-Dist: mongomock==4.1.2; extra == "complete"
105
106
  Requires-Dist: xmltodict<=0.13.0; extra == "complete"
106
107
  Requires-Dist: scipy>=1.10.1; extra == "complete"
107
108
  Requires-Dist: scikit-image>=0.21.0; extra == "complete"
109
+ Requires-Dist: scikit-learn; extra == "complete"
108
110
  Requires-Dist: pandas>=1.4.3; extra == "complete"
109
111
  Requires-Dist: xmltodict<=0.13.0; extra == "complete"
110
112
  Requires-Dist: tabulate<=0.9.0,>=0.8.10; extra == "complete"
@@ -117,12 +119,12 @@ Requires-Dist: PyQt5==5.15.10; extra == "complete-with-docs"
117
119
  Requires-Dist: pytest>=8.3.3; extra == "complete-with-docs"
118
120
  Requires-Dist: pytest-cov>=5.0.0; extra == "complete-with-docs"
119
121
  Requires-Dist: pylint; extra == "complete-with-docs"
120
- Requires-Dist: scikit-image; extra == "complete-with-docs"
121
- Requires-Dist: ssnolib>=1.5.1.2; extra == "complete-with-docs"
122
+ Requires-Dist: ssnolib>=1.5.1.4; extra == "complete-with-docs"
122
123
  Requires-Dist: mongomock==4.1.2; extra == "complete-with-docs"
123
124
  Requires-Dist: xmltodict<=0.13.0; extra == "complete-with-docs"
124
125
  Requires-Dist: scipy>=1.10.1; extra == "complete-with-docs"
125
126
  Requires-Dist: scikit-image>=0.21.0; extra == "complete-with-docs"
127
+ Requires-Dist: scikit-learn; extra == "complete-with-docs"
126
128
  Requires-Dist: pandas>=1.4.3; extra == "complete-with-docs"
127
129
  Requires-Dist: xmltodict<=0.13.0; extra == "complete-with-docs"
128
130
  Requires-Dist: tabulate<=0.9.0,>=0.8.10; extra == "complete-with-docs"
@@ -138,12 +140,12 @@ Requires-Dist: pymongo<=4.10.1,>=4.2.0; extra == "complete-with-docs"
138
140
  Requires-Dist: pytest>=8.3.3; extra == "complete-with-docs"
139
141
  Requires-Dist: pytest-cov>=5.0.0; extra == "complete-with-docs"
140
142
  Requires-Dist: pylint; extra == "complete-with-docs"
141
- Requires-Dist: scikit-image; extra == "complete-with-docs"
142
- Requires-Dist: ssnolib>=1.5.1.2; extra == "complete-with-docs"
143
+ Requires-Dist: ssnolib>=1.5.1.4; extra == "complete-with-docs"
143
144
  Requires-Dist: mongomock==4.1.2; extra == "complete-with-docs"
144
145
  Requires-Dist: xmltodict<=0.13.0; extra == "complete-with-docs"
145
146
  Requires-Dist: scipy>=1.10.1; extra == "complete-with-docs"
146
147
  Requires-Dist: scikit-image>=0.21.0; extra == "complete-with-docs"
148
+ Requires-Dist: scikit-learn; extra == "complete-with-docs"
147
149
  Requires-Dist: pandas>=1.4.3; extra == "complete-with-docs"
148
150
  Requires-Dist: xmltodict<=0.13.0; extra == "complete-with-docs"
149
151
  Requires-Dist: tabulate<=0.9.0,>=0.8.10; extra == "complete-with-docs"
@@ -165,7 +167,7 @@ Dynamic: license-file
165
167
  ![Tests](https://github.com/matthiasprobst/h5RDMtoolbox/actions/workflows/tests.yml/badge.svg)
166
168
  [![codecov](https://codecov.io/gh/matthiasprobst/h5RDMtoolbox/graph/badge.svg?token=IVG4AQEW47)](https://codecov.io/gh/matthiasprobst/h5RDMtoolbox)
167
169
  [![Documentation Status](https://readthedocs.org/projects/h5rdmtoolbox/badge/?version=latest)](https://h5rdmtoolbox.readthedocs.io/en/latest/?badge=latest)
168
- ![pyvers](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue)
170
+ ![pyvers](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue)
169
171
 
170
172
  *Note, that the project is still under development!*
171
173
 
@@ -256,11 +258,12 @@ A paper is published in the journal [inggrid](https://preprints.inggrid.org/repo
256
258
 
257
259
  ## Installation
258
260
 
259
- Use python 3.8 or higher (automatic testing is performed until 3.12). If you are a regular user, you can install the
261
+ Use python 3.9 or higher (automatic testing is performed until 3.13). If you are a regular user, you can install the
260
262
  package via pip:
261
263
 
262
264
  pip install h5RDMtoolbox
263
265
 
266
+
264
267
  ### Install from source:
265
268
 
266
269
  Developers may clone the repository and install the package from source. Clone the repository first:
@@ -293,7 +296,7 @@ specific to the features of the package:
293
296
 
294
297
  **Specific to the package are ...**
295
298
 
296
- - `h5py=3.7.0`: HDF5 file interface
299
+ - `h5py~=3.8`: HDF5 file interface
297
300
  - `xarray>=2022.3.0`: Working with scientific arrays in combination with attributes. Allows carrying metadata from HDF5
298
301
  to user
299
302
  - `pint>=0.19.2`: Allows working with units
@@ -334,10 +337,12 @@ Install optional dependencies by specifying them in square brackets after the pa
334
337
  ## Citing the package
335
338
 
336
339
  If you intend to use the package in your work, you may cite the software itself as published on paper in the
337
- [Zenodo](https://zenodo.org/records/14473697) repository. A related paper is published in the
340
+ [Zenodo (latest version)](https://zenodo.org/records/13309253) repository. A related paper is published in the
338
341
  journal [inggrid](https://www.inggrid.org/article/id/4028/). Thank you!
339
342
 
340
- Here's the bibtext to it:
343
+ Alternatively or additionally, you can consult the `CITATION.cff` file.
344
+
345
+ Here is the BibTeX entry:
341
346
 
342
347
  ```
343
348
  @article{probst2024h5rdmtoolbox,
@@ -3,7 +3,7 @@
3
3
  ![Tests](https://github.com/matthiasprobst/h5RDMtoolbox/actions/workflows/tests.yml/badge.svg)
4
4
  [![codecov](https://codecov.io/gh/matthiasprobst/h5RDMtoolbox/graph/badge.svg?token=IVG4AQEW47)](https://codecov.io/gh/matthiasprobst/h5RDMtoolbox)
5
5
  [![Documentation Status](https://readthedocs.org/projects/h5rdmtoolbox/badge/?version=latest)](https://h5rdmtoolbox.readthedocs.io/en/latest/?badge=latest)
6
- ![pyvers](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue)
6
+ ![pyvers](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue)
7
7
 
8
8
  *Note, that the project is still under development!*
9
9
 
@@ -94,11 +94,12 @@ A paper is published in the journal [inggrid](https://preprints.inggrid.org/repo
94
94
 
95
95
  ## Installation
96
96
 
97
- Use python 3.8 or higher (automatic testing is performed until 3.12). If you are a regular user, you can install the
97
+ Use python 3.9 or higher (automatic testing is performed until 3.13). If you are a regular user, you can install the
98
98
  package via pip:
99
99
 
100
100
  pip install h5RDMtoolbox
101
101
 
102
+
102
103
  ### Install from source:
103
104
 
104
105
  Developers may clone the repository and install the package from source. Clone the repository first:
@@ -131,7 +132,7 @@ specific to the features of the package:
131
132
 
132
133
  **Specific to the package are ...**
133
134
 
134
- - `h5py=3.7.0`: HDF5 file interface
135
+ - `h5py~=3.8`: HDF5 file interface
135
136
  - `xarray>=2022.3.0`: Working with scientific arrays in combination with attributes. Allows carrying metadata from HDF5
136
137
  to user
137
138
  - `pint>=0.19.2`: Allows working with units
@@ -172,10 +173,12 @@ Install optional dependencies by specifying them in square brackets after the pa
172
173
  ## Citing the package
173
174
 
174
175
  If you intend to use the package in your work, you may cite the software itself as published on paper in the
175
- [Zenodo](https://zenodo.org/records/14473697) repository. A related paper is published in the
176
+ [Zenodo (latest version)](https://zenodo.org/records/13309253) repository. A related paper is published in the
176
177
  journal [inggrid](https://www.inggrid.org/article/id/4028/). Thank you!
177
178
 
178
- Here's the bibtext to it:
179
+ Alternatively or additionally, you can consult the `CITATION.cff` file.
180
+
181
+ Here is the BibTeX entry:
179
182
 
180
183
  ```
181
184
  @article{probst2024h5rdmtoolbox,
@@ -2,6 +2,7 @@
2
2
 
3
3
  import logging
4
4
  import pathlib
5
+ import warnings
5
6
  from logging.handlers import RotatingFileHandler
6
7
  from typing import Optional, Dict
7
8
 
@@ -62,7 +63,7 @@ __author__ = 'Matthias Probst'
62
63
  __author_orcid__ = 'https://orcid.org/0000-0001-8729-0482'
63
64
 
64
65
 
65
- def get_package_meta():
66
+ def get_package_meta() -> Dict:
66
67
  """Reads codemeta.json and returns it as dict"""
67
68
  with open(__this_dir__ / '../codemeta.json', 'r') as f:
68
69
  codemeta = json.loads(f.read())
@@ -172,7 +173,6 @@ def dump_jsonld_depr(hdf_filename: Union[str, pathlib.Path],
172
173
  skipND: int = 1,
173
174
  structural: bool = True,
174
175
  contextual: bool = True,
175
- resolve_keys: bool = True,
176
176
  context: Optional[Dict] = None,
177
177
  blank_node_iri_base: Optional[str] = None
178
178
  ) -> str:
@@ -189,19 +189,12 @@ def dump_jsonld_depr(hdf_filename: Union[str, pathlib.Path],
189
189
  considered if structural=True.
190
190
  structural : bool=True
191
191
  Include structural information in the JSON-LD output.
192
- semantic : bool=True
193
- Include semantic information in the JSON-LD output.
194
- resolve_keys : bool=True
195
- Resolve keys in the JSON-LD output. This is used when semantic=True.
196
- If resolve_keys is False and an attribute name in the HDF5 file, which has
197
- a predicate is different in its name from the predicate, the attribute name is used.
198
- Example: an attribute "name" is associated with "foaf:lastName", then "name" is used
199
- and "name": "http://xmlns.com/foaf/0.1/lastName" is added to the context.
192
+ contextual : bool=True
193
+ Include contextual information in the JSON-LD output.
200
194
  context: Optional[Dict]
201
195
  context in form of {prefix: IRI}, e.g. "ssno": "https://matthiasprobst.github.io/ssno#"
202
- If resolve_keys is True, this is added to the built-in look-up table to be used in the
203
- context part of JSON-LD
204
-
196
+ blank_node_iri_base: Optional[str]
197
+ IRI base used for blank nodes
205
198
  """
206
199
  if blank_node_iri_base is not None:
207
200
  if not isinstance(blank_node_iri_base, (str, HttpUrl)):
@@ -212,20 +205,18 @@ def dump_jsonld_depr(hdf_filename: Union[str, pathlib.Path],
212
205
 
213
206
  from h5rdmtoolbox.ld.hdf.file import get_serialized_ld
214
207
  if structural and not contextual:
215
- return get_serialized_ld(hdf_filename, blank_node_iri_base, format="json-ld", context=context,
216
- contextual=contextual, skipND=skipND)
217
- return get_serialized_ld(hdf_filename, blank_node_iri_base, format="json-ld", context=context,
218
- contextual=contextual, skipND=skipND)
219
- # with File(hdf_filename) as h5:
220
- # return jsonld.dumps(
221
- # h5,
222
- # structural=structural,
223
- # resolve_keys=resolve_keys,
224
- # context=context,
225
- # blank_node_iri_base=blank_node_iri_base,
226
- # skipND=skipND,
227
- # **kwargs
228
- # )
208
+ return get_serialized_ld(
209
+ hdf_filename,
210
+ blank_node_iri_base,
211
+ format="json-ld",
212
+ context=context,
213
+ skipND=skipND)
214
+ return get_serialized_ld(
215
+ hdf_filename,
216
+ blank_node_iri_base,
217
+ format="json-ld",
218
+ context=context,
219
+ skipND=skipND)
229
220
 
230
221
 
231
222
  def serialize(hdf_filename,
@@ -237,6 +228,11 @@ def serialize(hdf_filename,
237
228
  **kwargs):
238
229
  """Alternative to json-ld but allows multiple serialization options"""
239
230
  fmt = kwargs.pop("format", fmt)
231
+ if file_uri is None:
232
+ warnings.warn(
233
+ "Not providing a file-uri is not good practice because it will generate blank nodes. Consider providing an URI such as the DOI URL for example.",
234
+ category=UserWarning
235
+ )
240
236
  with File(hdf_filename) as h5:
241
237
  return h5.serialize(fmt=fmt,
242
238
  skipND=skipND,
@@ -257,7 +253,7 @@ def build_pyvis_graph(hdf_filename, output_filename="kg-graph.html", notebook=Fa
257
253
  kg = kglab.KnowledgeGraph().load_rdf_text(
258
254
  serialize(hdf_filename, fmt="ttl", structural=structural, contextual=contextual)
259
255
  )
260
- VIS_STYLE = style or {
256
+ vis_style = style or {
261
257
  "hdf": {
262
258
  "color": "orange",
263
259
  "size": 40,
@@ -268,7 +264,7 @@ def build_pyvis_graph(hdf_filename, output_filename="kg-graph.html", notebook=Fa
268
264
  },
269
265
  }
270
266
  subgraph = kglab.SubgraphTensor(kg)
271
- pyvis_graph = subgraph.build_pyvis_graph(notebook=notebook, style=VIS_STYLE)
267
+ pyvis_graph = subgraph.build_pyvis_graph(notebook=notebook, style=vis_style)
272
268
  pyvis_graph.force_atlas_2based()
273
269
  pyvis_graph.show(output_filename)
274
270
  return pyvis_graph
@@ -300,7 +296,7 @@ def register_dataset_decoder(decoder: Callable, decoder_name: str = None, overwr
300
296
  ds_decoder.registered_dataset_decoders[decoder_name] = decoder
301
297
 
302
298
 
303
- atexit_verbose = False
299
+ _ATEXIT_VERBOSE = False
304
300
 
305
301
 
306
302
  def set_loglevel(level: Union[int, str]):
@@ -329,18 +325,18 @@ def clean_temp_data(full: bool = False):
329
325
  return
330
326
 
331
327
  for _tmp_session_dir in [UserDir['tmp'], ]:
332
- if atexit_verbose:
328
+ if _ATEXIT_VERBOSE:
333
329
  print(f'cleaning up tmp directory "{_tmp_session_dir}"')
334
330
  if _tmp_session_dir.exists():
335
331
  try:
336
- if atexit_verbose:
332
+ if _ATEXIT_VERBOSE:
337
333
  print(f'try deleting tmp in session dir: {_tmp_session_dir}')
338
334
  shutil.rmtree(_tmp_session_dir)
339
335
  except PermissionError as e:
340
- if atexit_verbose:
336
+ if _ATEXIT_VERBOSE:
341
337
  print(f'[!] failed deleting tmp session dir: {_tmp_session_dir}')
342
338
  failed_dirs.append(UserDir['tmp'])
343
- if atexit_verbose:
339
+ if _ATEXIT_VERBOSE:
344
340
  print(f'removing tmp folder "{_tmp_session_dir}" failed due to "{e}". Best is you '
345
341
  f'manually delete the directory.')
346
342
  finally:
@@ -372,4 +368,5 @@ __all__ = ('__version__', '__author__', '__author_orcid__',
372
368
  'File', 'Group', 'Dataset', 'Attribute',
373
369
  'dump', 'dumps', 'cv_h5py', 'lower', 'Lower',
374
370
  'set_config', 'get_config', 'get_ureg',
375
- 'Convention', 'jsonld', 'lazy', 'DownloadFileManager')
371
+ 'Convention', 'jsonld', 'lazy', 'DownloadFileManager',
372
+ 'clean_temp_data')
@@ -28,7 +28,7 @@ CONFIG = {
28
28
  'require_unit': True, # datasets require units
29
29
  'ureg_format': 'C~',
30
30
  'init_logger_level': 'ERROR',
31
- 'dtime_fmt': '%Y%m%d%H%M%S%f',
31
+ 'dtime_fmt': '%Y-%m-%dT%H:%M:%S%f',
32
32
  'expose_user_prop_to_attrs': True,
33
33
  'add_provenance': False,
34
34
  'ignore_set_std_attr_err': False,
@@ -73,7 +73,7 @@ class set_config:
73
73
  raise KeyError(f'Not a configuration key: "{k}"')
74
74
  self.old[k] = CONFIG[k]
75
75
  if k == 'ureg_format':
76
- get_ureg().default_format = str(v)
76
+ get_ureg().formatter.default_format = str(v)
77
77
  self._update(kwargs)
78
78
 
79
79
  def __enter__(self):
@@ -13,6 +13,8 @@ import yaml
13
13
  from pydoc import locate
14
14
  from typing import Union, List, Dict, Tuple, Any
15
15
 
16
+ from forge import kwargs
17
+
16
18
  from h5rdmtoolbox import errors
17
19
  from h5rdmtoolbox.repository import RepositoryInterface
18
20
  from h5rdmtoolbox.wrapper import ds_decoder
@@ -696,24 +698,19 @@ def from_json(filename: Union[str, pathlib.Path], overwrite: bool = False) -> Co
696
698
 
697
699
 
698
700
  def from_repo(repo_interface: RepositoryInterface,
699
- name: str,
700
- take_existing: bool = True,
701
- force_download: bool = False):
702
- """Download a YAML file from a repository"""
703
- # check if file exists:
704
- # path_compatible_doi = repo_interface.get_doi().replace('/', '_')
705
- # estimated_filename = UserDir['cache'] / f'{path_compatible_doi}' / name
706
- # estimated_filename.parent.mkdir(parents=True, exist_ok=True)
707
- # if estimated_filename.exists():
708
- # if not take_existing:
709
- # raise FileExistsError(f'File {name} exists in cache but take_existing is set to False.')
710
- # if take_existing and not force_download:
711
- # return from_file(estimated_filename)
701
+ name: str):
702
+ """Download a YAML file from a repository
712
703
 
704
+ Parameters
705
+ ----------
706
+ repo_interface: RepositoryInterface
707
+ The repository interface to use for downloading the file
708
+ name: str
709
+ Name of the file to download
710
+ """
711
+ logger.debug(f"Downloading file {name} from repository {repo_interface}")
713
712
  filename = repo_interface.download_file(name)
714
- # if estimated_filename.exists():
715
- # estimated_filename.unlink()
716
- # filename.rename(estimated_filename)
713
+ logger.debug(f"File downloaded to {filename}. Now loading convention from file.")
717
714
  return from_file(filename)
718
715
 
719
716
 
@@ -723,7 +720,7 @@ def from_zenodo(doi_or_recid: str,
723
720
  force_download: bool = False) -> Convention:
724
721
  """Download a YAML file from a zenodo repository
725
722
 
726
- Depreciated. Use `from_repo` in future.
723
+ Depreciated. Use `from_repo` in the future.
727
724
 
728
725
  Parameters
729
726
  ----------
@@ -97,8 +97,8 @@ def get_similar_names_ratio(a, b):
97
97
  # def equal_base_units(unit1, unit2):
98
98
  # """Return if two units are equivalent"""
99
99
  #
100
- # base_unit1 = get_ureg()(unit1).to_base_units().units.__format__(get_ureg().default_format)
101
- # base_unit2 = get_ureg()(unit2).to_base_units().units.__format__(get_ureg().default_format)
100
+ # base_unit1 = get_ureg()(unit1).to_base_units().units.__format__(get_ureg().formatter.default_format)
101
+ # base_unit2 = get_ureg()(unit2).to_base_units().units.__format__(get_ureg().formatter.default_format)
102
102
  # return base_unit1 == base_unit2
103
103
 
104
104
 
@@ -36,7 +36,7 @@ standard_name:
36
36
  standard_name_table:
37
37
  target_method: __init__
38
38
  validator: $standardNameTableType
39
- default_value: https://zenodo.org/records/15300151/files/fan_standard_name_table.jsonld
39
+ default_value: https://zenodo.org/records/17331305/files/fan_standard_name_table.jsonld
40
40
  requirements:
41
41
  - standard_name
42
42
  - units
@@ -10,8 +10,8 @@
10
10
  },
11
11
  "@type": "ssno:StandardNameTable",
12
12
  "dcterms:title": "fan_standard_name_shorttable",
13
- "dcterms:hasVersion": "v5.0.0",
14
- "identifier": "10.5281/zenodo.15300151",
13
+ "schema:version": "5.0.0",
14
+ "identifier": "10.5281/zenodo.17331305",
15
15
  "dcterms:modified": "2023-07-18 09:05:38.112885+00:00",
16
16
  "ssno:standardNames": [
17
17
  {
@@ -386,5 +386,5 @@
386
386
  "@id": "_:N3354c7311dee428391ae501b6ebc8bba"
387
387
  }
388
388
  ],
389
- "@id": "https://doi.org/10.5281/zenodo.15300151"
389
+ "@id": "https://doi.org/10.5281/zenodo.17331305"
390
390
  }
@@ -16,7 +16,7 @@ class ToUnitsInterface:
16
16
  self.coord_units = coord_units
17
17
 
18
18
  def _convert_units(self, data: xr.DataArray):
19
- assert isinstance(data, xr.DataArray)
19
+ assert isinstance(data, xr.DataArray), 'Data is not an xarray DataArray'
20
20
  assert 'units' in data.attrs, 'No units attribute found in the dataset'
21
21
  for c, cn in self.coord_units.items():
22
22
  assert 'units' in data.coords[c].attrs, f'No units attribute found in the coordinate {c}'
@@ -42,4 +42,7 @@ class ToUnitsAccessor(Accessor):
42
42
  """Accessor to await selected data to be converted to a new units"""
43
43
 
44
44
  def __call__(self, dataset_unit: Optional[str] = None, **coord_units) -> ToUnitsInterface:
45
+ if isinstance(dataset_unit, dict): # fix for pint-xarray > 0.4.0
46
+ coord_units = dataset_unit
47
+ dataset_unit = None
45
48
  return ToUnitsInterface(self._obj, dataset_unit=dataset_unit, **coord_units)
@@ -1,5 +1,4 @@
1
1
  import pathlib
2
- import warnings
3
2
  from typing import Union, Optional, Dict
4
3
 
5
4
  import h5py
@@ -18,7 +17,8 @@ def get_ld(
18
17
  skipND: Optional[int] = 1,
19
18
  context: Optional[Dict] = None) -> rdflib.Graph:
20
19
  """Return the HDF file content as a rdflib.Graph object."""
21
-
20
+ if file_uri and not (str(file_uri)).endswith("#"):
21
+ file_uri = f"{file_uri}#"
22
22
  graph = None
23
23
  with h5py.File(hdf_filename) as h5:
24
24
  if contextual and structural:
@@ -50,8 +50,61 @@ def hdf2jsonld(
50
50
  file_uri: Optional[str] = None,
51
51
  skipND: Optional[int] = 1,
52
52
  ):
53
+ return _hdf2ld(
54
+ filename=filename,
55
+ fmt='json-ld',
56
+ metadata_filename=metadata_filename,
57
+ context=context,
58
+ structural=structural,
59
+ contextual=contextual,
60
+ indent=indent,
61
+ file_uri=file_uri,
62
+ skipND=skipND,
63
+ )
64
+
65
+
66
+ def hdf2ttl(
67
+ filename: Union[str, pathlib.Path],
68
+ metadata_filename: Optional[Union[str, pathlib.Path]] = None,
69
+ context: Optional[dict] = None,
70
+ structural: bool = True,
71
+ contextual: bool = True,
72
+ indent: int = 2,
73
+ file_uri: Optional[str] = None,
74
+ skipND: Optional[int] = 1,
75
+ ):
76
+ return _hdf2ld(
77
+ filename=filename,
78
+ fmt='ttl',
79
+ metadata_filename=metadata_filename,
80
+ context=context,
81
+ structural=structural,
82
+ contextual=contextual,
83
+ indent=indent,
84
+ file_uri=file_uri,
85
+ skipND=skipND,
86
+ )
87
+
88
+
89
+ def _hdf2ld(
90
+ filename: Union[str, pathlib.Path],
91
+ fmt: str,
92
+ metadata_filename: Optional[Union[str, pathlib.Path]] = None,
93
+ context: Optional[dict] = None,
94
+ structural: bool = True,
95
+ contextual: bool = True,
96
+ indent: int = 2,
97
+ file_uri: Optional[str] = None,
98
+ skipND: Optional[int] = 1,
99
+ ):
100
+ if fmt in ('json', 'json-ld', 'jsonld'):
101
+ suffix = '.jsonld'
102
+ elif fmt in ('turtle', 'ttl'):
103
+ suffix = '.ttl'
104
+ else:
105
+ raise ValueError(f"Format '{fmt}' currently not supported. Use 'json-ld' or 'ttl'.")
53
106
  if metadata_filename is None:
54
- metadata_filename = pathlib.Path(filename).with_suffix('.jsonld') # recommended suffix for JSON-LD is .jsonld!
107
+ metadata_filename = pathlib.Path(filename).with_suffix(suffix) # recommended suffix for JSON-LD is .jsonld!
55
108
  else:
56
109
  metadata_filename = pathlib.Path(metadata_filename)
57
110
 
@@ -67,7 +120,7 @@ def hdf2jsonld(
67
120
 
68
121
  with open(metadata_filename, 'w', encoding='utf-8') as f:
69
122
  f.write(
70
- graph.serialize(format='json-ld',
123
+ graph.serialize(format=fmt,
71
124
  indent=indent,
72
125
  auto_compact=True,
73
126
  context=context)
@@ -1,13 +1,14 @@
1
- import rdflib
1
+ from dateutil import parser
2
2
  from ontolutils.namespacelib.hdf5 import HDF5
3
- from rdflib import Namespace, Literal
4
- from rdflib import XSD, RDF
3
+ from rdflib import Namespace, Literal, XSD, RDF
5
4
 
6
5
  from ..utils import get_attr_node
7
6
 
8
7
  HDF = Namespace(str(HDF5))
9
8
 
10
9
 
10
+
11
+
11
12
  def process_attribute(*, name, value, graph, parent, parent_uri, blank_node_iri_base):
12
13
  """Process an HDF5 attribute, adding it to the RDF graph."""
13
14
  if name.isupper() or name.startswith('@'):
@@ -20,7 +21,7 @@ def process_attribute(*, name, value, graph, parent, parent_uri, blank_node_iri_
20
21
 
21
22
  if isinstance(value, str):
22
23
  graph.add((attr_uri, RDF.type, HDF5.StringAttribute))
23
- graph.add((attr_uri, HDF.data, Literal(value, datatype=XSD.string)))
24
+ graph.add((attr_uri, HDF.data, Literal(value)))
24
25
  elif isinstance(value, int):
25
26
  graph.add((attr_uri, RDF.type, HDF5.IntegerAttribute))
26
27
  graph.add((attr_uri, HDF.data, Literal(value, datatype=XSD.integer)))
@@ -31,5 +32,5 @@ def process_attribute(*, name, value, graph, parent, parent_uri, blank_node_iri_
31
32
  graph.add((attr_uri, RDF.type, HDF5.Attribute))
32
33
  graph.add((attr_uri, HDF.data, Literal(value)))
33
34
 
34
- graph.add((attr_uri, HDF.name, rdflib.Literal(name)))
35
+ graph.add((attr_uri, HDF.name, Literal(name)))
35
36
  graph.add((parent_uri, HDF.attribute, attr_uri))
@@ -42,8 +42,7 @@ def add_filter(dataset: h5py.Dataset, dataset_uri, graph, blank_node_iri_base) -
42
42
  graph.add((filter_uri, RDF.type, HDF5.Filter))
43
43
  graph.add((filter_uri, RDFS.label, rdflib.Literal(dataset.compression, datatype=XSD.integer)))
44
44
  graph.add((filter_uri, RDFS.comment,
45
- rdflib.Literal("Unknown compression filter. Could not determine class nor parameters.",
46
- datatype=XSD.string)))
45
+ rdflib.Literal("Unknown compression filter. Could not determine class nor parameters.")))
47
46
  graph.add((dataset_uri, HDF5.filter, filter_uri))
48
47
  return graph
49
48
 
@@ -63,7 +62,7 @@ def process_dataset(
63
62
 
64
63
  graph.add((parent_uri, HDF.member, dataset_uri))
65
64
 
66
- graph.add((dataset_uri, HDF5.name, rdflib.Literal(dataset.name)))
65
+ graph.add((dataset_uri, HDF5.name, rdflib.Literal(dataset.name))) # untyped simple literals are xsd:string by default, no need to specify
67
66
  graph.add((dataset_uri, HDF5.rank, rdflib.Literal(dataset.ndim, datatype=XSD.integer)))
68
67
  graph.add((dataset_uri, HDF5.size, rdflib.Literal(dataset.size, datatype=XSD.integer)))
69
68
 
@@ -34,10 +34,10 @@ def get_ld(source: Union[str, h5py.File],
34
34
 
35
35
  graph.add((_file_uri, RDF.type, HDF.File))
36
36
 
37
- root_group_uri = get_obj_bnode(source["/"], blank_node_iri_base=file_uri)
37
+ root_group_uri = get_obj_bnode(obj=source["/"], blank_node_iri_base=file_uri)
38
38
  graph.add((_file_uri, HDF5.rootGroup, root_group_uri))
39
39
 
40
- process_group(source["/"], graph, parent_uri=_file_uri, blank_node_iri_base=file_uri, skipND=skipND)
40
+ process_group(source["/"], graph, blank_node_iri_base=file_uri, skipND=skipND)
41
41
 
42
42
  return graph
43
43
 
@@ -49,6 +49,6 @@ def get_serialized_ld(
49
49
  context=None,
50
50
  skipND: int = 1
51
51
  ) -> str:
52
- graph = get_ld(source, blank_node_iri_base, skipND=skipND)
52
+ graph = get_ld(source=source, file_uri=blank_node_iri_base, skipND=skipND)
53
53
  context = optimize_context(graph, context)
54
54
  return graph.serialize(format=format, indent=2, auto_compact=True, context=context)