readcon-db 0.2.4__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. {readcon_db-0.2.4 → readcon_db-0.3.0}/.github/workflows/ci.yml +27 -0
  2. {readcon_db-0.2.4 → readcon_db-0.3.0}/CHANGELOG.md +30 -0
  3. {readcon_db-0.2.4 → readcon_db-0.3.0}/CITATION.cff +2 -2
  4. {readcon_db-0.2.4 → readcon_db-0.3.0}/Cargo.lock +9 -27
  5. {readcon_db-0.2.4 → readcon_db-0.3.0}/Cargo.toml +7 -10
  6. {readcon_db-0.2.4 → readcon_db-0.3.0}/PKG-INFO +13 -13
  7. {readcon_db-0.2.4 → readcon_db-0.3.0}/README.md +10 -11
  8. readcon_db-0.3.0/changelog.d/python-archive-reader.feature.md +1 -0
  9. readcon_db-0.3.0/changelog.d/python-readcon-dependency.feature.md +1 -0
  10. readcon_db-0.3.0/changelog.d/rkrdb-extend-trajectory-str.feature.md +1 -0
  11. readcon_db-0.3.0/changelog.d/trajectory-metadata.feature.md +1 -0
  12. readcon_db-0.3.0/changelog.d/v31-clock-units.bugfix.md +1 -0
  13. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/orgmode/explanation/architecture.org +1 -1
  14. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/orgmode/explanation/design.org +1 -1
  15. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/orgmode/howto/campaign.org +1 -1
  16. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/orgmode/howto/workflows.org +1 -1
  17. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/orgmode/reference/c.org +5 -3
  18. readcon_db-0.3.0/docs/orgmode/reference/python.org +138 -0
  19. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/orgmode/reference/rust.org +3 -1
  20. {readcon_db-0.2.4 → readcon_db-0.3.0}/fortran/ReadConDb/fpm.toml +1 -1
  21. {readcon_db-0.2.4 → readcon_db-0.3.0}/include/readcon-db.h +54 -11
  22. {readcon_db-0.2.4 → readcon_db-0.3.0}/pixi.toml +1 -1
  23. {readcon_db-0.2.4 → readcon_db-0.3.0}/pyproject.toml +5 -1
  24. {readcon_db-0.2.4 → readcon_db-0.3.0}/python/pyproject.toml +5 -1
  25. readcon_db-0.3.0/python/tests/test_archive_reader.py +321 -0
  26. {readcon_db-0.2.4 → readcon_db-0.3.0}/python/tests/test_export_h5md.py +10 -6
  27. readcon_db-0.3.0/python/tests/test_ingest_memory.py +840 -0
  28. readcon_db-0.3.0/python/tests/test_trajectory_metadata.py +47 -0
  29. {readcon_db-0.2.4 → readcon_db-0.3.0}/resources/test/con_v4/README.md +3 -2
  30. {readcon_db-0.2.4 → readcon_db-0.3.0}/scripts/check_version_lockstep.py +1 -1
  31. {readcon_db-0.2.4 → readcon_db-0.3.0}/src/canonical.rs +1 -1
  32. {readcon_db-0.2.4 → readcon_db-0.3.0}/src/catalog.rs +38 -24
  33. {readcon_db-0.2.4 → readcon_db-0.3.0}/src/cooked_soa.rs +6 -7
  34. {readcon_db-0.2.4 → readcon_db-0.3.0}/src/corpus.rs +140 -39
  35. {readcon_db-0.2.4 → readcon_db-0.3.0}/src/export_h5md.rs +212 -113
  36. {readcon_db-0.2.4 → readcon_db-0.3.0}/src/export_xyz.rs +3 -5
  37. {readcon_db-0.2.4 → readcon_db-0.3.0}/src/ffi.rs +279 -46
  38. {readcon_db-0.2.4 → readcon_db-0.3.0}/src/lib.rs +2 -5
  39. {readcon_db-0.2.4 → readcon_db-0.3.0}/src/python.rs +204 -41
  40. readcon_db-0.3.0/src/python_archive.rs +728 -0
  41. readcon_db-0.3.0/src/units_canon.rs +1019 -0
  42. readcon_db-0.3.0/tests/con_v4_fixtures.rs +108 -0
  43. readcon_db-0.2.4/docs/orgmode/reference/python.org +0 -87
  44. readcon_db-0.2.4/python/tests/test_ingest_memory.py +0 -51
  45. readcon_db-0.2.4/src/units_canon.rs +0 -498
  46. readcon_db-0.2.4/tests/con_v4_fixtures.rs +0 -64
  47. {readcon_db-0.2.4 → readcon_db-0.3.0}/.github/workflows/c_lib_tarball.yml +0 -0
  48. {readcon_db-0.2.4 → readcon_db-0.3.0}/.github/workflows/ci_cxx.yml +0 -0
  49. {readcon_db-0.2.4 → readcon_db-0.3.0}/.github/workflows/ci_docs.yml +0 -0
  50. {readcon_db-0.2.4 → readcon_db-0.3.0}/.github/workflows/ci_mpi.yml +0 -0
  51. {readcon_db-0.2.4 → readcon_db-0.3.0}/.github/workflows/ci_prek.yml +0 -0
  52. {readcon_db-0.2.4 → readcon_db-0.3.0}/.github/workflows/crates_publish.yml +0 -0
  53. {readcon_db-0.2.4 → readcon_db-0.3.0}/.github/workflows/cxx_tarball.yml +0 -0
  54. {readcon_db-0.2.4 → readcon_db-0.3.0}/.github/workflows/lint.yml +0 -0
  55. {readcon_db-0.2.4 → readcon_db-0.3.0}/.github/workflows/pages.yml +0 -0
  56. {readcon_db-0.2.4 → readcon_db-0.3.0}/.github/workflows/python-wheels.yml +0 -0
  57. {readcon_db-0.2.4 → readcon_db-0.3.0}/.gitignore +0 -0
  58. {readcon_db-0.2.4 → readcon_db-0.3.0}/CMakeLists.txt +0 -0
  59. {readcon_db-0.2.4 → readcon_db-0.3.0}/CODE_OF_CONDUCT.md +0 -0
  60. {readcon_db-0.2.4 → readcon_db-0.3.0}/CONTRIBUTING.md +0 -0
  61. {readcon_db-0.2.4 → readcon_db-0.3.0}/LICENSE +0 -0
  62. {readcon_db-0.2.4 → readcon_db-0.3.0}/SECURITY.md +0 -0
  63. {readcon_db-0.2.4 → readcon_db-0.3.0}/assets/logo/BRAND.md +0 -0
  64. {readcon_db-0.2.4 → readcon_db-0.3.0}/assets/logo/readcon-db-logo-512.png +0 -0
  65. {readcon_db-0.2.4 → readcon_db-0.3.0}/assets/logo/readcon-db-logo-raster.jpg +0 -0
  66. {readcon_db-0.2.4 → readcon_db-0.3.0}/assets/logo/readcon-db-logo.svg +0 -0
  67. {readcon_db-0.2.4 → readcon_db-0.3.0}/assets/logo/readcon-db-wordmark.svg +0 -0
  68. {readcon_db-0.2.4 → readcon_db-0.3.0}/bench/gen_con.py +0 -0
  69. {readcon_db-0.2.4 → readcon_db-0.3.0}/bench/mpi_bench.sh +0 -0
  70. {readcon_db-0.2.4 → readcon_db-0.3.0}/bench/vary_con.py +0 -0
  71. {readcon_db-0.2.4 → readcon_db-0.3.0}/cmake/readcon-db-config-version.in.cmake +0 -0
  72. {readcon_db-0.2.4 → readcon_db-0.3.0}/cmake/readcon-db-config.in.cmake +0 -0
  73. {readcon_db-0.2.4 → readcon_db-0.3.0}/cmake/readcon-db.pc.in +0 -0
  74. {readcon_db-0.2.4 → readcon_db-0.3.0}/cmake/tempdir.cmake +0 -0
  75. {readcon_db-0.2.4 → readcon_db-0.3.0}/cog.toml +0 -0
  76. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/Makefile +0 -0
  77. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/_static/logo.svg +0 -0
  78. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/orgmode/changelog.org +0 -0
  79. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/orgmode/contributing/index.org +0 -0
  80. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/orgmode/cooked-soa.org +0 -0
  81. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/orgmode/explanation/faq.org +0 -0
  82. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/orgmode/explanation/overview.org +0 -0
  83. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/orgmode/howto/atom-order.org +0 -0
  84. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/orgmode/howto/howto.org +0 -0
  85. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/orgmode/howto/install.org +0 -0
  86. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/orgmode/howto/migration.org +0 -0
  87. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/orgmode/howto/mpi.org +0 -0
  88. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/orgmode/howto/streaming.org +0 -0
  89. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/orgmode/howto/topology.org +0 -0
  90. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/orgmode/index.org +0 -0
  91. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/orgmode/readme.org +0 -0
  92. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/orgmode/reference/citation.org +0 -0
  93. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/orgmode/reference/fortran.org +0 -0
  94. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/orgmode/reference/python-api.org +0 -0
  95. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/orgmode/tutorials/getting-started.org +0 -0
  96. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/orgmode/tutorials/tutorial-run.log +0 -0
  97. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/orgmode/tutorials/tutorial-run.sh +0 -0
  98. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/orgmode/tutorials/tutorial.org +0 -0
  99. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/requirements.txt +0 -0
  100. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/source/_static/custom.css +0 -0
  101. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/source/_static/favicon.svg +0 -0
  102. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/source/_static/logo-nav-dark.svg +0 -0
  103. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/source/_static/logo-nav-light.svg +0 -0
  104. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/source/_static/logo.svg +0 -0
  105. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/source/_static/mark.svg +0 -0
  106. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/source/_templates/partials/extra-foot.html +0 -0
  107. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/source/_templates/partials/extra-head.html +0 -0
  108. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/source/_templates/partials/site-foot.html +0 -0
  109. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/source/_templates/partials/webfonts.html +0 -0
  110. {readcon_db-0.2.4 → readcon_db-0.3.0}/docs/source/conf.py +0 -0
  111. {readcon_db-0.2.4 → readcon_db-0.3.0}/examples/bench_corpus_ops.rs +0 -0
  112. {readcon_db-0.2.4 → readcon_db-0.3.0}/examples/bench_vs_ase_prep.py +0 -0
  113. {readcon_db-0.2.4 → readcon_db-0.3.0}/examples/benchmarks/ase_db_bench.json +0 -0
  114. {readcon_db-0.2.4 → readcon_db-0.3.0}/examples/benchmarks/ase_fair_campaign_1.json +0 -0
  115. {readcon_db-0.2.4 → readcon_db-0.3.0}/examples/benchmarks/bench_ase_db.py +0 -0
  116. {readcon_db-0.2.4 → readcon_db-0.3.0}/examples/benchmarks/db_vs_ase_table.md +0 -0
  117. {readcon_db-0.2.4 → readcon_db-0.3.0}/examples/benchmarks/fair_campaign.py +0 -0
  118. {readcon_db-0.2.4 → readcon_db-0.3.0}/examples/benchmarks/fair_db_vs_ase_table.md +0 -0
  119. {readcon_db-0.2.4 → readcon_db-0.3.0}/examples/benchmarks/readcon_db_bench.json +0 -0
  120. {readcon_db-0.2.4 → readcon_db-0.3.0}/examples/benchmarks/results_merged.json +0 -0
  121. {readcon_db-0.2.4 → readcon_db-0.3.0}/examples/benchmarks/test_fair_select_parity.py +0 -0
  122. {readcon_db-0.2.4 → readcon_db-0.3.0}/examples/ingest_select.rs +0 -0
  123. {readcon_db-0.2.4 → readcon_db-0.3.0}/examples/mpi_bcast_frame.c +0 -0
  124. {readcon_db-0.2.4 → readcon_db-0.3.0}/examples/mpi_bcast_frame.f90 +0 -0
  125. {readcon_db-0.2.4 → readcon_db-0.3.0}/examples/mpi_bcast_frame.py +0 -0
  126. {readcon_db-0.2.4 → readcon_db-0.3.0}/examples/mpi_ingest_check.rs +0 -0
  127. {readcon_db-0.2.4 → readcon_db-0.3.0}/examples/mpi_read_check.rs +0 -0
  128. {readcon_db-0.2.4 → readcon_db-0.3.0}/examples/shard_gate.rs +0 -0
  129. {readcon_db-0.2.4 → readcon_db-0.3.0}/examples/workflows/metatrain_from_con.md +0 -0
  130. {readcon_db-0.2.4 → readcon_db-0.3.0}/examples/workflows/options.metatrain.snippet.yaml +0 -0
  131. {readcon_db-0.2.4 → readcon_db-0.3.0}/fortran/README.md +0 -0
  132. {readcon_db-0.2.4 → readcon_db-0.3.0}/fortran/ReadConDb/src/readcon_db.f90 +0 -0
  133. {readcon_db-0.2.4 → readcon_db-0.3.0}/include/readcon-db-mpi.h +0 -0
  134. {readcon_db-0.2.4 → readcon_db-0.3.0}/lychee.toml +0 -0
  135. {readcon_db-0.2.4 → readcon_db-0.3.0}/meson.build +0 -0
  136. {readcon_db-0.2.4 → readcon_db-0.3.0}/meson_options.txt +0 -0
  137. {readcon_db-0.2.4 → readcon_db-0.3.0}/packaging/wrapdb/README.md +0 -0
  138. {readcon_db-0.2.4 → readcon_db-0.3.0}/packaging/wrapdb/readcon-db.wrap.in +0 -0
  139. {readcon_db-0.2.4 → readcon_db-0.3.0}/paper/cpc/freeze/ase_fair_campaign_1.json +0 -0
  140. {readcon_db-0.2.4 → readcon_db-0.3.0}/paper/cpc/freeze/fair_db_vs_ase_table.md +0 -0
  141. {readcon_db-0.2.4 → readcon_db-0.3.0}/paper/cpc/readme.org +0 -0
  142. {readcon_db-0.2.4 → readcon_db-0.3.0}/paper/cpc/scripts/gen_fair_table.py +0 -0
  143. {readcon_db-0.2.4 → readcon_db-0.3.0}/paper/cpc/src/appendix-fair-campaign.org +0 -0
  144. {readcon_db-0.2.4 → readcon_db-0.3.0}/paper/cpc/src/figures/generated/fair_campaign_table.tex +0 -0
  145. {readcon_db-0.2.4 → readcon_db-0.3.0}/pixi.lock +0 -0
  146. {readcon_db-0.2.4 → readcon_db-0.3.0}/pr-text.md +0 -0
  147. {readcon_db-0.2.4 → readcon_db-0.3.0}/prek.toml +0 -0
  148. {readcon_db-0.2.4 → readcon_db-0.3.0}/python/tests/test_atom_order.py +0 -0
  149. {readcon_db-0.2.4 → readcon_db-0.3.0}/python/tests/test_catalog_claims.py +0 -0
  150. {readcon_db-0.2.4 → readcon_db-0.3.0}/python/tests/test_extend_precision.py +0 -0
  151. {readcon_db-0.2.4 → readcon_db-0.3.0}/python/tests/test_hash_con_text.py +0 -0
  152. {readcon_db-0.2.4 → readcon_db-0.3.0}/python/tests/test_stream_and_random.py +0 -0
  153. {readcon_db-0.2.4 → readcon_db-0.3.0}/python/tests/test_streaming_guide.py +0 -0
  154. {readcon_db-0.2.4 → readcon_db-0.3.0}/resources/test/con_v4/tiny_cuh2_v4.con +0 -0
  155. {readcon_db-0.2.4 → readcon_db-0.3.0}/resources/test/con_v4/tiny_cuh2_v4.convel +0 -0
  156. {readcon_db-0.2.4 → readcon_db-0.3.0}/resources/test/eon36_lj_dimer.convel +0 -0
  157. {readcon_db-0.2.4 → readcon_db-0.3.0}/resources/test/highprec_a.con +0 -0
  158. {readcon_db-0.2.4 → readcon_db-0.3.0}/resources/test/highprec_b.con +0 -0
  159. {readcon_db-0.2.4 → readcon_db-0.3.0}/resources/test/sulfolene.con +0 -0
  160. {readcon_db-0.2.4 → readcon_db-0.3.0}/resources/test/tiny_cuh2.con +0 -0
  161. {readcon_db-0.2.4 → readcon_db-0.3.0}/resources/test/tiny_cuh2.convel +0 -0
  162. {readcon_db-0.2.4 → readcon_db-0.3.0}/resources/test/tiny_cuh2_forces.con +0 -0
  163. {readcon_db-0.2.4 → readcon_db-0.3.0}/resources/test/tiny_cuh2_vel_forces.con +0 -0
  164. {readcon_db-0.2.4 → readcon_db-0.3.0}/resources/test/tiny_multi_cuh2.con +0 -0
  165. {readcon_db-0.2.4 → readcon_db-0.3.0}/scripts/assemble-site.sh +0 -0
  166. {readcon_db-0.2.4 → readcon_db-0.3.0}/scripts/build-docs.sh +0 -0
  167. {readcon_db-0.2.4 → readcon_db-0.3.0}/scripts/check-clib-dist.sh +0 -0
  168. {readcon_db-0.2.4 → readcon_db-0.3.0}/scripts/check-cpc-freeze.sh +0 -0
  169. {readcon_db-0.2.4 → readcon_db-0.3.0}/scripts/check-cxx-dist.sh +0 -0
  170. {readcon_db-0.2.4 → readcon_db-0.3.0}/scripts/crate_version.py +0 -0
  171. {readcon_db-0.2.4 → readcon_db-0.3.0}/scripts/export-landing.sh +0 -0
  172. {readcon_db-0.2.4 → readcon_db-0.3.0}/scripts/meson_cargo_build.py +0 -0
  173. {readcon_db-0.2.4 → readcon_db-0.3.0}/scripts/package-clib.sh +0 -0
  174. {readcon_db-0.2.4 → readcon_db-0.3.0}/scripts/package-cxx.sh +0 -0
  175. {readcon_db-0.2.4 → readcon_db-0.3.0}/scripts/release-prep.sh +0 -0
  176. {readcon_db-0.2.4 → readcon_db-0.3.0}/scripts/set-version.sh +0 -0
  177. {readcon_db-0.2.4 → readcon_db-0.3.0}/scripts/sync-version.py +0 -0
  178. {readcon_db-0.2.4 → readcon_db-0.3.0}/scripts/test_check_version_lockstep.py +0 -0
  179. {readcon_db-0.2.4 → readcon_db-0.3.0}/src/archive.rs +0 -0
  180. {readcon_db-0.2.4 → readcon_db-0.3.0}/src/bin/readcon-db.rs +0 -0
  181. {readcon_db-0.2.4 → readcon_db-0.3.0}/src/error.rs +0 -0
  182. {readcon_db-0.2.4 → readcon_db-0.3.0}/src/frame_codec.rs +0 -0
  183. {readcon_db-0.2.4 → readcon_db-0.3.0}/src/frame_scalars.rs +0 -0
  184. {readcon_db-0.2.4 → readcon_db-0.3.0}/src/keys.rs +0 -0
  185. {readcon_db-0.2.4 → readcon_db-0.3.0}/src/mpi_ingest.rs +0 -0
  186. {readcon_db-0.2.4 → readcon_db-0.3.0}/src/mpi_read.rs +0 -0
  187. {readcon_db-0.2.4 → readcon_db-0.3.0}/src/mpi_wire.rs +0 -0
  188. {readcon_db-0.2.4 → readcon_db-0.3.0}/src/select.rs +0 -0
  189. {readcon_db-0.2.4 → readcon_db-0.3.0}/src/shard.rs +0 -0
  190. {readcon_db-0.2.4 → readcon_db-0.3.0}/src/topology.rs +0 -0
  191. {readcon_db-0.2.4 → readcon_db-0.3.0}/tests/atom_order.rs +0 -0
  192. {readcon_db-0.2.4 → readcon_db-0.3.0}/tests/canonical_dump.rs +0 -0
  193. {readcon_db-0.2.4 → readcon_db-0.3.0}/tests/capi_symbols.rs +0 -0
  194. {readcon_db-0.2.4 → readcon_db-0.3.0}/tests/catalog_claims.rs +0 -0
  195. {readcon_db-0.2.4 → readcon_db-0.3.0}/tests/cdylib_static_tls.rs +0 -0
  196. {readcon_db-0.2.4 → readcon_db-0.3.0}/tests/claims_shard.rs +0 -0
  197. {readcon_db-0.2.4 → readcon_db-0.3.0}/tests/cli_refuse.rs +0 -0
  198. {readcon_db-0.2.4 → readcon_db-0.3.0}/tests/cmake-project/CMakeLists.txt +0 -0
  199. {readcon_db-0.2.4 → readcon_db-0.3.0}/tests/cmake-project/main.c +0 -0
  200. {readcon_db-0.2.4 → readcon_db-0.3.0}/tests/cooked_soa_authority.rs +0 -0
  201. {readcon_db-0.2.4 → readcon_db-0.3.0}/tests/hash_file.rs +0 -0
  202. {readcon_db-0.2.4 → readcon_db-0.3.0}/tests/meson-wrap/main.c +0 -0
  203. {readcon_db-0.2.4 → readcon_db-0.3.0}/tests/meson-wrap/meson.build +0 -0
  204. {readcon_db-0.2.4 → readcon_db-0.3.0}/tests/mpi-c/ingest_smoke.c +0 -0
  205. {readcon_db-0.2.4 → readcon_db-0.3.0}/tests/topology_cli.rs +0 -0
  206. {readcon_db-0.2.4 → readcon_db-0.3.0}/website/assets/logo.svg +0 -0
  207. {readcon_db-0.2.4 → readcon_db-0.3.0}/website/assets/wordmark.svg +0 -0
  208. {readcon_db-0.2.4 → readcon_db-0.3.0}/website/css/site.css +0 -0
  209. {readcon_db-0.2.4 → readcon_db-0.3.0}/website/export.el +0 -0
  210. {readcon_db-0.2.4 → readcon_db-0.3.0}/website/index.html +0 -0
  211. {readcon_db-0.2.4 → readcon_db-0.3.0}/website/index.org +0 -0
@@ -46,3 +46,30 @@ jobs:
46
46
  run: cargo doc --locked --no-deps
47
47
  - name: Verify registry package
48
48
  run: cargo package --locked
49
+
50
+ pytest:
51
+ name: pytest (ubuntu-latest)
52
+ runs-on: ubuntu-latest
53
+ steps:
54
+ - uses: actions/checkout@v4
55
+ - uses: dtolnay/rust-toolchain@stable
56
+ - name: Cache cargo
57
+ uses: Swatinem/rust-cache@v2
58
+ - uses: actions/setup-python@v5
59
+ with:
60
+ python-version: "3.12"
61
+ - name: Install test dependencies
62
+ run: |
63
+ python -m pip install --upgrade pip
64
+ python -m pip install maturin pytest numpy h5py MDAnalysis ase "readcon==0.25.0"
65
+ - name: Build the wheel
66
+ working-directory: python
67
+ run: maturin build --locked --release --features python --out ../dist
68
+ - name: Install the wheel
69
+ run: python -m pip install dist/readcon_db-*.whl
70
+ - name: Build the C ABI library for the real-archive comparison
71
+ run: cargo build --locked --release --features capi --lib
72
+ - name: Test
73
+ env:
74
+ READCON_DB_CAPI_LIB: ${{ github.workspace }}/target/release/libreadcon_db.so
75
+ run: python -m pytest python/tests -q -rfEs
@@ -1,5 +1,35 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.3.0 - 2026-12-03
4
+ #### Build system
5
+ - require readcon-core 0.25.0
6
+ #### Bug Fixes
7
+ - store CON major 4 frames
8
+ - below major 4, the clock and the velocities use the natural time unit from `velocity_file_time_unit`; major 4 uses `units.time`
9
+ - a pre-3.1 clock keeps the caller's spec and is not scaled; a v3.1 clock is reconciled with or without velocities
10
+ #### Tests
11
+ - round-trip CON major 4 fixtures and keep a major 3 ingest
12
+
13
+ ## v0.2.5 - 2026-11-28
14
+ #### Features
15
+ - (**python**) expose the observation archive writer - (791f832) - *HaoZeke*
16
+ - (**python**) read observation archives as readcon frames - (f5b0290) - *HaoZeke*
17
+ - append CON text onto a live trajectory - (8845e31) - *HaoZeke*
18
+ #### Bug Fixes
19
+ - (**corpus**) report a failed key scan instead of truncating it - (8d1becf) - *HaoZeke*
20
+ - (**python**) label a v3.1 clock and its velocities together - (3adeaca) - *HaoZeke*
21
+ #### Documentation
22
+ - (**python**) document reading observation archives - (ca678db) - *HaoZeke*
23
+ - date the citation release with the v0.2.4 tag - (da2940f) - *HaoZeke*
24
+ #### Tests
25
+ - (**python**) compare a written archive with the C ABI text path - (a132632) - *HaoZeke*
26
+ - (**python**) cover archive reads, writes and a real archive - (84dd0b9) - *HaoZeke*
27
+ - pin the claim expiry margin test to its clock - (b4afa8d) - *HaoZeke*
28
+ #### Build system
29
+ - (**python**) depend on readcon 0.23 - (84cef59) - *HaoZeke*
30
+ #### CI
31
+ - run the Python test suite against a built wheel - (3ce9432) - *HaoZeke*
32
+
3
33
  ## v0.2.4 - 2026-11-25
4
34
  #### Features
5
35
  - expose hash_con_text to c, fortran and python - (6704042) - *HaoZeke*
@@ -10,9 +10,9 @@ authors:
10
10
  license: MIT
11
11
  repository-code: "https://github.com/lode-org/readcon-db"
12
12
  # [[[cog cog.outl(f'version: {VERSION}') ]]]
13
- version: 0.2.4
13
+ version: 0.3.0
14
14
  # [[[end]]]
15
- date-released: "2026-08-15"
15
+ date-released: "2026-12-03"
16
16
  keywords:
17
17
  - CON
18
18
  - LMDB
@@ -189,12 +189,6 @@ dependencies = [
189
189
  "typenum",
190
190
  ]
191
191
 
192
- [[package]]
193
- name = "cty"
194
- version = "0.2.2"
195
- source = "registry+https://github.com/rust-lang/crates.io-index"
196
- checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35"
197
-
198
192
  [[package]]
199
193
  name = "custom_derive"
200
194
  version = "0.1.7"
@@ -526,16 +520,6 @@ dependencies = [
526
520
  "windows-link",
527
521
  ]
528
522
 
529
- [[package]]
530
- name = "libmimalloc-sys"
531
- version = "0.1.49"
532
- source = "registry+https://github.com/rust-lang/crates.io-index"
533
- checksum = "6a45a52f43e1c16f667ccfe4dd8c85b7f7c204fd5e3bf46c5b0db9a5c3c0b8e9"
534
- dependencies = [
535
- "cc",
536
- "cty",
537
- ]
538
-
539
523
  [[package]]
540
524
  name = "libz-ng-sys"
541
525
  version = "1.1.33"
@@ -595,13 +579,10 @@ dependencies = [
595
579
  ]
596
580
 
597
581
  [[package]]
598
- name = "mimalloc"
599
- version = "0.1.52"
582
+ name = "metrology"
583
+ version = "0.2.6"
600
584
  source = "registry+https://github.com/rust-lang/crates.io-index"
601
- checksum = "2d4139bb28d14ad1facf21d5eb8825051b326e172d216b39f6d31df53cc97862"
602
- dependencies = [
603
- "libmimalloc-sys",
604
- ]
585
+ checksum = "7964688f2711cfbc228d8a5b50096323533bf6fc7a0e736020bc4ce64f639757"
605
586
 
606
587
  [[package]]
607
588
  name = "minimal-lexical"
@@ -904,9 +885,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3"
904
885
 
905
886
  [[package]]
906
887
  name = "readcon-core"
907
- version = "0.23.2"
888
+ version = "0.25.0"
908
889
  source = "registry+https://github.com/rust-lang/crates.io-index"
909
- checksum = "87c32a8afef74ec96ed1a8e09e5f4ae56ae3cd982791d438a23b51eeeddce6c8"
890
+ checksum = "09293de1c6af54b01ff57b719ec8af476f7ee0de153fe452978fc787a67f466d"
910
891
  dependencies = [
911
892
  "dlpk",
912
893
  "fast-float2",
@@ -915,20 +896,21 @@ dependencies = [
915
896
  "libc",
916
897
  "memchr",
917
898
  "memmap2",
918
- "mimalloc",
899
+ "metrology",
919
900
  "ndarray",
920
901
  "rustc-hash",
921
902
  "ryu",
903
+ "serde",
922
904
  "serde_json",
905
+ "sha2",
923
906
  ]
924
907
 
925
908
  [[package]]
926
909
  name = "readcon-db"
927
- version = "0.2.4"
910
+ version = "0.3.0"
928
911
  dependencies = [
929
912
  "heed",
930
913
  "libc",
931
- "mimalloc",
932
914
  "mpi",
933
915
  "object",
934
916
  "pyo3",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "readcon-db"
3
- version = "0.2.4"
3
+ version = "0.3.0"
4
4
  edition = "2021"
5
5
  description = "Mmap-backed CON frame corpus (Heed/LMDB), xxHash exact match, multi-language FFI"
6
6
  license = "MIT"
@@ -30,15 +30,12 @@ mpi = ["dep:mpi"]
30
30
  [dependencies]
31
31
  heed = "0.21"
32
32
  # The pinned writer provides exact numeric CON and JSON round trips.
33
- readcon-core = "=0.23.2"
34
- # readcon-core installs mimalloc as the global allocator and has no
35
- # feature to turn that off. The C objects default to initial-exec TLS,
36
- # which sets DF_STATIC_TLS on this cdylib. Cargo unifies
37
- # local_dynamic_tls onto that same mimalloc.
38
- mimalloc = { version = "0.1.43", default-features = false, features = [
39
- "extended",
40
- "local_dynamic_tls",
41
- ] }
33
+ # readcon-core 0.24+ installs mimalloc only with `mimalloc-allocator`.
34
+ # A library must not enable that feature. This crate does not, and it
35
+ # does not register its own global allocator, so the process keeps the
36
+ # system allocator. A direct mimalloc dependency would link another copy
37
+ # without installing it.
38
+ readcon-core = "=0.25.0"
42
39
  thiserror = "2"
43
40
  serde = { version = "1", features = ["derive"] }
44
41
  serde_json = "1"
@@ -1,10 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: readcon-db
3
- Version: 0.2.4
3
+ Version: 0.3.0
4
+ Requires-Dist: readcon>=0.25,<0.26
4
5
  Summary: Mmap CON corpus store (LMDB/Heed) with xxHash exact match
5
6
  Home-Page: https://lode-org.github.io/readcon-db/
6
7
  License: MIT
7
- Requires-Python: >=3.9
8
+ Requires-Python: >=3.10
8
9
  Description-Content-Type: text/markdown
9
10
  Project-URL: Documentation, https://lode-org.github.io/readcon-db/
10
11
  Project-URL: Homepage, https://github.com/lode-org/readcon-db
@@ -19,7 +20,7 @@ Part of the **readcon ecosystem** with [`readcon-core`](https://github.com/lode-
19
20
 
20
21
  | Crate / package | Role | Docs |
21
22
  |-----------------|------|------|
22
- | **[readcon-core](https://github.com/lode-org/readcon-core)** / **`readcon`** | CON interchange (parse/write/spec v2–v3). **XYZ/PDB/GRO → `ConFrame` via chemfiles** (`read_chemfiles*`), not ASE. Optional `to_ase` only for calculators. | Core README, `docs/orgmode/` |
23
+ | **[readcon-core](https://github.com/lode-org/readcon-core)** / **`readcon`** | CON interchange (parse/write/spec v2–v4). **XYZ/PDB/GRO → `ConFrame` via chemfiles** (`read_chemfiles*`), not ASE. Optional `to_ase` only for calculators. | Core README, `docs/orgmode/` |
23
24
  | **readcon-db** / **`readcon_db`** (this repo) | mmap CON corpus: indexes (natoms, symbols, **energy range**, **forces/velocities/energy flags**), multi-reader, dedup. Blobs are **CON text** decoded with readcon-core. | [docs](https://lode-org.github.io/readcon-db/docs/), [`docs/orgmode/explanation/design.org`](docs/orgmode/explanation/design.org) |
24
25
 
25
26
  ASE is not on the CON or XYZ read path. Optional `to_ase` is calculator hand-off only.
@@ -91,7 +92,7 @@ let h = db.frame_hash(keys[0])?;
91
92
 
92
93
  Foreign trajectories: **`readcon.read_chemfiles("traj.xyz")` → frames → ingest into readcon-db** (chemfiles-enabled build), not `ase.io.read`.
93
94
 
94
- Python `append_trajectory_frames` commits 64 frames at a time. `get_frame` returns a `StoredFrame` (`atoms[i]` builds that atom only). Gzip and zstd files are read with `readcon.read_con`, then appended. Python `append_trajectory` and Rust `append_trajectory_path` read UTF-8 and do not decompress. `readcon-db` does not register an `ase.ioformats` entry point. Guide: [`docs/orgmode/howto/streaming.org`](docs/orgmode/howto/streaming.org). Upgrade from 0.2.0: [`docs/orgmode/howto/migration.org`](docs/orgmode/howto/migration.org).
95
+ Python `append_trajectory_frames` commits 64 frames at a time. `get_frame` returns a `StoredFrame` (`atoms[i]` builds that atom only). Gzip and zstd files are read with `readcon.read_con`, then appended. Python `append_trajectory` and Rust `append_trajectory_path` read UTF-8 and do not decompress. `readcon-db` does not register an `ase.ioformats` entry point. Python `ArchiveReader(path)` opens an observation archive (`observations.rdb`) read-only and returns each stored frame as a `readcon.ConFrame` with its energy and JSON metadata ([`docs/orgmode/reference/python.org`](docs/orgmode/reference/python.org#observation-archives)). Guide: [`docs/orgmode/howto/streaming.org`](docs/orgmode/howto/streaming.org). Upgrade from 0.2.0: [`docs/orgmode/howto/migration.org`](docs/orgmode/howto/migration.org).
95
96
 
96
97
  ## Design
97
98
 
@@ -108,17 +109,16 @@ Python `append_trajectory_frames` commits 64 frames at a time. `get_frame` retur
108
109
  - **H5MD interchange** — `export_h5md` / `collect_h5md` writes one
109
110
  `[T][N][3]` trajectory (CON stays authority). Engine dest is Å / ps /
110
111
  kJ mol^{-1} Angstrom^{-1}; velocity dest is `Angstrom ps-1`.
111
- Velocities follow D10: v1, v2, and v3.0 frames use the natural unit
112
- `(amu*angstrom^2/eV)^0.5` whatever the time label says; v3.1 frames use
113
- `units.time` and fail when a velocities section has no `units.time`.
112
+ Velocities and the simulation clock use
113
+ `readcon_core::units::velocity_file_time_unit`. Below major 4 that unit
114
+ is the natural unit `(amu*angstrom^2/eV)^0.5`, whether or not
115
+ `units.time` is present. Major 4 uses `units.time`. A missing major-4
116
+ label is an error when the frame has a clock or velocities.
114
117
  `--velocity-time-unit`, Rust `H5mdCollectOpts`, the Python
115
118
  `velocity_time_unit` argument, and C `rkrdb_set_velocity_time_unit`
116
- override that rule for a file that breaks it.
117
- The simulation clock uses `units.time` when that key is present.
118
- A v3.1 frame with `time` or `timestep` and no `units.time` is an error.
119
- The same override supplies that missing clock unit.
120
- A present `units.time` still scales the clock.
121
- v1, v2, and v3.0 clocks with no `units.time` are read as `fs`.
119
+ are passed through to that function. They do not replace the unit it
120
+ assigns. Below major 4 they are ignored. At major 4 a different unit
121
+ is an error.
122
122
  - **Node-local drain/join** — `shard-ingest` then `drain` to a unique
123
123
  dest (`data.mdb` only, refuse overwrite), then `join-drained`.
124
124
  `compact-join` joins one sharded root (`open_existing`). Campaign
@@ -6,7 +6,7 @@ Part of the **readcon ecosystem** with [`readcon-core`](https://github.com/lode-
6
6
 
7
7
  | Crate / package | Role | Docs |
8
8
  |-----------------|------|------|
9
- | **[readcon-core](https://github.com/lode-org/readcon-core)** / **`readcon`** | CON interchange (parse/write/spec v2–v3). **XYZ/PDB/GRO → `ConFrame` via chemfiles** (`read_chemfiles*`), not ASE. Optional `to_ase` only for calculators. | Core README, `docs/orgmode/` |
9
+ | **[readcon-core](https://github.com/lode-org/readcon-core)** / **`readcon`** | CON interchange (parse/write/spec v2–v4). **XYZ/PDB/GRO → `ConFrame` via chemfiles** (`read_chemfiles*`), not ASE. Optional `to_ase` only for calculators. | Core README, `docs/orgmode/` |
10
10
  | **readcon-db** / **`readcon_db`** (this repo) | mmap CON corpus: indexes (natoms, symbols, **energy range**, **forces/velocities/energy flags**), multi-reader, dedup. Blobs are **CON text** decoded with readcon-core. | [docs](https://lode-org.github.io/readcon-db/docs/), [`docs/orgmode/explanation/design.org`](docs/orgmode/explanation/design.org) |
11
11
 
12
12
  ASE is not on the CON or XYZ read path. Optional `to_ase` is calculator hand-off only.
@@ -78,7 +78,7 @@ let h = db.frame_hash(keys[0])?;
78
78
 
79
79
  Foreign trajectories: **`readcon.read_chemfiles("traj.xyz")` → frames → ingest into readcon-db** (chemfiles-enabled build), not `ase.io.read`.
80
80
 
81
- Python `append_trajectory_frames` commits 64 frames at a time. `get_frame` returns a `StoredFrame` (`atoms[i]` builds that atom only). Gzip and zstd files are read with `readcon.read_con`, then appended. Python `append_trajectory` and Rust `append_trajectory_path` read UTF-8 and do not decompress. `readcon-db` does not register an `ase.ioformats` entry point. Guide: [`docs/orgmode/howto/streaming.org`](docs/orgmode/howto/streaming.org). Upgrade from 0.2.0: [`docs/orgmode/howto/migration.org`](docs/orgmode/howto/migration.org).
81
+ Python `append_trajectory_frames` commits 64 frames at a time. `get_frame` returns a `StoredFrame` (`atoms[i]` builds that atom only). Gzip and zstd files are read with `readcon.read_con`, then appended. Python `append_trajectory` and Rust `append_trajectory_path` read UTF-8 and do not decompress. `readcon-db` does not register an `ase.ioformats` entry point. Python `ArchiveReader(path)` opens an observation archive (`observations.rdb`) read-only and returns each stored frame as a `readcon.ConFrame` with its energy and JSON metadata ([`docs/orgmode/reference/python.org`](docs/orgmode/reference/python.org#observation-archives)). Guide: [`docs/orgmode/howto/streaming.org`](docs/orgmode/howto/streaming.org). Upgrade from 0.2.0: [`docs/orgmode/howto/migration.org`](docs/orgmode/howto/migration.org).
82
82
 
83
83
  ## Design
84
84
 
@@ -95,17 +95,16 @@ Python `append_trajectory_frames` commits 64 frames at a time. `get_frame` retur
95
95
  - **H5MD interchange** — `export_h5md` / `collect_h5md` writes one
96
96
  `[T][N][3]` trajectory (CON stays authority). Engine dest is Å / ps /
97
97
  kJ mol^{-1} Angstrom^{-1}; velocity dest is `Angstrom ps-1`.
98
- Velocities follow D10: v1, v2, and v3.0 frames use the natural unit
99
- `(amu*angstrom^2/eV)^0.5` whatever the time label says; v3.1 frames use
100
- `units.time` and fail when a velocities section has no `units.time`.
98
+ Velocities and the simulation clock use
99
+ `readcon_core::units::velocity_file_time_unit`. Below major 4 that unit
100
+ is the natural unit `(amu*angstrom^2/eV)^0.5`, whether or not
101
+ `units.time` is present. Major 4 uses `units.time`. A missing major-4
102
+ label is an error when the frame has a clock or velocities.
101
103
  `--velocity-time-unit`, Rust `H5mdCollectOpts`, the Python
102
104
  `velocity_time_unit` argument, and C `rkrdb_set_velocity_time_unit`
103
- override that rule for a file that breaks it.
104
- The simulation clock uses `units.time` when that key is present.
105
- A v3.1 frame with `time` or `timestep` and no `units.time` is an error.
106
- The same override supplies that missing clock unit.
107
- A present `units.time` still scales the clock.
108
- v1, v2, and v3.0 clocks with no `units.time` are read as `fs`.
105
+ are passed through to that function. They do not replace the unit it
106
+ assigns. Below major 4 they are ignored. At major 4 a different unit
107
+ is an error.
109
108
  - **Node-local drain/join** — `shard-ingest` then `drain` to a unique
110
109
  dest (`data.mdb` only, refuse overwrite), then `join-drained`.
111
110
  `compact-join` joins one sharded root (`open_existing`). Campaign
@@ -0,0 +1 @@
1
+ Python `ArchiveReader` opens an observation archive or any corpus read-only and returns every stored frame, in `(traj_id, frame_idx)` order, as an `Observation` that holds the `readcon.ConFrame`, its CON text, energy, metadata and the permutation back to the writer's atom order. Python `ObservationArchive` is the archive writer. A missing path raises `FileNotFoundError` and a directory that is not a corpus raises `ArchiveError`.
@@ -0,0 +1 @@
1
+ The `readcon-db` Python package depends on `readcon>=0.25,<0.26`, the range of the pinned readcon-core, and so needs Python 3.10 or newer.
@@ -0,0 +1 @@
1
+ `rkrdb_extend_trajectory_str` and Python `extend_trajectory_str` append CON text after the live frame count. The new text is parsed before the write. A span that does not parse is not written, and earlier frames stay as stored.
@@ -0,0 +1 @@
1
+ A trajectory can carry one caller-defined JSON object that describes it as a whole, such as the summary of the run that wrote it. Rust `ConCorpus::set_trajectory_metadata` / `trajectory_metadata`, C `rkrdb_set_trajectory_metadata` / `rkrdb_trajectory_metadata` (C++ `Corpus::set_trajectory_metadata` / `trajectory_metadata`), Python `ConCorpus.set_trajectory_metadata` / `trajectory_metadata` and `ArchiveReader.trajectory_metadata`. Frames appended later keep it, and a stored record without it reads as before. The C ABI minor is 4.
@@ -0,0 +1 @@
1
+ Python ingest keeps a pre-3.1 clock on the caller's spec. The clock and the velocities stay in the natural unit `velocity_file_time_unit` assigns, including a `ps` or `fs` label and a clock with no velocities. A v3.1 clock moves into that unit on both `read_con` and a frame list. Major 4 keeps `units.time`.
@@ -49,7 +49,7 @@ Environment (Heed / LMDB)
49
49
 
50
50
  =TrajMeta= may record =topo_cutoff=, =topo_graph=, =topo_hops=, and =topo_method= after =annotate_topology=. Those fields have serde defaults so old JSON still loads. Ingest and extend preserve them.
51
51
 
52
- *H5MD interchange:* =collect_h5md= / =export_h5md= emit one =[T][N][3]= trajectory (position, optional force and velocity). CON text stays authority. Dest units are Å / ps / kJ mol^{-1} Å^{-1}; velocity dest is =Angstrom ps-1=. Velocities follow D10: v1, v2, and v3.0 use the natural unit whatever the time label says; v3.1 uses =units.time=. A v3.1 clock with no =units.time= is an error. v1, v2, and v3.0 clocks with no =units.time= are read as =fs=.
52
+ *H5MD interchange:* =collect_h5md= / =export_h5md= emit one =[T][N][3]= trajectory (position, optional force and velocity). CON text stays authority. Dest units are Å / ps / kJ mol^{-1} Å^{-1}; velocity dest is =Angstrom ps-1=. Below major 4 the clock and the velocities are the natural unit from =velocity_file_time_unit=, with or without =units.time=. Major 4 uses =units.time=. A missing major-4 label is an error when the frame has a clock or velocities.
53
53
 
54
54
  *Drain/join:* node-local =shard-ingest=, =drain_to= compact-snapshots =data.mdb= (refuse overwrite), then =join-drained=. =compact-join= is the single-root join (=open_existing=). Ops: @@rst::doc:`/howto/campaign`@@.
55
55
 
@@ -205,7 +205,7 @@ Assign trajectory IDs so ~traj_id % n_shards == shard_id~ (CLI =shard-ingest= ad
205
205
  :PROPERTIES:
206
206
  :CUSTOM_ID: h5md-interchange
207
207
  :END:
208
- =collect_h5md= / =export_h5md= emit one cooked =[T][N][3]= trajectory (position, optional force and velocity). CON text stays the corpus authority. Dest units are Å / ps / kJ mol^{-1} Å^{-1} / Å ps^{-1} (=Angstrom ps-1= for MDA 2.10). Velocities follow D10: v1, v2, and v3.0 use =(amu*angstrom^2/eV)^0.5= whatever the time label says; v3.1 uses =units.time= and fails when velocities have no =units.time=. An explicit velocity time override exists for a file that breaks that rule. The same override supplies the clock unit when a v3.1 frame has =time= or =timestep= and no =units.time=. v1, v2, and v3.0 clocks with no =units.time= are read as =fs=. Node-local ingest then =drain_to= + =join-drained= is the campaign write path (see above).
208
+ =collect_h5md= / =export_h5md= emit one cooked =[T][N][3]= trajectory (position, optional force and velocity). CON text stays the corpus authority. Dest units are Å / ps / kJ mol^{-1} Å^{-1} / Å ps^{-1} (=Angstrom ps-1= for MDA 2.10). Below major 4 the clock and the velocities are the natural unit =(amu*angstrom^2/eV)^0.5= from =velocity_file_time_unit=, with or without =units.time=. Major 4 uses =units.time=. A missing major-4 label is an error when the frame has a clock or velocities. An override is passed through to that function and does not replace the unit it assigns. Node-local ingest then =drain_to= + =join-drained= is the campaign write path (see above).
209
209
 
210
210
  ** LMDB model decision (HPC)
211
211
  :PROPERTIES:
@@ -114,7 +114,7 @@ ConCorpus("/lustre/orion/proj/campaign_single", readonly=True).export_h5md(1, "t
114
114
  :PROPERTIES:
115
115
  :CUSTOM_ID: units
116
116
  :END:
117
- Stamp units on ingest (=--units= JSON, or C =rkrdb_append_trajectory_units= / Fortran =db_append_units=). Aliases canonicalize (=A= -> =angstrom=). =set_units= converts stored numbers and refuses a v3.1 clock or velocities frame with no =units.time= instead of assuming =fs=; append/extend stamp incoming values. CON line-2 =units= is the authority for length, energy, and the clock. A v3.1 frame with =time= or =timestep= and no =units.time= is an error. =--velocity-time-unit= supplies that missing clock unit and overrides the D10 velocity rule for a file that breaks it. A present =units.time= still scales the clock. v1, v2, and v3.0 clocks with no =units.time= are read as =fs=. H5MD velocities follow D10: v1, v2, and v3.0 use the natural unit =(amu*angstrom^2/eV)^0.5= whatever the time label says; v3.1 uses =units.time= and fails when velocities have no =units.time=.
117
+ Stamp units on ingest (=--units= JSON, or C =rkrdb_append_trajectory_units= / Fortran =db_append_units=). Aliases canonicalize (=A= -> =angstrom=). =set_units= converts stored numbers. Below major 4 a time-label change does not rescale the clock or the velocities; append/extend stamp incoming values. CON line-2 =units= is the authority for length and energy. The clock and the velocities follow =velocity_file_time_unit=: below major 4 that is the natural unit =(amu*angstrom^2/eV)^0.5=, with or without =units.time=, and major 4 uses =units.time=. A missing major-4 label is an error when the frame has a clock or velocities. =--velocity-time-unit= is passed through and does not replace that unit.
118
118
 
119
119
  ** C / Fortran writers
120
120
  :PROPERTIES:
@@ -54,7 +54,7 @@ db.export_h5md(traj_id=1, path="traj.h5")
54
54
 
55
55
  Dest must not exist (=File= ="x"=). A write failure removes the dest.
56
56
 
57
- Time on the file is dest =ps=: CON =header.time()=, or =i * timestep=, else the frame index. A v3.1 frame with =time= or =timestep= and no =units.time= is an error. =velocity_time_unit= supplies that missing clock unit and overrides the D10 velocity rule for a file that breaks it. A present =units.time= still scales the clock. v1, v2, and v3.0 clocks with no =units.time= are read as =fs=. Optional force and velocity groups are dest =kJ mol-1 Angstrom-1= and =Angstrom ps-1=. Velocities follow D10: v1, v2, and v3.0 use =(amu*angstrom^2/eV)^0.5= whatever the label says; v3.1 uses =units.time= and fails if that key is missing. =readcon-db compact-join= is the single-root join (=open_existing=).
57
+ Time on the file is dest =ps=: CON =header.time()=, or =i * timestep=, else the frame index. Below major 4 the clock and the velocities are the natural unit =(amu*angstrom^2/eV)^0.5= from =velocity_file_time_unit=, with or without =units.time=. Major 4 uses =units.time=. A missing major-4 label is an error when the frame has a clock or velocities. =velocity_time_unit= is passed through and does not replace that unit. Optional force and velocity groups are dest =kJ mol-1 Angstrom-1= and =Angstrom ps-1=. =readcon-db compact-join= is the single-root join (=open_existing=).
58
58
 
59
59
  ** CON-native (default)
60
60
  :PROPERTIES:
@@ -20,7 +20,7 @@ Header: [[https://github.com/lode-org/readcon-db/blob/main/include/readcon-db.h]
20
20
  uint32_t rkrdb_abi_version_major(void);
21
21
  uint32_t rkrdb_abi_version_minor(void);
22
22
  uint32_t rkrdb_abi_layout_revision(void);
23
- const char *rkrdb_abi_stamp(void); /* "readcon-db/abi-1.3/layout-1" */
23
+ const char *rkrdb_abi_stamp(void); /* "readcon-db/abi-1.4/layout-1" */
24
24
  int rkrdb_abi_compatible(uint32_t major, uint32_t minor, uint32_t layout_revision);
25
25
  #+end_src
26
26
 
@@ -64,7 +64,7 @@ rkrdb_h5md_positions(id, 1, xyz, 4096, &nf, &na);
64
64
  double edges[64], frc[4096], vel[4096];
65
65
  rkrdb_h5md_edges(id, 1, edges, 64);
66
66
  rkrdb_h5md_forces(id, 1, frc, 4096);
67
- rkrdb_set_velocity_time_unit(id, "fs"); /* NULL clears; D10 override */
67
+ rkrdb_set_velocity_time_unit(id, "fs"); /* NULL clears; passed to velocity_file_time_unit */
68
68
  rkrdb_h5md_velocities(id, 1, vel, 4096);
69
69
  int32_t z[256]; uint32_t nz = 0;
70
70
  rkrdb_h5md_species(id, 1, z, 256, &nz);
@@ -99,7 +99,9 @@ Status: =RKRDB_OK= (0), =RKRDB_ERR= (-1), =RKRDB_NOT_FOUND= (-2), =RKRDB_NULL= (
99
99
 
100
100
  =rkrdb_get_frame= returns a parsed frame allocated in =libreadcon_db=. Free that pointer with =rkrdb_free_frame=. A null pointer is a no-op. =free_rkr_frame= in =libreadcon_core= frees with that library's allocator, and each shared library has its own copy, so it is not the matching free. Added in ABI 1.3.
101
101
 
102
- =rkrdb_h5md_*= returns =RKRDB_NULL= for an invalid handle. A collect failure returns =RKRDB_ERR= and leaves the message in =rkrdb_last_error=. =rkrdb_set_units= returns that missing-=units.time= error for a v3.1 clock or velocities frame instead of assuming =fs=. v1, v2, and v3.0 clocks with no =units.time= still convert as =fs=. H5MD velocities follow D10 and are written as =Angstrom ps-1=. v1, v2, and v3.0 frames use =(amu*angstrom^2/eV)^0.5= whatever the time label says. v3.1 frames use =units.time= and fail when a velocities section has no =units.time=. =rkrdb_set_velocity_time_unit= (C++ =Corpus::set_velocity_time_unit=) overrides that rule for a file that breaks it. Pass =fs= when the file really stored Angstrom/fs. The simulation clock uses =units.time= when that key is present. A v3.1 frame with =time= or =timestep= and no =units.time= is an error, and the same override supplies that missing clock unit. A present =units.time= still scales the clock. v1, v2, and v3.0 clocks with no =units.time= are read as =fs=.
102
+ =rkrdb_set_trajectory_metadata(id, traj, json)= replaces the caller-defined JSON object of one trajectory, such as the summary of the run that wrote it; frames appended later keep it. =rkrdb_trajectory_metadata(id, traj, buf, len, &out_len)= copies it back NUL-terminated and reports its length in =out_len= also when =buf= is too small (=RKRDB_ERR=), so a caller can size the buffer. Both return =RKRDB_NOT_FOUND= for a trajectory that does not exist, and the getter also when none was set. C++ =Corpus::set_trajectory_metadata= / =trajectory_metadata= (empty string when none). Added in ABI 1.4.
103
+
104
+ =rkrdb_h5md_*= returns =RKRDB_NULL= for an invalid handle. A collect failure returns =RKRDB_ERR= and leaves the message in =rkrdb_last_error=. =rkrdb_set_units= leaves a major below 4 clock in the natural unit when the time label changes. Major 4 scales the clock and the velocities by =units.time=, and a missing label is an error when the frame has a clock or velocities. H5MD velocities are written as =Angstrom ps-1=. Below major 4 the clock and the velocities are =(amu*angstrom^2/eV)^0.5= from =velocity_file_time_unit=, with or without =units.time=. Major 4 uses =units.time=. =rkrdb_set_velocity_time_unit= (C++ =Corpus::set_velocity_time_unit=) is passed through and does not replace that unit.
103
105
 
104
106
  Link =libreadcon_db= from =cargo build --release --features capi= (=cdylib= / =staticlib=), or unpack the prebuilt =readcon-db-clib-$VERSION-$target.tar.gz= Release asset and =pkg-config --libs readcon-db=. Without =capi= the library exports no =rkrdb_*= symbols. See @@rst::doc:`/howto/install`@@.
105
107
 
@@ -0,0 +1,138 @@
1
+ #+OPTIONS: toc:nil num:nil
2
+
3
+ * Python API
4
+ :PROPERTIES:
5
+ :CUSTOM_ID: python-api
6
+ :END:
7
+ Build the extension (from a checkout next to =readcon-core=):
8
+
9
+ #+begin_src sh
10
+ cd python
11
+ maturin develop --features python
12
+ #+end_src
13
+
14
+ #+begin_src python
15
+ from pathlib import Path
16
+ import readcon
17
+ from readcon_db import ConCorpus
18
+
19
+ db = ConCorpus("/tmp/corpus")
20
+ ro = ConCorpus("/tmp/corpus", readonly=True)
21
+ db.append_trajectory(1, "run.con")
22
+ db.append_trajectory_str(2, Path("run.con").read_text(), source="run.con")
23
+ db.append_trajectory_frames(3, readcon.read_con("run.con"))
24
+ keys = db.select(
25
+ traj_id=1,
26
+ symbol="Cu",
27
+ natoms_min=1,
28
+ natoms_max=10_000,
29
+ energy_min=-50.0,
30
+ energy_max=0.0,
31
+ require_forces=True,
32
+ )
33
+ h = db.frame_hash(1, 0) # bytes(16)
34
+ assert db.find_by_hash(h) == (1, 0)
35
+ db.index_canonical_identity()
36
+ hits = db.find_by_atom_order_path("product.con")
37
+ # hits[0].permutation[i] is the query index of stored atom i
38
+ text = db.get_frame_text(1, 0)
39
+ raw = ConCorpus.xxh3_128(b"blob")
40
+ h = ConCorpus.hash_con_text(Path("run.con").read_text()) # == db.frame_hash(1, 0)
41
+ frame = db.get_frame(1, 0) # StoredFrame, not a readcon.ConFrame
42
+ #+end_src
43
+
44
+ =get_frame= returns a =StoredFrame=. =frame.xyz= is the coordinate rows, =frame.atoms[i]= builds that atom only, and =frame.cell= and =frame.angles= are the box. =append_trajectory_frames= commits 64 frames at a time. Both are specified in @@rst::doc:`/howto/migration`@@ and exercised in @@rst::doc:`/howto/streaming`@@.
45
+
46
+ The generated page is @@rst::doc:`/reference/python-api`@@.
47
+
48
+ Optional =select= kwargs: ~exact_hash=~ (16-byte LE xxh3-128), =energy_min= / =energy_max=, =fmax_min= / =fmax_max=, =mass_min= / =mass_max=, =volume_min= / =volume_max=, =frame_index_min= / =frame_index_max=, =charge_min= / =charge_max=, =element_exact=, =element_min=, =formula=, =require_forces=, =require_velocities=, =require_energy=, =limit=.
49
+
50
+ ** Observation archives
51
+ :PROPERTIES:
52
+ :CUSTOM_ID: observation-archives
53
+ :END:
54
+ An observation archive is a corpus directory, =observations.rdb=, that a consumer such as a GP surrogate fills with the oracle evaluations it made. The C writer is =rkrdb_archive_open= / =rkrdb_archive_append=. =ObservationArchive= is the same writer in Python. =ArchiveReader= opens any corpus read-only and returns each stored frame as a =readcon.ConFrame=, so =readcon= must be installed.
55
+
56
+ #+begin_src python
57
+ from readcon_db import ArchiveReader
58
+
59
+ with ArchiveReader("out/obs-archive") as archive: # or ".../observations.rdb"
60
+ print(len(archive), archive.n_trajectories)
61
+ for obs in archive:
62
+ print(obs.traj_id, obs.frame_idx, obs.energy, obs.metadata["units"])
63
+ xyz = obs.frame.coords_array()[obs.caller_order]
64
+ forces = obs.frame.forces_array()[obs.caller_order]
65
+ last = archive[-1]
66
+ frame = archive.frame(traj_id=3) # readcon.ConFrame
67
+ text = archive.text(traj_id=3, frame_idx=0) # stored CON text
68
+ #+end_src
69
+
70
+ | Call | Returns |
71
+ |------+---------|
72
+ | =ArchiveReader(path)= | =path= is the corpus directory or the archive directory that holds =observations.rdb= |
73
+ | =len(archive)=, =archive.keys()= | observation count, and the =(traj_id, frame_idx)= keys in ascending order |
74
+ | =archive.n_trajectories=, =trajectory_ids()=, =n_frames(t)=, =source(t)= | trajectory count, ids, frames per trajectory, the source label the writer stored |
75
+ | =iter(archive)=, =archive[i]= | =Observation= objects in key order, =i= may be negative |
76
+ | =archive.get(t, f=0)=, =trajectory(t)= | one =Observation=, or every frame of one trajectory |
77
+ | =archive.frame(t, f=0)=, =text(t, f=0)= | the =readcon.ConFrame=, or the stored CON text |
78
+ | =refresh()= | takes the key list again and returns the new count |
79
+ | =archive.trajectory_metadata(t)= | the metadata dict the writer set on trajectory =t=, or =None= |
80
+ | =close()=, =closed= | closes the LMDB environment, and whether it is closed |
81
+
82
+ An =Observation= has =traj_id=, =frame_idx=, =key=, =index= (its position in key order), =text=, =frame=, =natoms=, =energy= and =metadata= (the JSON metadata line), and =caller_order=.
83
+
84
+ The archive writer stores one single-frame trajectory per evaluation, with trajectory ids =0, 1, 2, ...= in append order. Other writers can store several frames per trajectory, and the reader keys every frame. =frame= is in stored CON order, which groups atoms by type. The writer stores caller index =i= as the =atom_id= of each atom, and =caller_order[i]= is the stored row of caller atom =i=. A frame whose atom ids are not =0..natoms= raises =ValueError= on =caller_order=.
85
+
86
+ The key list is taken at open. A writer in another process can keep appending, and =refresh()= picks up the new rows. LMDB does not support opening one environment twice in the same process. Close an =ObservationArchive= before an =ArchiveReader= opens that archive in the same process. Reading takes a reader slot in =lock.mdb=, so the reader needs write permission on the corpus directory and its files. Without it the open fails with =ArchiveError= (=Permission denied=). Copy the archive first when it is not yours to write.
87
+
88
+ A missing path raises =FileNotFoundError=. A directory that holds no corpus, or one that LMDB cannot open, raises =readcon_db.ArchiveError= (a =RuntimeError=). An absent key or trajectory raises =KeyError=, a position past the end raises =IndexError=, and a closed reader raises =ValueError=.
89
+
90
+ #+begin_src python
91
+ from readcon_db import ObservationArchive
92
+
93
+ with ObservationArchive("out/obs-archive", atomic_numbers=[1, 8, 1], cell=[25.0, 25.0, 25.0]) as w:
94
+ w.append(positions, forces, energy) # (natoms, 3) rows, caller order
95
+ w.flush()
96
+ positions, forces, energy = w.fetch(0)
97
+ #+end_src
98
+
99
+ =append= queues the row for a background thread and returns. =flush= waits until every queued row is stored or counted in =dropped=. =committed= counts stored rows, including those from earlier runs.
100
+
101
+ ** MPI: pack on root, Bcast on the caller communicator
102
+ :PROPERTIES:
103
+ :CUSTOM_ID: mpi-pack-on-root-bcast-on-the-caller-communicator
104
+ :END:
105
+ ~bcast_packed_frame(comm, corpus_dir, traj_id, frame_idx, root=0)~ takes an *mpi4py* =Comm= --- LAMMPS =lmp.world=, =COMM_WORLD.Split(...)=, a =Dup=. mpi4py already called =MPI_Init=; the helper never does, and never names the process-wide world handle.
106
+
107
+ #+begin_src python
108
+ from mpi4py import MPI
109
+ from readcon_db import ConCorpus, bcast_packed_frame, bcast_packed_frames
110
+
111
+ # Host-owned comm. A LAMMPS Python fix passes lmp.world (or a split).
112
+ comm = MPI.COMM_WORLD.Dup()
113
+ blob = bcast_packed_frame(comm, "/scratch/corpus", traj_id=1, frame_idx=0)
114
+ xyz = ConCorpus.unpack_positions(blob)
115
+ batch = bcast_packed_frames(comm, "/scratch/corpus", [(1, 0), (1, 1), (1, 2)])
116
+ frames = ConCorpus.unpack_batch(batch)
117
+ comm.Free()
118
+ #+end_src
119
+
120
+ Cooked H5MD 1.1 interchange (h5py; fixed =natoms=; CON stays authority):
121
+
122
+ #+begin_src python
123
+ db.export_h5md(traj_id=1, path="traj.h5")
124
+ #+end_src
125
+
126
+ Dest must not exist. =File= ="x"=; a write failure removes the dest.
127
+
128
+ The file has =/h5md= version =[1,1]= with =author=/=creator=, =particles/all/position/value= of shape =[T][N][3]=, =position/step= and =position/time= of shape =[T]=, =box/edges/value= of shape =[T][3][3]=, integer-Z =species=, optional =particles/all/velocity= =[T][N][3]= (dest =Angstrom ps-1=), and unit attributes for one engine system (like metatomic model vs engine): length =Angstrom=, time =ps=, force =kJ mol-1 Angstrom-1=, velocity =Angstrom ps-1=. Below major 4 the clock and the velocities are the natural unit =(amu*angstrom^2/eV)^0.5= from =velocity_file_time_unit=, with or without =units.time=. Major 4 uses =units.time=. A missing major-4 label is an error when the frame has a clock or velocities. ~export_h5md(traj_id, path, velocity_time_unit=None)~ passes that override through and does not replace the assigned unit. CON =units.length= / =units.energy= convert through =unit_conversion_factor= (SI). Time is CON =header.time()=, or =i * timestep=, else the frame index, all in =ps=. =unit_conversion_factor(from, to)= and =canonicalize_unit(expr)= are on the Python module. Callers write aliases (=A=, =ev=, =femtosecond=); ~append_trajectory(..., units={...})~, ~extend_trajectory(..., units={...})~, ~ingest_directory(..., units={...})~, and =set_units(traj_id, {...})= store canonical names (=angstrom=, =eV=, =fs=) in CON metadata. =append= / =extend= stamp the incoming numbers; =set_units= converts stored numbers so the new label is honest. Below major 4 =set_units= does not rescale the clock or the velocities when the time label changes. Major 4 scales both by =units.time=. =get_units(traj_id, frame_idx)= returns the stored units JSON as a string. =set_trajectory_metadata(traj_id, {...})= stores one JSON object that describes a trajectory as a whole (a run summary, say) and =trajectory_metadata(traj_id)= returns it, or =None=; frames appended later keep it, and an unknown trajectory raises =KeyError=. Mixed-force trajectories write a full =[T][N][3]= force dataset (zeros on frames without forces). Mixed-velocity trajectories write a full =[T][N][3]= velocity dataset the same way. Box =boundary= follows CON =pbc= (periodic when absent). =author=/=creator=/=boundary= attrs are fixed-length ASCII. Physical =unit= attrs are short H5MD strings (MDAnalysis 2.10 indexes them as dict keys).
129
+
130
+ Standalone: =examples/mpi_bcast_frame.py=.
131
+
132
+ ** Cooked SoA (RCSO)
133
+ :PROPERTIES:
134
+ :CUSTOM_ID: cooked-soa-rcso
135
+ :END:
136
+ See @@rst::doc:`/cooked-soa`@@.
137
+ Tier is opt-in; the =.con= text remains authority.
138
+ Bindings expose cook / delete / has-valid / positions / forces / velocities.
@@ -100,7 +100,9 @@ join_drained_roots(&[dest_a, dest_b], joined)?;
100
100
 
101
101
  =ConCorpus::hash_con_text= and =readcon-db hash-file <file.con>= hash the first frame's source span, the bytes =append_trajectory_str= and =extend_trajectory_str= store and hash. The text is not parsed and written back first, so a high-precision file gives the stored hash and =find_by_hash= finds its trajectory.
102
102
 
103
- =set_trajectory_units= converts stored numbers. A v3.1 clock or velocities frame with no =units.time= is an error, not a silent =fs=; v1, v2, and v3.0 clocks with no =units.time= still convert as =fs=. =append_trajectory_path_units= and =extend_trajectory_path_units= stamp incoming frames. H5MD velocities follow D10 and are written as =Angstrom ps-1=. v1, v2, and v3.0 frames use =(amu*angstrom^2/eV)^0.5= whatever the time label says. v3.1 frames use =units.time= and =collect_h5md= fails when velocities have no =units.time=. =H5mdCollectOpts.velocity_time_unit= overrides that rule for a file that breaks it. The clock (=time=, =timestep=, H5MD time) uses =units.time= when that key is present. A v3.1 frame with =time= or =timestep= and no =units.time= is an error, and the same override supplies that missing clock unit. A present =units.time= still scales the clock. v1, v2, and v3.0 clocks with no =units.time= are read as =fs=.
103
+ =set_trajectory_units= converts stored numbers. Below major 4 a time-label change does not rescale the clock or the velocities. Major 4 scales both by =units.time=, and a missing label is an error when the frame has a clock or velocities. =append_trajectory_path_units= and =extend_trajectory_path_units= stamp incoming frames. H5MD velocities are written as =Angstrom ps-1=. The clock and the velocities use =velocity_file_time_unit=: below major 4 that is =(amu*angstrom^2/eV)^0.5=, with or without =units.time=, and major 4 uses =units.time=. =H5mdCollectOpts.velocity_time_unit= is passed through and does not replace that unit.
104
+
105
+ =set_trajectory_metadata(traj_id, json!({...}))= stores one JSON object that describes a trajectory as a whole (=TrajMeta.metadata=), for example the summary of the run that produced it. Appends keep it. =trajectory_metadata(traj_id)= returns it, =None= when none was set, and =Error::MissingFrame= for =(traj_id, 0)= when the trajectory does not exist. A stored =TrajMeta= without the field reads as before.
104
106
 
105
107
  ** Cooked SoA (RCSO)
106
108
  :PROPERTIES:
@@ -1,6 +1,6 @@
1
1
  name = "ReadConDb"
2
2
  # [[[cog cog.outl(f'version = "{VERSION}"') ]]]
3
- version = "0.2.4"
3
+ version = "0.3.0"
4
4
  # [[[end]]]
5
5
  license = "MIT"
6
6
  [build]