py-modelrunner 0.18.2__tar.gz → 0.18.3__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 (216) hide show
  1. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/.github/workflows/build.yml +2 -2
  2. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/.github/workflows/check_docs.yml +1 -1
  3. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/.github/workflows/coverage_report.yml +2 -2
  4. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/.github/workflows/release_pip.yml +2 -2
  5. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/PKG-INFO +2 -4
  6. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/README.md +0 -2
  7. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/docs/source/conf.py +3 -3
  8. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/docs/source/run_autodoc.py +7 -6
  9. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/docs/source/sphinx_simplify_typehints.py +18 -15
  10. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/examples/read_many.py +3 -3
  11. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/examples/submit_many_func.py +0 -1
  12. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/examples/submit_many_iter.py +0 -1
  13. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/_version.py +2 -2
  14. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/config.py +3 -3
  15. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/model/base.py +13 -4
  16. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/model/factory.py +1 -1
  17. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/model/parameters.py +10 -7
  18. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/run/compatibility/triage.py +2 -2
  19. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/run/compatibility/version0.py +2 -2
  20. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/run/compatibility/version1.py +4 -6
  21. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/run/job.py +3 -3
  22. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/run/launch.py +3 -2
  23. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/run/results.py +17 -13
  24. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/storage/__init__.py +1 -1
  25. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/storage/access_modes.py +3 -7
  26. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/storage/backend/__init__.py +3 -1
  27. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/storage/backend/hdf.py +10 -8
  28. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/storage/backend/memory.py +4 -4
  29. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/storage/backend/text_base.py +13 -12
  30. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/storage/backend/yaml.py +4 -4
  31. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/storage/backend/zarr.py +10 -11
  32. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/storage/base.py +31 -9
  33. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/storage/group.py +10 -11
  34. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/storage/tools.py +1 -1
  35. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/storage/trajectory.py +4 -6
  36. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/storage/utils.py +8 -6
  37. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/utils.py +3 -4
  38. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/py_modelrunner.egg-info/PKG-INFO +2 -4
  39. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/py_modelrunner.egg-info/requires.txt +1 -1
  40. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/pyproject.toml +37 -1
  41. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/requirements_full.txt +1 -1
  42. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/scripts/create_compatibility_files.py +5 -5
  43. py_modelrunner-0.18.3/scripts/format_code.sh +11 -0
  44. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/scripts/run_tests.py +5 -5
  45. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/test_compatibility.py +1 -1
  46. py_modelrunner-0.18.3/tests/conftest.py +4 -0
  47. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/helpers/storage.py +3 -1
  48. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/model/test_model.py +3 -1
  49. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/model/test_parameters.py +1 -1
  50. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/requirements.txt +1 -3
  51. py_modelrunner-0.18.3/tests/run/scripts/function.py +5 -0
  52. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/run/test_job.py +2 -2
  53. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/run/test_results.py +13 -1
  54. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/run/test_run_main.py +2 -2
  55. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/storage/test_register_action.py +19 -11
  56. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/storage/test_storage_generic.py +8 -3
  57. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/storage/test_storage_special.py +2 -2
  58. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/storage/test_trajectory.py +8 -12
  59. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/test_config.py +2 -2
  60. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/test_examples.py +2 -2
  61. py_modelrunner-0.18.2/scripts/format_code.sh +0 -16
  62. py_modelrunner-0.18.2/tests/conftest.py +0 -4
  63. py_modelrunner-0.18.2/tests/run/scripts/function.py +0 -3
  64. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/.gitignore +0 -0
  65. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/.readthedocs.yaml +0 -0
  66. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/LICENSE +0 -0
  67. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/docs/Makefile +0 -0
  68. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/docs/build_all.sh +0 -0
  69. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/docs/requirements.txt +0 -0
  70. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/docs/source/.gitignore +0 -0
  71. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/docs/source/examples.rst +0 -0
  72. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/docs/source/index.rst +0 -0
  73. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/docs/source/installation.rst +0 -0
  74. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/docs/source/parse_examples.py +0 -0
  75. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/docs/source/user_manual.rst +0 -0
  76. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/examples/io_hdf.py +0 -0
  77. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/examples/io_json.py +0 -0
  78. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/examples/io_yaml.py +0 -0
  79. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/examples/model_class.py +0 -0
  80. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/examples/model_decorator.py +0 -0
  81. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/examples/model_function.py +0 -0
  82. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/examples/model_storage_output.py +0 -0
  83. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/examples/script_custom_func.py +0 -0
  84. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/examples/script_function.py +0 -0
  85. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/examples/script_many_classes.py +0 -0
  86. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/examples/script_minimal.py +0 -0
  87. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/examples/script_model_class.py +0 -0
  88. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/examples/submit_function.py +0 -0
  89. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/examples/submit_shebang.py +0 -0
  90. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/.gitignore +0 -0
  91. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/__init__.py +0 -0
  92. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/__main__.py +0 -0
  93. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/model/__init__.py +0 -0
  94. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/py.typed +0 -0
  95. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/run/__init__.py +0 -0
  96. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/run/__main__.py +0 -0
  97. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/run/compatibility/__init__.py +0 -0
  98. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/run/compatibility/version2.py +0 -0
  99. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/run/templates/background.jinja +0 -0
  100. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/run/templates/foreground.jinja +0 -0
  101. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/run/templates/qsub.jinja +0 -0
  102. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/run/templates/srun.jinja +0 -0
  103. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/storage/attributes.py +0 -0
  104. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/storage/backend/json.py +0 -0
  105. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/modelrunner/storage/backend/utils.py +0 -0
  106. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/py_modelrunner.egg-info/SOURCES.txt +0 -0
  107. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/py_modelrunner.egg-info/dependency_links.txt +0 -0
  108. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/py_modelrunner.egg-info/not-zip-safe +0 -0
  109. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/py_modelrunner.egg-info/top_level.txt +0 -0
  110. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/requirements.txt +0 -0
  111. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/scripts/performance_hdf5_zarr.py +0 -0
  112. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/scripts/tests_all.sh +0 -0
  113. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/scripts/tests_codestyle.sh +0 -0
  114. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/scripts/tests_coverage.sh +0 -0
  115. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/scripts/tests_debug.sh +0 -0
  116. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/scripts/tests_parallel.sh +0 -0
  117. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/scripts/tests_run.sh +0 -0
  118. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/scripts/tests_types.sh +0 -0
  119. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/setup.cfg +0 -0
  120. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/0/result.hdf +0 -0
  121. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/0/result.json +0 -0
  122. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/0/result.pkl +0 -0
  123. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/0/result.yaml +0 -0
  124. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/1/array.json +0 -0
  125. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/1/array.pkl +0 -0
  126. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/1/array.yaml +0 -0
  127. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/1/array.zarr +0 -0
  128. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/1/array_col.json +0 -0
  129. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/1/array_col.pkl +0 -0
  130. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/1/array_col.yaml +0 -0
  131. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/1/array_col.zarr +0 -0
  132. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/1/dict.json +0 -0
  133. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/1/dict.pkl +0 -0
  134. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/1/dict.yaml +0 -0
  135. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/1/dict.zarr +0 -0
  136. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/1/object.json +0 -0
  137. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/1/object.pkl +0 -0
  138. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/1/object.yaml +0 -0
  139. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/1/object.zarr +0 -0
  140. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/2/array.hdf +0 -0
  141. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/2/array.json +0 -0
  142. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/2/array.pkl +0 -0
  143. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/2/array.yaml +0 -0
  144. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/2/array.zip +0 -0
  145. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/2/array_col.hdf +0 -0
  146. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/2/array_col.json +0 -0
  147. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/2/array_col.pkl +0 -0
  148. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/2/array_col.yaml +0 -0
  149. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/2/array_col.zip +0 -0
  150. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/2/dict.hdf +0 -0
  151. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/2/dict.json +0 -0
  152. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/2/dict.pkl +0 -0
  153. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/2/dict.yaml +0 -0
  154. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/2/dict.zip +0 -0
  155. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/2/nested.hdf +0 -0
  156. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/2/nested.json +0 -0
  157. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/2/nested.pkl +0 -0
  158. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/2/nested.yaml +0 -0
  159. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/2/nested.zip +0 -0
  160. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/array.hdf +0 -0
  161. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/array.json +0 -0
  162. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/array.pkl +0 -0
  163. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/array.yaml +0 -0
  164. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/array.zip +0 -0
  165. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/array_col.hdf +0 -0
  166. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/array_col.json +0 -0
  167. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/array_col.pkl +0 -0
  168. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/array_col.yaml +0 -0
  169. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/array_col.zip +0 -0
  170. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/dict.hdf +0 -0
  171. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/dict.json +0 -0
  172. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/dict.pkl +0 -0
  173. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/dict.yaml +0 -0
  174. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/dict.zip +0 -0
  175. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/model_array.hdf +0 -0
  176. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/model_array.json +0 -0
  177. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/model_array.pkl +0 -0
  178. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/model_array.yaml +0 -0
  179. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/model_array.zip +0 -0
  180. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/model_array_col.hdf +0 -0
  181. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/model_array_col.json +0 -0
  182. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/model_array_col.pkl +0 -0
  183. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/model_array_col.yaml +0 -0
  184. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/model_array_col.zip +0 -0
  185. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/model_dict.hdf +0 -0
  186. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/model_dict.json +0 -0
  187. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/model_dict.pkl +0 -0
  188. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/model_dict.yaml +0 -0
  189. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/model_dict.zip +0 -0
  190. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/model_nested.hdf +0 -0
  191. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/model_nested.json +0 -0
  192. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/model_nested.pkl +0 -0
  193. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/model_nested.yaml +0 -0
  194. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/model_nested.zip +0 -0
  195. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/nested.hdf +0 -0
  196. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/nested.json +0 -0
  197. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/nested.pkl +0 -0
  198. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/nested.yaml +0 -0
  199. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/compatibility/3/nested.zip +0 -0
  200. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/helpers/__init__.py +0 -0
  201. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/helpers/asserts.py +0 -0
  202. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/model/scripts/empty.py +0 -0
  203. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/model/scripts/function.py +0 -0
  204. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/model/scripts/function_main.py +0 -0
  205. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/model/scripts/function_marked.py +0 -0
  206. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/model/scripts/make_model.py +0 -0
  207. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/model/scripts/make_model_class.py +0 -0
  208. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/model/scripts/make_model_marked.py +0 -0
  209. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/run/scripts/custom.jinja +0 -0
  210. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/run/scripts/fail.py +0 -0
  211. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/run/scripts/print.py +0 -0
  212. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/run/scripts/script.py +0 -0
  213. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/storage/test_group.py +0 -0
  214. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/storage/test_utils.py +0 -0
  215. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/test_main.py +0 -0
  216. {py_modelrunner-0.18.2 → py_modelrunner-0.18.3}/tests/test_version.py +0 -0
@@ -12,10 +12,10 @@ jobs:
12
12
  python-version: ['3.8', '3.12']
13
13
 
14
14
  steps:
15
- - uses: actions/checkout@v3
15
+ - uses: actions/checkout@v4
16
16
 
17
17
  - name: Set up Python ${{ matrix.python-version }}
18
- uses: actions/setup-python@v4
18
+ uses: actions/setup-python@v5
19
19
  with:
20
20
  python-version: ${{ matrix.python-version }}
21
21
 
@@ -6,7 +6,7 @@ jobs:
6
6
  docs:
7
7
  runs-on: ubuntu-latest
8
8
  steps:
9
- - uses: actions/checkout@v3
9
+ - uses: actions/checkout@v4
10
10
  - uses: ammaraskar/sphinx-action@master
11
11
  with:
12
12
  docs-folder: "docs/"
@@ -11,9 +11,9 @@ jobs:
11
11
  python-version: [3.8]
12
12
 
13
13
  steps:
14
- - uses: actions/checkout@v3
14
+ - uses: actions/checkout@v4
15
15
  - name: Set up Python ${{ matrix.python-version }}
16
- uses: actions/setup-python@v4
16
+ uses: actions/setup-python@v5
17
17
  with:
18
18
  python-version: ${{ matrix.python-version }}
19
19
  - name: Install dependencies
@@ -9,10 +9,10 @@ jobs:
9
9
  runs-on: ubuntu-latest
10
10
 
11
11
  steps:
12
- - uses: actions/checkout@v3
12
+ - uses: actions/checkout@v4
13
13
 
14
14
  - name: Set up Python
15
- uses: actions/setup-python@v4
15
+ uses: actions/setup-python@v5
16
16
  with:
17
17
  python-version: '3.8'
18
18
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: py-modelrunner
3
- Version: 0.18.2
3
+ Version: 0.18.3
4
4
  Summary: Python classes for organizing (HPC) simulations
5
5
  Author-email: David Zwicker <david.zwicker@ds.mpg.de>
6
6
  License: MIT
@@ -30,7 +30,7 @@ Provides-Extra: all
30
30
  Requires-Dist: h5py>=3.5; extra == "all"
31
31
  Requires-Dist: pandas>=1.3; extra == "all"
32
32
  Requires-Dist: PyYAML>=5; extra == "all"
33
- Requires-Dist: zarr>=2; extra == "all"
33
+ Requires-Dist: zarr<3,>=2; extra == "all"
34
34
  Provides-Extra: test
35
35
  Requires-Dist: black>=19; extra == "test"
36
36
  Requires-Dist: isort>=5.1; extra == "test"
@@ -49,8 +49,6 @@ Requires-Dist: mypy>=0.770; extra == "test"
49
49
  [![Conda Version](https://img.shields.io/conda/vn/conda-forge/py-modelrunner.svg)](https://anaconda.org/conda-forge/py-modelrunner)
50
50
  [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
51
51
  [![codecov](https://codecov.io/gh/zwicker-group/py-modelrunner/branch/main/graph/badge.svg)](https://codecov.io/gh/zwicker-group/py-modelrunner)
52
- [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
53
-
54
52
 
55
53
 
56
54
  This package provides python classes for handling and running physical simulations.
@@ -7,8 +7,6 @@
7
7
  [![Conda Version](https://img.shields.io/conda/vn/conda-forge/py-modelrunner.svg)](https://anaconda.org/conda-forge/py-modelrunner)
8
8
  [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
9
9
  [![codecov](https://codecov.io/gh/zwicker-group/py-modelrunner/branch/main/graph/badge.svg)](https://codecov.io/gh/zwicker-group/py-modelrunner)
10
- [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
11
-
12
10
 
13
11
 
14
12
  This package provides python classes for handling and running physical simulations.
@@ -15,19 +15,19 @@
15
15
  import os.path
16
16
  import sys
17
17
 
18
- sys.path.insert(0, os.path.abspath("../.."))
18
+ sys.path.insert(0, os.path.abspath("../..")) # noqa: PTH100
19
19
  sys.path.insert(0, ".")
20
20
 
21
21
  from datetime import date
22
22
 
23
- import sphinx_simplify_typehints # @UnresolvedImport @UnusedImport
23
+ import sphinx_simplify_typehints
24
24
 
25
25
  # -- Project information -----------------------------------------------------
26
26
 
27
27
  project = "py-modelrunner"
28
28
  module_name = "modelrunner"
29
29
  author = "David Zwicker"
30
- copyright = f"{date.today().year}, {author}" # @ReservedAssignment
30
+ copyright = f"{date.today().year}, {author}" # noqa: A001
31
31
 
32
32
  # The short X.Y version
33
33
  import modelrunner
@@ -4,13 +4,14 @@ import glob
4
4
  import logging
5
5
  import os
6
6
  import subprocess as sp
7
+ from pathlib import Path
7
8
 
8
9
  logging.basicConfig(level=logging.INFO)
9
10
 
10
11
  OUTPUT_PATH = "packages"
11
12
 
12
13
 
13
- def replace_in_file(infile, replacements, outfile=None):
14
+ def replace_in_file(infile: Path, replacements, outfile=None):
14
15
  """Reads in a file, replaces the given data using python formatting and writes back
15
16
  the result to a file.
16
17
 
@@ -26,21 +27,21 @@ def replace_in_file(infile, replacements, outfile=None):
26
27
  if outfile is None:
27
28
  outfile = infile
28
29
 
29
- with open(infile) as fp:
30
+ with infile.open() as fp:
30
31
  content = fp.read()
31
32
 
32
33
  for key, value in replacements.items():
33
34
  content = content.replace(key, value)
34
35
 
35
- with open(outfile, "w") as fp:
36
+ with outfile.open("w") as fp:
36
37
  fp.write(content)
37
38
 
38
39
 
39
40
  def main(package="modelrunner"):
40
41
  # remove old files
41
- for path in glob.glob(f"{OUTPUT_PATH}/*.rst"):
42
+ for path in Path(OUTPUT_PATH).glob("*.rst"):
42
43
  logging.info("Remove file `%s`", path)
43
- os.remove(path)
44
+ path.unlink()
44
45
 
45
46
  # run sphinx-apidoc
46
47
  sp.check_call(
@@ -66,7 +67,7 @@ def main(package="modelrunner"):
66
67
  }
67
68
 
68
69
  # replace unwanted information
69
- for path in glob.glob(f"{OUTPUT_PATH}/*.rst"):
70
+ for path in Path(OUTPUT_PATH).glob("*.rst"):
70
71
  logging.info("Patch file `%s`", path)
71
72
  replace_in_file(path, REPLACEMENTS)
72
73
 
@@ -48,22 +48,25 @@ def sphinx_display_parameters(app, what, name, obj, options, lines):
48
48
 
49
49
  app.connect('autodoc-process-docstring', sphinx_display_parameters)
50
50
  """
51
- if what == "class" and issubclass(obj, Parameterized):
52
- if any(":param parameters:" in line for line in lines):
53
- # parse parameters
54
- parameters = obj.get_parameters(sort=False)
55
- if parameters:
56
- lines.append(".. admonition::")
57
- lines.append(f" Parameters of {obj.__name__}:")
58
- lines.append(" ")
59
- for p in parameters.values():
60
- lines.append(f" {p.name}")
61
- text = p.description.splitlines()
62
- text.append(f"(Default value: :code:`{p.default_value!r}`)")
63
- text = [" " + t for t in text]
64
- lines.extend(text)
65
- lines.append("")
51
+ if (
52
+ what == "class"
53
+ and issubclass(obj, Parameterized)
54
+ and any(":param parameters:" in line for line in lines)
55
+ ):
56
+ # parse parameters
57
+ parameters = obj.get_parameters(sort=False)
58
+ if parameters:
59
+ lines.append(".. admonition::")
60
+ lines.append(f" Parameters of {obj.__name__}:")
61
+ lines.append(" ")
62
+ for p in parameters.values():
63
+ lines.append(f" {p.name}")
64
+ text = p.description.splitlines()
65
+ text.append(f"(Default value: :code:`{p.default_value!r}`)")
66
+ text = [" " + t for t in text]
67
+ lines.extend(text)
66
68
  lines.append("")
69
+ lines.append("")
67
70
 
68
71
 
69
72
  def setup(app):
@@ -4,7 +4,7 @@
4
4
  .. codeauthor:: David Zwicker <david.zwicker@ds.mpg.de>
5
5
  """
6
6
 
7
- import os
7
+ from pathlib import Path
8
8
 
9
9
  from modelrunner import ResultCollection, make_model_class
10
10
 
@@ -19,11 +19,11 @@ if __name__ == "__main__":
19
19
  model = make_model_class(multiply)
20
20
 
21
21
  # write data
22
- os.makedirs("data")
22
+ Path("data").mkdir(parents=True)
23
23
  for n, a in enumerate(range(5, 10)):
24
24
  result = model({"a": a}).get_result()
25
25
  result.to_file(f"data/test_{n}.json")
26
26
 
27
27
  # read data
28
28
  rc = ResultCollection.from_folder("data")
29
- print(rc.dataframe)
29
+ print(rc.as_dataframe())
@@ -8,7 +8,6 @@ argument by something more suitable; see the documentation.
8
8
  .. codeauthor:: David Zwicker <david.zwicker@ds.mpg.de>
9
9
  """
10
10
 
11
-
12
11
  from modelrunner import make_model, submit_jobs
13
12
 
14
13
 
@@ -8,7 +8,6 @@ argument by something more suitable; see the documentation.
8
8
  .. codeauthor:: David Zwicker <david.zwicker@ds.mpg.de>
9
9
  """
10
10
 
11
-
12
11
  from modelrunner import make_model, submit_job
13
12
 
14
13
 
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.18.2'
16
- __version_tuple__ = version_tuple = (0, 18, 2)
15
+ __version__ = version = '0.18.3'
16
+ __version_tuple__ = version_tuple = (0, 18, 3)
@@ -69,14 +69,14 @@ class Config(collections.UserDict):
69
69
  """Load configuration from yaml file."""
70
70
  import yaml
71
71
 
72
- with open(path) as fp:
72
+ with Path(path).open() as fp:
73
73
  self.update(yaml.safe_load(fp))
74
74
 
75
75
  def save(self, path: str | Path):
76
76
  """Save configuration to yaml file."""
77
77
  import yaml
78
78
 
79
- with open(path, "w") as fp:
79
+ with Path(path).open("w") as fp:
80
80
  yaml.dump(self.to_dict(), fp)
81
81
 
82
82
  def __getitem__(self, key: str):
@@ -124,7 +124,7 @@ class Config(collections.UserDict):
124
124
  Returns:
125
125
  dict: A representation of the configuration in a normal :class:`dict`.
126
126
  """
127
- return {k: v for k, v in self.items()}
127
+ return dict(self.items())
128
128
 
129
129
  def __repr__(self) -> str:
130
130
  """Represent the configuration as a string."""
@@ -17,7 +17,10 @@ from ..utils import is_serial_or_mpi_root
17
17
  from .parameters import DeprecatedParameter, HideParameter, Parameterized
18
18
 
19
19
  if TYPE_CHECKING:
20
- from ..run.results import Result # @UnusedImport
20
+ from ..run.results import Result
21
+
22
+ _base_logger = logging.getLogger(__name__.rsplit(".", 1)[0])
23
+ """:class:`logging.Logger`: Base logger for models."""
21
24
 
22
25
 
23
26
  class ModelBase(Parameterized, metaclass=ABCMeta):
@@ -27,6 +30,7 @@ class ModelBase(Parameterized, metaclass=ABCMeta):
27
30
  """str: the name of the model"""
28
31
  description: str | None = None
29
32
  """str: a longer description of the model"""
33
+ _logger: logging.Logger # logger instance to output information
30
34
 
31
35
  def __init__(
32
36
  self,
@@ -63,7 +67,12 @@ class ModelBase(Parameterized, metaclass=ABCMeta):
63
67
  self.output = output # TODO: also allow already opened storages
64
68
  self.mode = mode
65
69
  self._storage: open_storage | None = None
66
- self._logger = logging.getLogger(self.__class__.__name__)
70
+
71
+ def __init_subclass__(cls, **kwargs):
72
+ """Initialize class-level attributes of subclasses."""
73
+ super().__init_subclass__(**kwargs)
74
+ # create logger for this specific field class
75
+ cls._logger = _base_logger.getChild(cls.__qualname__)
67
76
 
68
77
  @property
69
78
  def storage(self) -> StorageGroup:
@@ -97,7 +106,7 @@ class ModelBase(Parameterized, metaclass=ABCMeta):
97
106
  Returns:
98
107
  :class:`Result`: The result after the model is run
99
108
  """
100
- from ..run.results import Result # @Reimport
109
+ from ..run.results import Result
101
110
 
102
111
  if data is None:
103
112
  data = self()
@@ -112,7 +121,7 @@ class ModelBase(Parameterized, metaclass=ABCMeta):
112
121
  result:
113
122
  The result data. If omitted, the model is run to obtain results
114
123
  """
115
- from ..run.results import Result # @Reimport
124
+ from ..run.results import Result
116
125
 
117
126
  if self.output is None:
118
127
  raise RuntimeError("Output file needs to be specified")
@@ -14,7 +14,7 @@ from .base import ModelBase
14
14
  from .parameters import NoValue, Parameter
15
15
 
16
16
  if TYPE_CHECKING:
17
- from ..run.results import Result # @UnusedImport
17
+ from ..run.results import Result
18
18
 
19
19
  _DEFAULT_MODEL: Callable | ModelBase | None = None
20
20
  """Stores the default model that will be used automatically."""
@@ -26,6 +26,9 @@ import numpy as np
26
26
 
27
27
  from ..utils import hybridmethod, import_class
28
28
 
29
+ _logger = logging.getLogger(__name__)
30
+ """:class:`logging.Logger`: Logger instance."""
31
+
29
32
 
30
33
  class NoValueType:
31
34
  """Special value to indicate no value for a parameter."""
@@ -129,8 +132,10 @@ class Parameter:
129
132
  )
130
133
 
131
134
  if not valid_default:
132
- logging.warning(
133
- f"Default value `{self.name}` is not of type `{self.cls.__name__}`"
135
+ _logger.warning(
136
+ "Default value `%s` is not of type `%s`",
137
+ self.name,
138
+ self.cls.__name__,
134
139
  )
135
140
 
136
141
  def __getstate__(self):
@@ -254,8 +259,6 @@ class Parameter:
254
259
  class DeprecatedParameter(Parameter):
255
260
  """A parameter that can still be used normally but is deprecated."""
256
261
 
257
- pass
258
-
259
262
 
260
263
  class HideParameter:
261
264
  """A helper class that allows hiding parameters of the parent classes.
@@ -314,7 +317,7 @@ class Parameterized:
314
317
  parameters, include_deprecated=True, check_validity=strict
315
318
  )
316
319
 
317
- def __init_subclass__(cls, **kwargs) -> None: # @NoSelf
320
+ def __init_subclass__(cls, **kwargs) -> None:
318
321
  """Register all subclasses to reconstruct them later."""
319
322
  # normalize the parameters_default attribute to be a list of `Parameter`
320
323
  if hasattr(cls, "parameters_default") and isinstance(
@@ -470,7 +473,7 @@ class Parameterized:
470
473
  return result
471
474
 
472
475
  @classmethod
473
- def get_parameter_default(cls, name): # @NoSelf
476
+ def get_parameter_default(cls, name):
474
477
  """Return the default value for the parameter with `name`
475
478
 
476
479
  Args:
@@ -551,7 +554,7 @@ class Parameterized:
551
554
  yield template.format(**data)
552
555
 
553
556
  @hybridmethod
554
- def show_parameters( # @NoSelf
557
+ def show_parameters(
555
558
  cls,
556
559
  description: bool = False,
557
560
  sort: bool = False,
@@ -125,13 +125,13 @@ def _get_format_version(path: Path, label: str) -> int | None:
125
125
  # check for compatibility
126
126
  fmt = guess_format(path)
127
127
  if fmt == "json":
128
- with open(path) as fp:
128
+ with path.open() as fp:
129
129
  format_version = _find_version(json.load(fp), label)
130
130
 
131
131
  elif fmt == "yaml":
132
132
  import yaml
133
133
 
134
- with open(path) as fp:
134
+ with path.open() as fp:
135
135
  format_version = _find_version(yaml.safe_load(fp), label)
136
136
 
137
137
  elif fmt == "hdf":
@@ -79,14 +79,14 @@ def result_from_file_v0(path: Path, **kwargs) -> Result:
79
79
  """
80
80
  fmt = guess_format(path)
81
81
  if fmt == "json":
82
- with open(path) as fp:
82
+ with path.open() as fp:
83
83
  content = json.load(fp)
84
84
  return _Result_from_simple_objects(content, **kwargs)
85
85
 
86
86
  elif fmt == "yaml":
87
87
  import yaml
88
88
 
89
- with open(path) as fp:
89
+ with path.open() as fp:
90
90
  content = yaml.safe_load(fp)
91
91
  return _Result_from_simple_objects(content, **kwargs)
92
92
 
@@ -26,13 +26,11 @@ if TYPE_CHECKING:
26
26
  class NoData:
27
27
  """Helper class that marks data omission."""
28
28
 
29
- ...
30
-
31
29
 
32
30
  TState = TypeVar("TState", bound="StateBase")
33
31
 
34
32
 
35
- class StateBase(metaclass=ABCMeta):
33
+ class StateBase:
36
34
  """Base class for specifying the state of a simulation.
37
35
 
38
36
  A state contains values of all degrees of freedom of a physical system (called the
@@ -224,19 +222,19 @@ def result_from_file_v1(store: Path, *, label: str = "data", **kwargs) -> Result
224
222
  """
225
223
  fmt = guess_format(store)
226
224
  if fmt == "json":
227
- with open(store) as fp:
225
+ with store.open() as fp:
228
226
  content = json.load(fp)
229
227
  return _Result_from_simple_objects(content, **kwargs)
230
228
 
231
229
  elif fmt == "yaml":
232
230
  import yaml
233
231
 
234
- with open(store) as fp:
232
+ with store.open() as fp:
235
233
  content = yaml.safe_load(fp)
236
234
  return _Result_from_simple_objects(content, **kwargs)
237
235
 
238
236
  elif fmt == "zarr":
239
- import zarr # @Reimport
237
+ import zarr
240
238
 
241
239
  zarr_store = normalize_zarr_store(store, mode="r")
242
240
  root = zarr.open_group(zarr_store, mode="r")
@@ -28,12 +28,12 @@ def escape_string(obj) -> str:
28
28
  return shlex.quote(str(obj))
29
29
 
30
30
 
31
- def ensure_directory_exists(folder):
31
+ def ensure_directory_exists(folder: str | Path) -> None:
32
32
  """Creates a folder if it not already exists."""
33
33
  if folder == "":
34
34
  return
35
35
  try:
36
- os.makedirs(folder)
36
+ Path(folder).mkdir(parents=True)
37
37
  except OSError as err:
38
38
  if err.errno != errno.EEXIST:
39
39
  raise
@@ -199,7 +199,7 @@ def submit_job(
199
199
  else:
200
200
  template_path = Path(template)
201
201
  logger.info("Load template `%s`", template_path)
202
- with open(template_path) as fp:
202
+ with template_path.open() as fp:
203
203
  script_template = fp.read()
204
204
 
205
205
  # prepare submission script
@@ -9,6 +9,7 @@ import importlib.util
9
9
  import inspect
10
10
  import logging
11
11
  import os.path
12
+ from pathlib import Path
12
13
  from typing import Callable, Sequence
13
14
 
14
15
  from ..model import ModelBase, cleared_default_model, factory, make_model_class
@@ -35,7 +36,7 @@ def run_function_with_cmd_args(
35
36
 
36
37
 
37
38
  @cleared_default_model
38
- def run_script(script_path: str, model_args: Sequence[str]) -> Result:
39
+ def run_script(script_path: str | Path, model_args: Sequence[str]) -> Result:
39
40
  """Helper function that runs a model script.
40
41
 
41
42
  The function detects models automatically by trying several methods until one yields
@@ -59,7 +60,7 @@ def run_script(script_path: str, model_args: Sequence[str]) -> Result:
59
60
  logger = logging.getLogger("modelrunner")
60
61
 
61
62
  # load the script as a module
62
- filename = os.path.basename(script_path)
63
+ filename = Path(script_path).name
63
64
  spec = importlib.util.spec_from_file_location("model_code", script_path)
64
65
  if spec is None:
65
66
  raise OSError(f"Could not find job script `{script_path}`")
@@ -11,7 +11,7 @@ import itertools
11
11
  import logging
12
12
  import warnings
13
13
  from pathlib import Path
14
- from typing import Any, Iterator, List
14
+ from typing import Any, Collection, Iterator, List
15
15
 
16
16
  import numpy as np
17
17
  from tqdm.auto import tqdm
@@ -276,11 +276,11 @@ class ResultCollection(List[Result]):
276
276
  progress (bool):
277
277
  Flag indicating whether a progress bar is shown
278
278
  """
279
- logger = logging.getLogger(cls.__name__)
279
+ logger = logging.getLogger("modelrunner." + cls.__name__)
280
280
 
281
281
  folder = Path(folder)
282
282
  if not folder.is_dir():
283
- logger.warning(f"{folder} is not a directory")
283
+ logger.warning("%s is not a directory", folder)
284
284
 
285
285
  # iterate over all files and load them as a Result
286
286
  results = []
@@ -293,7 +293,7 @@ class ResultCollection(List[Result]):
293
293
  err.args = (str(err) + f"\nError reading file `{path}`",)
294
294
  raise
295
295
  else:
296
- logger.warning(f"Error reading file `{path}`")
296
+ logger.warning("Error reading file `%s`", path)
297
297
  else:
298
298
  results.append(result)
299
299
 
@@ -303,7 +303,7 @@ class ResultCollection(List[Result]):
303
303
  logger.warning("Did not find any files")
304
304
  else:
305
305
  logger.warning(
306
- f"Did not find any files. Is pattern `{pattern}` too restrictive?"
306
+ "Did not find any files. Is pattern `%s` too restrictive?", pattern
307
307
  )
308
308
 
309
309
  return cls(results)
@@ -316,6 +316,7 @@ class ResultCollection(List[Result]):
316
316
  def __add__(self, other: ResultCollection) -> ResultCollection: # type: ignore
317
317
  if isinstance(other, ResultCollection):
318
318
  return ResultCollection(super().__add__(other))
319
+ return None
319
320
 
320
321
  @property
321
322
  def same_model(self) -> bool:
@@ -441,22 +442,21 @@ class ResultCollection(List[Result]):
441
442
  seen.append(result.parameters)
442
443
  return self.__class__(unique_results)
443
444
 
444
- @property
445
- def dataframe(self):
446
- """Create a pandas dataframe summarizing the data."""
447
- # deprecated on 2023-10-19
448
- warnings.warn("Property `dataframe` deprecated; use method `as_dataframe`")
449
- return self.as_dataframe()
450
-
451
- def as_dataframe(self, *, enforce_same_model: bool = True):
445
+ def as_dataframe(
446
+ self, *, enforce_same_model: bool = True, drop_keys: Collection | None = None
447
+ ):
452
448
  """Create a pandas dataframe summarizing the data.
453
449
 
454
450
  Args:
455
451
  enforce_same_model (bool):
456
452
  If True, forces all model results to derive from the same model
453
+ drop_keys (sequence):
454
+ A list of items that will not be included in the final data frame
457
455
  """
458
456
  import pandas as pd
459
457
 
458
+ drop_keys = set() if drop_keys is None else set(drop_keys)
459
+
460
460
  if enforce_same_model and not self.same_model:
461
461
  raise RuntimeError("Results are not from the same model")
462
462
 
@@ -476,10 +476,14 @@ class ResultCollection(List[Result]):
476
476
  df_data["result"] = data
477
477
  elif isinstance(data, dict):
478
478
  for key, value in data.items():
479
+ if key in drop_keys:
480
+ continue
479
481
  if np.isscalar(value):
480
482
  df_data[key] = value
481
483
  elif isinstance(value, (list, tuple, np.ndarray)):
482
484
  df_data[key] = np.asarray(value)
485
+ else:
486
+ df_data[key] = value
483
487
  else:
484
488
  raise RuntimeError("Do not know how to interpret result")
485
489
  return df_data
@@ -13,7 +13,7 @@
13
13
  from .access_modes import AccessError, ModeType
14
14
  from .attributes import Attrs
15
15
  from .backend import *
16
- from .base import StorageBase # @Reimport
16
+ from .base import StorageBase
17
17
  from .group import StorageGroup
18
18
  from .tools import StorageID, open_storage
19
19
  from .trajectory import Trajectory, TrajectoryWriter
@@ -29,9 +29,7 @@ class AccessMode:
29
29
  overwrite: bool = False # allow overwriting existing data
30
30
  dynamic_append: bool = False # allow appending to dynamic arrays
31
31
 
32
- _defined: ClassVar[dict[str, AccessMode]] = (
33
- {}
34
- ) # dictionary of all defined access modes
32
+ _defined: ClassVar[dict[str, AccessMode]] = {} # all defined access modes
35
33
 
36
34
  def __repr__(self):
37
35
  return f"AccessMode(name={self.name})"
@@ -60,10 +58,10 @@ class AccessMode:
60
58
  raise ValueError("Cannot use `closed` access mode.")
61
59
  try:
62
60
  return cls._defined[obj_or_name]
63
- except KeyError:
61
+ except KeyError as err:
64
62
  raise ValueError(
65
63
  f"Access mode '{obj_or_name}' not in {list(cls._defined.keys())}"
66
- )
64
+ ) from err
67
65
  else:
68
66
  raise TypeError(f"Unsupported type '{obj_or_name}'")
69
67
 
@@ -144,5 +142,3 @@ ModeType = Union[str, AccessMode]
144
142
 
145
143
  class AccessError(RuntimeError):
146
144
  """An error indicating that an access credential was not present."""
147
-
148
- ...