readcon-db 0.2.1__tar.gz → 0.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. {readcon_db-0.2.1 → readcon_db-0.2.2}/.github/workflows/ci_mpi.yml +5 -1
  2. {readcon_db-0.2.1 → readcon_db-0.2.2}/CHANGELOG.md +18 -1
  3. {readcon_db-0.2.1 → readcon_db-0.2.2}/CITATION.cff +1 -1
  4. {readcon_db-0.2.1 → readcon_db-0.2.2}/Cargo.lock +4 -3
  5. {readcon_db-0.2.1 → readcon_db-0.2.2}/Cargo.toml +2 -2
  6. {readcon_db-0.2.1 → readcon_db-0.2.2}/PKG-INFO +1 -1
  7. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/orgmode/explanation/architecture.org +4 -0
  8. readcon_db-0.2.2/docs/orgmode/howto/atom-order.org +87 -0
  9. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/orgmode/index.org +1 -0
  10. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/orgmode/reference/python.org +3 -0
  11. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/orgmode/reference/rust.org +13 -0
  12. {readcon_db-0.2.1 → readcon_db-0.2.2}/fortran/ReadConDb/fpm.toml +1 -1
  13. {readcon_db-0.2.1 → readcon_db-0.2.2}/pixi.toml +1 -1
  14. readcon_db-0.2.2/python/tests/test_atom_order.py +58 -0
  15. readcon_db-0.2.2/python/tests/test_catalog_claims.py +132 -0
  16. {readcon_db-0.2.1 → readcon_db-0.2.2}/python/tests/test_streaming_guide.py +7 -1
  17. {readcon_db-0.2.1 → readcon_db-0.2.2}/scripts/build-docs.sh +58 -1
  18. {readcon_db-0.2.1 → readcon_db-0.2.2}/scripts/check_version_lockstep.py +2 -1
  19. {readcon_db-0.2.1 → readcon_db-0.2.2}/src/bin/readcon-db.rs +31 -0
  20. readcon_db-0.2.2/src/canonical.rs +206 -0
  21. readcon_db-0.2.2/src/catalog.rs +829 -0
  22. {readcon_db-0.2.1 → readcon_db-0.2.2}/src/corpus.rs +317 -21
  23. {readcon_db-0.2.1 → readcon_db-0.2.2}/src/error.rs +23 -0
  24. {readcon_db-0.2.1 → readcon_db-0.2.2}/src/lib.rs +11 -1
  25. {readcon_db-0.2.1 → readcon_db-0.2.2}/src/python.rs +256 -1
  26. {readcon_db-0.2.1 → readcon_db-0.2.2}/src/shard.rs +33 -0
  27. readcon_db-0.2.2/tests/atom_order.rs +231 -0
  28. readcon_db-0.2.2/tests/catalog_claims.rs +633 -0
  29. {readcon_db-0.2.1 → readcon_db-0.2.2}/.github/workflows/c_lib_tarball.yml +0 -0
  30. {readcon_db-0.2.1 → readcon_db-0.2.2}/.github/workflows/ci.yml +0 -0
  31. {readcon_db-0.2.1 → readcon_db-0.2.2}/.github/workflows/ci_cxx.yml +0 -0
  32. {readcon_db-0.2.1 → readcon_db-0.2.2}/.github/workflows/ci_docs.yml +0 -0
  33. {readcon_db-0.2.1 → readcon_db-0.2.2}/.github/workflows/ci_prek.yml +0 -0
  34. {readcon_db-0.2.1 → readcon_db-0.2.2}/.github/workflows/crates_publish.yml +0 -0
  35. {readcon_db-0.2.1 → readcon_db-0.2.2}/.github/workflows/cxx_tarball.yml +0 -0
  36. {readcon_db-0.2.1 → readcon_db-0.2.2}/.github/workflows/lint.yml +0 -0
  37. {readcon_db-0.2.1 → readcon_db-0.2.2}/.github/workflows/pages.yml +0 -0
  38. {readcon_db-0.2.1 → readcon_db-0.2.2}/.github/workflows/python-wheels.yml +0 -0
  39. {readcon_db-0.2.1 → readcon_db-0.2.2}/.gitignore +0 -0
  40. {readcon_db-0.2.1 → readcon_db-0.2.2}/CMakeLists.txt +0 -0
  41. {readcon_db-0.2.1 → readcon_db-0.2.2}/CODE_OF_CONDUCT.md +0 -0
  42. {readcon_db-0.2.1 → readcon_db-0.2.2}/CONTRIBUTING.md +0 -0
  43. {readcon_db-0.2.1 → readcon_db-0.2.2}/LICENSE +0 -0
  44. {readcon_db-0.2.1 → readcon_db-0.2.2}/README.md +0 -0
  45. {readcon_db-0.2.1 → readcon_db-0.2.2}/SECURITY.md +0 -0
  46. {readcon_db-0.2.1 → readcon_db-0.2.2}/assets/logo/BRAND.md +0 -0
  47. {readcon_db-0.2.1 → readcon_db-0.2.2}/assets/logo/readcon-db-logo-512.png +0 -0
  48. {readcon_db-0.2.1 → readcon_db-0.2.2}/assets/logo/readcon-db-logo-raster.jpg +0 -0
  49. {readcon_db-0.2.1 → readcon_db-0.2.2}/assets/logo/readcon-db-logo.svg +0 -0
  50. {readcon_db-0.2.1 → readcon_db-0.2.2}/assets/logo/readcon-db-wordmark.svg +0 -0
  51. {readcon_db-0.2.1 → readcon_db-0.2.2}/bench/gen_con.py +0 -0
  52. {readcon_db-0.2.1 → readcon_db-0.2.2}/bench/mpi_bench.sh +0 -0
  53. {readcon_db-0.2.1 → readcon_db-0.2.2}/bench/vary_con.py +0 -0
  54. {readcon_db-0.2.1 → readcon_db-0.2.2}/cmake/readcon-db-config-version.in.cmake +0 -0
  55. {readcon_db-0.2.1 → readcon_db-0.2.2}/cmake/readcon-db-config.in.cmake +0 -0
  56. {readcon_db-0.2.1 → readcon_db-0.2.2}/cmake/readcon-db.pc.in +0 -0
  57. {readcon_db-0.2.1 → readcon_db-0.2.2}/cmake/tempdir.cmake +0 -0
  58. {readcon_db-0.2.1 → readcon_db-0.2.2}/cog.toml +0 -0
  59. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/Makefile +0 -0
  60. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/_static/logo.svg +0 -0
  61. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/orgmode/changelog.org +0 -0
  62. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/orgmode/contributing/index.org +0 -0
  63. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/orgmode/cooked-soa.org +0 -0
  64. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/orgmode/explanation/design.org +0 -0
  65. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/orgmode/explanation/faq.org +0 -0
  66. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/orgmode/explanation/overview.org +0 -0
  67. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/orgmode/howto/campaign.org +0 -0
  68. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/orgmode/howto/howto.org +0 -0
  69. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/orgmode/howto/install.org +0 -0
  70. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/orgmode/howto/migration.org +0 -0
  71. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/orgmode/howto/mpi.org +0 -0
  72. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/orgmode/howto/streaming.org +0 -0
  73. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/orgmode/howto/topology.org +0 -0
  74. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/orgmode/howto/workflows.org +0 -0
  75. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/orgmode/readme.org +0 -0
  76. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/orgmode/reference/c.org +0 -0
  77. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/orgmode/reference/citation.org +0 -0
  78. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/orgmode/reference/fortran.org +0 -0
  79. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/orgmode/reference/python-api.org +0 -0
  80. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/orgmode/tutorials/getting-started.org +0 -0
  81. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/orgmode/tutorials/tutorial-run.log +0 -0
  82. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/orgmode/tutorials/tutorial-run.sh +0 -0
  83. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/orgmode/tutorials/tutorial.org +0 -0
  84. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/requirements.txt +0 -0
  85. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/source/_static/custom.css +0 -0
  86. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/source/_static/favicon.svg +0 -0
  87. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/source/_static/logo-nav-dark.svg +0 -0
  88. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/source/_static/logo-nav-light.svg +0 -0
  89. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/source/_static/logo.svg +0 -0
  90. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/source/_static/mark.svg +0 -0
  91. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/source/_templates/partials/extra-foot.html +0 -0
  92. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/source/_templates/partials/extra-head.html +0 -0
  93. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/source/_templates/partials/site-foot.html +0 -0
  94. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/source/_templates/partials/webfonts.html +0 -0
  95. {readcon_db-0.2.1 → readcon_db-0.2.2}/docs/source/conf.py +0 -0
  96. {readcon_db-0.2.1 → readcon_db-0.2.2}/examples/bench_corpus_ops.rs +0 -0
  97. {readcon_db-0.2.1 → readcon_db-0.2.2}/examples/bench_vs_ase_prep.py +0 -0
  98. {readcon_db-0.2.1 → readcon_db-0.2.2}/examples/benchmarks/ase_db_bench.json +0 -0
  99. {readcon_db-0.2.1 → readcon_db-0.2.2}/examples/benchmarks/ase_fair_campaign_1.json +0 -0
  100. {readcon_db-0.2.1 → readcon_db-0.2.2}/examples/benchmarks/bench_ase_db.py +0 -0
  101. {readcon_db-0.2.1 → readcon_db-0.2.2}/examples/benchmarks/db_vs_ase_table.md +0 -0
  102. {readcon_db-0.2.1 → readcon_db-0.2.2}/examples/benchmarks/fair_campaign.py +0 -0
  103. {readcon_db-0.2.1 → readcon_db-0.2.2}/examples/benchmarks/fair_db_vs_ase_table.md +0 -0
  104. {readcon_db-0.2.1 → readcon_db-0.2.2}/examples/benchmarks/readcon_db_bench.json +0 -0
  105. {readcon_db-0.2.1 → readcon_db-0.2.2}/examples/benchmarks/results_merged.json +0 -0
  106. {readcon_db-0.2.1 → readcon_db-0.2.2}/examples/benchmarks/test_fair_select_parity.py +0 -0
  107. {readcon_db-0.2.1 → readcon_db-0.2.2}/examples/ingest_select.rs +0 -0
  108. {readcon_db-0.2.1 → readcon_db-0.2.2}/examples/mpi_bcast_frame.c +0 -0
  109. {readcon_db-0.2.1 → readcon_db-0.2.2}/examples/mpi_bcast_frame.f90 +0 -0
  110. {readcon_db-0.2.1 → readcon_db-0.2.2}/examples/mpi_bcast_frame.py +0 -0
  111. {readcon_db-0.2.1 → readcon_db-0.2.2}/examples/mpi_ingest_check.rs +0 -0
  112. {readcon_db-0.2.1 → readcon_db-0.2.2}/examples/mpi_read_check.rs +0 -0
  113. {readcon_db-0.2.1 → readcon_db-0.2.2}/examples/shard_gate.rs +0 -0
  114. {readcon_db-0.2.1 → readcon_db-0.2.2}/examples/workflows/metatrain_from_con.md +0 -0
  115. {readcon_db-0.2.1 → readcon_db-0.2.2}/examples/workflows/options.metatrain.snippet.yaml +0 -0
  116. {readcon_db-0.2.1 → readcon_db-0.2.2}/fortran/README.md +0 -0
  117. {readcon_db-0.2.1 → readcon_db-0.2.2}/fortran/ReadConDb/src/readcon_db.f90 +0 -0
  118. {readcon_db-0.2.1 → readcon_db-0.2.2}/include/readcon-db-mpi.h +0 -0
  119. {readcon_db-0.2.1 → readcon_db-0.2.2}/include/readcon-db.h +0 -0
  120. {readcon_db-0.2.1 → readcon_db-0.2.2}/lychee.toml +0 -0
  121. {readcon_db-0.2.1 → readcon_db-0.2.2}/meson.build +0 -0
  122. {readcon_db-0.2.1 → readcon_db-0.2.2}/meson_options.txt +0 -0
  123. {readcon_db-0.2.1 → readcon_db-0.2.2}/packaging/wrapdb/README.md +0 -0
  124. {readcon_db-0.2.1 → readcon_db-0.2.2}/packaging/wrapdb/readcon-db.wrap.in +0 -0
  125. {readcon_db-0.2.1 → readcon_db-0.2.2}/paper/cpc/freeze/ase_fair_campaign_1.json +0 -0
  126. {readcon_db-0.2.1 → readcon_db-0.2.2}/paper/cpc/freeze/fair_db_vs_ase_table.md +0 -0
  127. {readcon_db-0.2.1 → readcon_db-0.2.2}/paper/cpc/readme.org +0 -0
  128. {readcon_db-0.2.1 → readcon_db-0.2.2}/paper/cpc/scripts/gen_fair_table.py +0 -0
  129. {readcon_db-0.2.1 → readcon_db-0.2.2}/paper/cpc/src/appendix-fair-campaign.org +0 -0
  130. {readcon_db-0.2.1 → readcon_db-0.2.2}/paper/cpc/src/figures/generated/fair_campaign_table.tex +0 -0
  131. {readcon_db-0.2.1 → readcon_db-0.2.2}/pixi.lock +0 -0
  132. {readcon_db-0.2.1 → readcon_db-0.2.2}/pr-text.md +0 -0
  133. {readcon_db-0.2.1 → readcon_db-0.2.2}/prek.toml +0 -0
  134. {readcon_db-0.2.1 → readcon_db-0.2.2}/pyproject.toml +0 -0
  135. {readcon_db-0.2.1 → readcon_db-0.2.2}/python/pyproject.toml +0 -0
  136. {readcon_db-0.2.1 → readcon_db-0.2.2}/python/tests/test_export_h5md.py +0 -0
  137. {readcon_db-0.2.1 → readcon_db-0.2.2}/python/tests/test_ingest_memory.py +0 -0
  138. {readcon_db-0.2.1 → readcon_db-0.2.2}/python/tests/test_stream_and_random.py +0 -0
  139. {readcon_db-0.2.1 → readcon_db-0.2.2}/resources/test/eon36_lj_dimer.convel +0 -0
  140. {readcon_db-0.2.1 → readcon_db-0.2.2}/resources/test/sulfolene.con +0 -0
  141. {readcon_db-0.2.1 → readcon_db-0.2.2}/resources/test/tiny_cuh2.con +0 -0
  142. {readcon_db-0.2.1 → readcon_db-0.2.2}/resources/test/tiny_cuh2.convel +0 -0
  143. {readcon_db-0.2.1 → readcon_db-0.2.2}/resources/test/tiny_cuh2_forces.con +0 -0
  144. {readcon_db-0.2.1 → readcon_db-0.2.2}/resources/test/tiny_cuh2_vel_forces.con +0 -0
  145. {readcon_db-0.2.1 → readcon_db-0.2.2}/resources/test/tiny_multi_cuh2.con +0 -0
  146. {readcon_db-0.2.1 → readcon_db-0.2.2}/scripts/assemble-site.sh +0 -0
  147. {readcon_db-0.2.1 → readcon_db-0.2.2}/scripts/check-clib-dist.sh +0 -0
  148. {readcon_db-0.2.1 → readcon_db-0.2.2}/scripts/check-cpc-freeze.sh +0 -0
  149. {readcon_db-0.2.1 → readcon_db-0.2.2}/scripts/check-cxx-dist.sh +0 -0
  150. {readcon_db-0.2.1 → readcon_db-0.2.2}/scripts/crate_version.py +0 -0
  151. {readcon_db-0.2.1 → readcon_db-0.2.2}/scripts/export-landing.sh +0 -0
  152. {readcon_db-0.2.1 → readcon_db-0.2.2}/scripts/meson_cargo_build.py +0 -0
  153. {readcon_db-0.2.1 → readcon_db-0.2.2}/scripts/package-clib.sh +0 -0
  154. {readcon_db-0.2.1 → readcon_db-0.2.2}/scripts/package-cxx.sh +0 -0
  155. {readcon_db-0.2.1 → readcon_db-0.2.2}/scripts/release-prep.sh +0 -0
  156. {readcon_db-0.2.1 → readcon_db-0.2.2}/scripts/set-version.sh +0 -0
  157. {readcon_db-0.2.1 → readcon_db-0.2.2}/scripts/sync-version.py +0 -0
  158. {readcon_db-0.2.1 → readcon_db-0.2.2}/scripts/test_check_version_lockstep.py +0 -0
  159. {readcon_db-0.2.1 → readcon_db-0.2.2}/src/archive.rs +0 -0
  160. {readcon_db-0.2.1 → readcon_db-0.2.2}/src/cooked_soa.rs +0 -0
  161. {readcon_db-0.2.1 → readcon_db-0.2.2}/src/export_h5md.rs +0 -0
  162. {readcon_db-0.2.1 → readcon_db-0.2.2}/src/export_xyz.rs +0 -0
  163. {readcon_db-0.2.1 → readcon_db-0.2.2}/src/ffi.rs +0 -0
  164. {readcon_db-0.2.1 → readcon_db-0.2.2}/src/frame_codec.rs +0 -0
  165. {readcon_db-0.2.1 → readcon_db-0.2.2}/src/frame_scalars.rs +0 -0
  166. {readcon_db-0.2.1 → readcon_db-0.2.2}/src/keys.rs +0 -0
  167. {readcon_db-0.2.1 → readcon_db-0.2.2}/src/mpi_ingest.rs +0 -0
  168. {readcon_db-0.2.1 → readcon_db-0.2.2}/src/mpi_read.rs +0 -0
  169. {readcon_db-0.2.1 → readcon_db-0.2.2}/src/mpi_wire.rs +0 -0
  170. {readcon_db-0.2.1 → readcon_db-0.2.2}/src/select.rs +0 -0
  171. {readcon_db-0.2.1 → readcon_db-0.2.2}/src/topology.rs +0 -0
  172. {readcon_db-0.2.1 → readcon_db-0.2.2}/src/units_canon.rs +0 -0
  173. {readcon_db-0.2.1 → readcon_db-0.2.2}/tests/canonical_dump.rs +0 -0
  174. {readcon_db-0.2.1 → readcon_db-0.2.2}/tests/cli_refuse.rs +0 -0
  175. {readcon_db-0.2.1 → readcon_db-0.2.2}/tests/cmake-project/CMakeLists.txt +0 -0
  176. {readcon_db-0.2.1 → readcon_db-0.2.2}/tests/cmake-project/main.c +0 -0
  177. {readcon_db-0.2.1 → readcon_db-0.2.2}/tests/cooked_soa_authority.rs +0 -0
  178. {readcon_db-0.2.1 → readcon_db-0.2.2}/tests/meson-wrap/main.c +0 -0
  179. {readcon_db-0.2.1 → readcon_db-0.2.2}/tests/meson-wrap/meson.build +0 -0
  180. {readcon_db-0.2.1 → readcon_db-0.2.2}/tests/mpi-c/ingest_smoke.c +0 -0
  181. {readcon_db-0.2.1 → readcon_db-0.2.2}/tests/topology_cli.rs +0 -0
  182. {readcon_db-0.2.1 → readcon_db-0.2.2}/website/assets/logo.svg +0 -0
  183. {readcon_db-0.2.1 → readcon_db-0.2.2}/website/assets/wordmark.svg +0 -0
  184. {readcon_db-0.2.1 → readcon_db-0.2.2}/website/css/site.css +0 -0
  185. {readcon_db-0.2.1 → readcon_db-0.2.2}/website/export.el +0 -0
  186. {readcon_db-0.2.1 → readcon_db-0.2.2}/website/index.html +0 -0
  187. {readcon_db-0.2.1 → readcon_db-0.2.2}/website/index.org +0 -0
@@ -41,7 +41,11 @@ jobs:
41
41
  mpich_4.2.0-5.1_amd64.deb \
42
42
  libmpich-dev_4.2.0-5.1_amd64.deb
43
43
  do
44
- curl -fsSL -o "$d/$f" "https://launchpad.net/ubuntu/+archive/primary/+files/$f"
44
+ # Launchpad answers 503 under load (curl exit 22). The file is
45
+ # still the Hydra build; retry the transient archive failure.
46
+ curl -fsSL --retry 5 --retry-delay 2 --retry-all-errors \
47
+ -o "$d/$f" \
48
+ "https://launchpad.net/ubuntu/+archive/primary/+files/$f"
45
49
  done
46
50
  sudo dpkg -i \
47
51
  "$d/libmpich12_4.2.0-5.1_amd64.deb" \
@@ -1,10 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.2.2 - 2026-11-19
4
+ #### Features
5
+ - (**python**) add insert_catalog_record and list_catalog_records - (218ff19) - *HaoZeke*
6
+ - (**catalog**) finalize catalog records and leased claims; dumps and shard rebuilds keep catalog rows, and claim errors subclass RuntimeError - (218ff19) - *HaoZeke*
7
+ - (**catalog**) take the claim lease clock from the corpus - (ee80d62) - *HaoZeke*
8
+ - (**identity**) opt-in canonical hash for frames that differ by atom-id order - (34c88b8) - *HaoZeke*
9
+ #### Bug Fixes
10
+ - (**ci**) retry the MPICH deb download after a launchpad 503 - (da7d307) - *HaoZeke*
11
+ - (**docs**) write the rustdoc root page help and settings link to - (3f91bee) - *HaoZeke*
12
+ - (**docs**) fetch crates before the docs rustdoc build - (ff3a169) - *HaoZeke*
13
+ #### Documentation
14
+ - link the canonical identity note to reorder_like - (39ee7bb) - *HaoZeke*
15
+ #### Tests
16
+ - pin the lease window with a hand-advanced clock - (07ecd24) - *HaoZeke*
17
+ #### Build system
18
+ - (**reader**) require readcon-core 0.21.0 for atom-id correspondence
19
+
3
20
  ## v0.2.1 - 2026-11-11
4
21
  #### Bug Fixes
5
22
  - stream corpus append and parse one stored frame - (623ff00) - *HaoZeke*
6
23
  #### Documentation
7
- - document streaming append and publish the API reference - (16baa43) - *HaoZeke*
24
+ - document streaming append and publish the API reference - (e43f6f8) - *HaoZeke*
8
25
  - rebuild the tutorial on recorded output and fix stale install, C, and link defects (#26) - (9cf3abf) - *HaoZeke*
9
26
 
10
27
  ## v0.2.0 - 2026-10-15
@@ -10,7 +10,7 @@ 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.1
13
+ version: 0.2.2
14
14
  # [[[end]]]
15
15
  date-released: "2026-08-15"
16
16
  keywords:
@@ -850,14 +850,15 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3"
850
850
 
851
851
  [[package]]
852
852
  name = "readcon-core"
853
- version = "0.17.1"
853
+ version = "0.21.0"
854
854
  source = "registry+https://github.com/rust-lang/crates.io-index"
855
- checksum = "c8c9ec4a34748765fc3ef137aef2c4eb007b0ae395dd2ac165071471e6fcaf0c"
855
+ checksum = "08b9703489462ee25ce5ccc00bc357ec2a14c08a5ea2de6778ca612b64839060"
856
856
  dependencies = [
857
857
  "dlpk",
858
858
  "fast-float2",
859
859
  "flate2",
860
860
  "half 1.8.3",
861
+ "libc",
861
862
  "memchr",
862
863
  "memmap2",
863
864
  "ndarray",
@@ -868,7 +869,7 @@ dependencies = [
868
869
 
869
870
  [[package]]
870
871
  name = "readcon-db"
871
- version = "0.2.1"
872
+ version = "0.2.2"
872
873
  dependencies = [
873
874
  "heed",
874
875
  "libc",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "readcon-db"
3
- version = "0.2.1"
3
+ version = "0.2.2"
4
4
  edition = "2021"
5
5
  description = "Mmap-backed CON frame corpus (Heed/LMDB), xxHash exact match, multi-language FFI"
6
6
  license = "MIT"
@@ -27,7 +27,7 @@ mpi = ["dep:mpi"]
27
27
  [dependencies]
28
28
  heed = "0.21"
29
29
  # The pinned writer provides exact numeric CON and JSON round trips.
30
- readcon-core = "=0.17.1"
30
+ readcon-core = "=0.21.0"
31
31
  thiserror = "2"
32
32
  serde = { version = "1", features = ["derive"] }
33
33
  serde_json = "1"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: readcon-db
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Mmap CON corpus store (LMDB/Heed) with xxHash exact match
5
5
  Home-Page: https://lode-org.github.io/readcon-db/
6
6
  License: MIT
@@ -35,6 +35,8 @@ Environment (Heed / LMDB)
35
35
  ├── idx_formula : `Cu:2|H:2` ‖ 0xFF ‖ FrameKey
36
36
  ├── idx_topo : topology-key utf-8 ‖ 0xFF ‖ FrameKey # optional; empty if missing on readonly
37
37
  ├── topo_by_frame : FrameKey → topology key # optional; authority for matching reindex
38
+ ├── idx_canon : version ‖ canonical xxh3-128 ‖ FrameKey # optional; atom-id order
39
+ ├── canon_by_frame : FrameKey → version ‖ canonical hash ‖ content hash
38
40
  ├── idx_flags : (flag_id ‖ FrameKey) → () # forces / velocities / has_energy
39
41
  ├── frame_by_hash : xxh3-128 → FrameKey (first wins)
40
42
  ├── frames_soa : FrameKey → RCSO cooked numerics (optional, derived)
@@ -43,6 +45,8 @@ Environment (Heed / LMDB)
43
45
 
44
46
  =idx_topo= and =topo_by_frame= are created on write-open. A readonly open of an older corpus that lacks them treats the topology index as empty.
45
47
 
48
+ =idx_canon= and =canon_by_frame= are created on write-open and stay empty until =index_canonical_identity=. The version byte is 1: atoms in increasing =atom_id= order, then xxHash3-128 of the canonical CON writer bytes. The content hash in =hash_by_frame= is still the stored CON bytes. A readonly open of an older corpus that lacks the two databases has no canonical index. See @@rst::doc:`/howto/atom-order`@@.
49
+
46
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.
47
51
 
48
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=.
@@ -0,0 +1,87 @@
1
+ #+OPTIONS: toc:nil num:nil
2
+
3
+ * How-to: atom-id identity
4
+ :PROPERTIES:
5
+ :CUSTOM_ID: how-to-atom-id-identity
6
+ :END:
7
+ The content hash is xxHash3-128 of the stored CON bytes. CON writes one element block per run, in the order the elements were first seen, so the same atoms with the same =atom_id= values are a different hash when a later file emits oxygen before carbon. Column 5 is that id. It stays with the atom.
8
+
9
+ The canonical identity is optional. It reorders the rows into increasing =atom_id= and hashes that text. =hash_by_frame= and =frame_by_hash= are not modified, and a corpus that never runs the indexer has no new keys.
10
+
11
+ ** What is stored
12
+ :PROPERTIES:
13
+ :CUSTOM_ID: what-is-stored
14
+ :END:
15
+ Version 1 is the byte in front of the hash.
16
+
17
+ - =canon_by_frame= maps a 12-byte =FrameKey= to the version byte, the 16-byte canonical hash, and the 16-byte content hash taken when the frame was indexed.
18
+ - =idx_canon= maps version byte, canonical hash, and =FrameKey= to an empty value. A prefix scan on the version and the hash returns every stored frame with that identity.
19
+
20
+ The canonical bytes are the CON writer in canonical mode: round-trip floats, metadata keys sorted. The row order is =reorder_like= into increasing =atom_id=, with the strict check (symbol, mass within 1e-8, and fixed mask). A duplicate =atom_id= is an error before anything is hashed. A readonly open of an older corpus that lacks these two databases has no canonical index.
21
+
22
+ ** Index a corpus
23
+ :PROPERTIES:
24
+ :CUSTOM_ID: index-a-corpus
25
+ :END:
26
+ #+begin_src sh
27
+ readcon-db ingest /tmp/corpus reactant.con
28
+ readcon-db index-canonical /tmp/corpus
29
+ #+end_src
30
+
31
+ Rust:
32
+
33
+ #+begin_src rust
34
+ use readcon_db::ConCorpus;
35
+
36
+ let db = ConCorpus::open("/tmp/corpus")?;
37
+ db.append_trajectory_path(1, "reactant.con")?;
38
+ db.index_canonical_identity()?;
39
+ #+end_src
40
+
41
+ Python:
42
+
43
+ #+begin_src python
44
+ db.index_canonical_identity()
45
+ #+end_src
46
+
47
+ Ingest does not fill the index. =set_trajectory_units=, or any other rewrite of the stored CON text, leaves the index stale. Run =index-canonical= again. =reindex= rebuilds the content-hash indexes and leaves this one in place.
48
+
49
+ ** Look up a reordered frame
50
+ :PROPERTIES:
51
+ :CUSTOM_ID: look-up-a-reordered-frame
52
+ :END:
53
+ #+begin_src sh
54
+ readcon-db find-by-atom-order /tmp/corpus product.con
55
+ #+end_src
56
+
57
+ A hit is one line:
58
+
59
+ #+begin_src text
60
+ query 0: traj=1 frame=0 permutation=1,2,0
61
+ #+end_src
62
+
63
+ =query= is the zero-based frame in the file. =permutation[i]= is the index in that query frame of the atom whose =atom_id= equals stored atom =i=. That is =atom_id_permutation= with the stored frame as the reference. No hit prints =query 0: 0 keys=.
64
+
65
+ Rust and Python return the same permutation as a list of indexes:
66
+
67
+ #+begin_src rust
68
+ let hits = db.find_by_atom_order_path("product.con")?;
69
+ let perm = &hits[0].permutation;
70
+ #+end_src
71
+
72
+ #+begin_src python
73
+ hits = db.find_by_atom_order_path("product.con")
74
+ perm = hits[0].permutation
75
+ #+end_src
76
+
77
+ =find_by_atom_order= takes CON text instead of a path. =frame_canonical_identity(traj_id, frame_idx)= recomputes the version and the hash from the stored text and does not read the index.
78
+
79
+ A coordinate that moved, including one stored a cell away, is a different canonical hash. This lookup does not wrap displacements.
80
+
81
+ ** Errors
82
+ :PROPERTIES:
83
+ :CUSTOM_ID: errors
84
+ :END:
85
+ Duplicate ids, an id present on only one of the two frames, and a symbol mismatch fail with a message that names the =atom_id=. The strict check also names a mass or fixed-mask mismatch. A corpus with frames and an empty canonical index, a count that no longer matches the frame count, or a stored content hash that no longer matches the indexed one, fails with a message that names =index-canonical=.
86
+
87
+ The content hash is unchanged by a successful index. =find_by_hash= and =Select::exact_hash= still mean byte-for-byte CON text.
@@ -88,6 +88,7 @@ Site map
88
88
  howto/streaming
89
89
  howto/migration
90
90
  howto/topology
91
+ howto/atom-order
91
92
  howto/install
92
93
  howto/campaign
93
94
  howto/workflows
@@ -32,6 +32,9 @@ keys = db.select(
32
32
  )
33
33
  h = db.frame_hash(1, 0) # bytes(16)
34
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
35
38
  text = db.get_frame_text(1, 0)
36
39
  raw = ConCorpus.xxh3_128(b"blob")
37
40
  frame = db.get_frame(1, 0) # StoredFrame, not a readcon.ConFrame
@@ -67,6 +67,19 @@ readcon-db find-by-topology <corpus_dir> <file.con>
67
67
 
68
68
  Missing seams: nonzero exit and a stderr message that names =seams fingerprint=. How-to: @@rst::doc:`/howto/topology`@@.
69
69
 
70
+ ** Atom-id order
71
+ :PROPERTIES:
72
+ :CUSTOM_ID: atom-id-order
73
+ :END:
74
+ =frame_hash= stays the stored CON bytes. =index_canonical_identity= records a second hash, version 1, after reordering rows into increasing =atom_id=. =find_by_atom_order_path= returns each stored hit and the permutation from that stored order to the query.
75
+
76
+ #+begin_src text
77
+ readcon-db index-canonical <corpus_dir>
78
+ readcon-db find-by-atom-order <corpus_dir> <file.con>
79
+ #+end_src
80
+
81
+ How-to: @@rst::doc:`/howto/atom-order`@@.
82
+
70
83
  #+begin_src rust
71
84
  use readcon_db::{
72
85
  canonicalize_unit, join_drained_roots, ConCorpus, ShardedConCorpus,
@@ -1,6 +1,6 @@
1
1
  name = "ReadConDb"
2
2
  # [[[cog cog.outl(f'version = "{VERSION}"') ]]]
3
- version = "0.2.1"
3
+ version = "0.2.2"
4
4
  # [[[end]]]
5
5
  license = "MIT"
6
6
  [build]
@@ -1,7 +1,7 @@
1
1
  [workspace]
2
2
  name = "readcon-db"
3
3
  # [[[cog cog.outl(f'version = "{VERSION}"') ]]]
4
- version = "0.2.1"
4
+ version = "0.2.2"
5
5
  # [[[end]]]
6
6
  description = "Mmap-backed CON frame corpus (Heed/LMDB), xxHash exact match, multi-language FFI"
7
7
  channels = ["conda-forge"]
@@ -0,0 +1,58 @@
1
+ """Oxygen-first rows match a stored frame after the canonical index is built."""
2
+
3
+ from pathlib import Path
4
+
5
+ import readcon
6
+ from readcon_db import ConCorpus
7
+
8
+
9
+ def _pair():
10
+ c1 = (3.0, 4.0, 4.0)
11
+ c2 = (4.336, 4.0, 4.0)
12
+ oxygen = (5.016, 5.178, 4.0)
13
+ carbon_first = readcon.ConFrame(
14
+ (18.0, 18.0, 18.0),
15
+ (90.0, 90.0, 90.0),
16
+ [
17
+ readcon.Atom("C", *c1, atom_id=0, mass=12.011),
18
+ readcon.Atom("C", *c2, atom_id=1, mass=12.011),
19
+ readcon.Atom("O", *oxygen, atom_id=2, mass=15.999),
20
+ ],
21
+ )
22
+ oxygen_first = readcon.ConFrame(
23
+ (18.0, 18.0, 18.0),
24
+ (90.0, 90.0, 90.0),
25
+ [
26
+ readcon.Atom("O", *oxygen, atom_id=2, mass=15.999),
27
+ readcon.Atom("C", *c1, atom_id=0, mass=12.011),
28
+ readcon.Atom("C", *c2, atom_id=1, mass=12.011),
29
+ ],
30
+ )
31
+ return carbon_first, oxygen_first
32
+
33
+
34
+ def test_oxygen_first_matches_and_reports_the_permutation(tmp_path: Path):
35
+ carbon_first, oxygen_first = _pair()
36
+ text = readcon.write_con_string([oxygen_first])
37
+ db = ConCorpus(str(tmp_path / "corpus"))
38
+ db.append_trajectory_frames(1, [carbon_first], source="reactant")
39
+ content = db.frame_hash(1, 0)
40
+ assert content != db.xxh3_128(text.encode())
41
+ try:
42
+ db.find_by_atom_order(text)
43
+ except RuntimeError as err:
44
+ assert "index-canonical" in str(err)
45
+ else:
46
+ raise AssertionError("unindexed lookup should fail")
47
+ assert db.index_canonical_identity() == 1
48
+ assert db.frame_hash(1, 0) == content
49
+ version, digest = db.frame_canonical_identity(1, 0)
50
+ assert version == 1
51
+ assert len(digest) == 16
52
+ assert digest != db.xxh3_128(text.encode())
53
+ hits = db.find_by_atom_order(text)
54
+ assert len(hits) == 1
55
+ assert hits[0].query_index == 0
56
+ assert hits[0].traj_id == 1
57
+ assert hits[0].frame_idx == 0
58
+ assert list(hits[0].permutation) == [1, 2, 0]
@@ -0,0 +1,132 @@
1
+ """Catalog claim behavior and typed Python exceptions."""
2
+
3
+ import multiprocessing
4
+ import time
5
+
6
+ import pytest
7
+ import readcon_db
8
+ from readcon_db import ConCorpus
9
+
10
+
11
+ def _process_try_claim(path, owner, start_event, out_queue):
12
+ db = ConCorpus(path)
13
+ start_event.wait()
14
+ out_queue.put((owner, db.try_claim(b"ns", b"task-race", owner, 30)))
15
+
16
+
17
+ def test_try_claim_and_renew_with_lease(tmp_path):
18
+ db = ConCorpus(str(tmp_path / "corpus"))
19
+ assert hasattr(db, "renew_claim"), "renew_claim must exist for leased claims"
20
+ assert db.try_claim(b"ns", b"task", b"owner-a", 30) == "Acquired"
21
+ assert db.try_claim(b"ns", b"task", b"owner-a", 30) == "AlreadyOwned"
22
+ db.renew_claim(b"ns", b"task", b"owner-a", 30)
23
+ assert db.try_claim(b"ns", b"task", b"owner-b", 30) == "Busy"
24
+
25
+
26
+ def test_typed_claim_exceptions(tmp_path):
27
+ db = ConCorpus(str(tmp_path / "corpus"))
28
+ assert hasattr(readcon_db, "ClaimUnclaimedError")
29
+ assert hasattr(readcon_db, "ClaimNotOwnerError")
30
+ assert hasattr(readcon_db, "ClaimAlreadyCompleteError")
31
+ assert hasattr(readcon_db, "ClaimExpiredError")
32
+ assert hasattr(readcon_db, "ClaimError")
33
+ ClaimUnclaimedError = readcon_db.ClaimUnclaimedError
34
+ ClaimNotOwnerError = readcon_db.ClaimNotOwnerError
35
+ ClaimAlreadyCompleteError = readcon_db.ClaimAlreadyCompleteError
36
+ ClaimExpiredError = readcon_db.ClaimExpiredError
37
+ ClaimError = readcon_db.ClaimError
38
+ assert issubclass(ClaimError, RuntimeError)
39
+ assert issubclass(ClaimUnclaimedError, ClaimError)
40
+ assert issubclass(ClaimNotOwnerError, ClaimError)
41
+ assert issubclass(ClaimAlreadyCompleteError, ClaimError)
42
+ assert issubclass(ClaimExpiredError, ClaimError)
43
+
44
+ try:
45
+ db.release_claim(b"ns", b"missing", b"owner-a")
46
+ raise AssertionError("release on unclaimed task must fail")
47
+ except ClaimUnclaimedError:
48
+ pass
49
+
50
+ assert db.try_claim(b"ns", b"task", b"owner-a", 30) == "Acquired"
51
+
52
+ try:
53
+ db.renew_claim(b"ns", b"task", b"owner-b", 30)
54
+ raise AssertionError("renew by non-owner must fail")
55
+ except ClaimNotOwnerError:
56
+ pass
57
+
58
+ assert db.complete_claim(b"ns", b"task", b"owner-a", b"subject", b"fp", b"value")
59
+ try:
60
+ db.release_claim(b"ns", b"task", b"owner-a")
61
+ raise AssertionError("release after completion must fail")
62
+ except ClaimAlreadyCompleteError:
63
+ pass
64
+
65
+
66
+ def test_expired_claim_is_reacquired_and_old_owner_cannot_complete(tmp_path):
67
+ db = ConCorpus(str(tmp_path / "corpus"))
68
+ ClaimNotOwnerError = readcon_db.ClaimNotOwnerError
69
+ ClaimExpiredError = readcon_db.ClaimExpiredError
70
+ assert db.try_claim(b"ns", b"task", b"owner-a", 1) == "Acquired"
71
+ time.sleep(2.0)
72
+ assert db.try_claim(b"ns", b"task", b"owner-b", 30) == "Acquired"
73
+
74
+ try:
75
+ db.complete_claim(b"ns", b"task", b"owner-a", b"subject", b"fp", b"value")
76
+ raise AssertionError("lapsed owner should not complete task")
77
+ except ClaimNotOwnerError:
78
+ pass
79
+
80
+ assert db.try_claim(b"ns", b"expiring", b"owner-a", 1) == "Acquired"
81
+ time.sleep(2.0)
82
+ try:
83
+ db.renew_claim(b"ns", b"expiring", b"owner-a", 30)
84
+ raise AssertionError("expired claim should not be renewable")
85
+ except ClaimExpiredError:
86
+ pass
87
+
88
+
89
+ def test_zero_lease_is_rejected(tmp_path):
90
+ db = ConCorpus(str(tmp_path / "corpus"))
91
+ with pytest.raises(RuntimeError, match="lease_secs must be greater than zero"):
92
+ db.try_claim(b"ns", b"task", b"owner-a", 0)
93
+
94
+
95
+ def test_complete_expired_claim_before_takeover_fails_as_expired(tmp_path):
96
+ db = ConCorpus(str(tmp_path / "corpus"))
97
+ assert db.try_claim(b"ns", b"task", b"owner-a", 1) == "Acquired"
98
+ time.sleep(2.0)
99
+ with pytest.raises(readcon_db.ClaimExpiredError):
100
+ db.complete_claim(b"ns", b"task", b"owner-a", b"subject", b"fp", b"value")
101
+
102
+
103
+ def test_owner_reclaims_its_own_expired_task(tmp_path):
104
+ db = ConCorpus(str(tmp_path / "corpus"))
105
+ assert db.try_claim(b"ns", b"task", b"owner-a", 1) == "Acquired"
106
+ time.sleep(2.0)
107
+ assert db.try_claim(b"ns", b"task", b"owner-a", 30) == "Acquired"
108
+
109
+
110
+ def test_claim_race_across_processes(tmp_path):
111
+ corpus_path = str(tmp_path / "corpus")
112
+ ConCorpus(corpus_path)
113
+ ctx = multiprocessing.get_context("fork")
114
+ start_event = ctx.Event()
115
+ out_queue = ctx.Queue()
116
+ owners = [b"owner-a", b"owner-b"]
117
+ procs = [
118
+ ctx.Process(
119
+ target=_process_try_claim,
120
+ args=(corpus_path, owner, start_event, out_queue),
121
+ )
122
+ for owner in owners
123
+ ]
124
+ for proc in procs:
125
+ proc.start()
126
+ start_event.set()
127
+ results = [out_queue.get(timeout=10) for _ in owners]
128
+ for proc in procs:
129
+ proc.join(timeout=10)
130
+ assert proc.exitcode == 0
131
+ statuses = sorted(status for _, status in results)
132
+ assert statuses == ["Acquired", "Busy"]
@@ -4,7 +4,13 @@ from pathlib import Path
4
4
 
5
5
 
6
6
  def _runnable_blocks():
7
- org = Path(__file__).resolve().parents[2] / "docs" / "orgmode" / "howto" / "streaming.org"
7
+ org = (
8
+ Path(__file__).resolve().parents[2]
9
+ / "docs"
10
+ / "orgmode"
11
+ / "howto"
12
+ / "streaming.org"
13
+ )
8
14
  text = org.read_text(encoding="utf-8")
9
15
  blocks = []
10
16
  current = None
@@ -73,7 +73,64 @@ if ! command -v cargo >/dev/null 2>&1; then
73
73
  exit 1
74
74
  fi
75
75
  echo "rustdoc"
76
- ( cd "$ROOT" && RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --offline )
76
+ # The docs and Pages jobs have no cargo registry cache. `--offline` then
77
+ # fails with "no matching package named heed". Fetch the lockfile first.
78
+ (
79
+ cd "$ROOT"
80
+ cargo fetch --locked
81
+ RUSTDOCFLAGS="-D warnings" cargo doc --locked --no-deps
82
+ )
83
+ # rustdoc 1.99 writes help.html and settings.html with the logo and the
84
+ # "Rustdoc" heading pointed at ./index.html. cargo doc does not emit that
85
+ # root page (it needs the unstable --enable-index-page flag), so those two
86
+ # links are missing after the tree is copied to _site/rust and _site/docs/rust.
87
+ python3 - "$ROOT/target/doc" <<'PY'
88
+ import html, json, pathlib, re, sys
89
+
90
+ doc = pathlib.Path(sys.argv[1])
91
+ index = doc / "index.html"
92
+ if index.is_file():
93
+ raise SystemExit(0)
94
+ text = (doc / "crates.js").read_text()
95
+ match = re.search(r"window\.ALL_CRATES\s*=\s*(\[.*?\])\s*;", text)
96
+ if not match:
97
+ sys.exit("target/doc/crates.js has no ALL_CRATES list")
98
+ crates = json.loads(match.group(1))
99
+ if len(crates) != 1:
100
+ sys.exit(f"expected one rustdoc crate, found {crates}")
101
+ name = crates[0]
102
+ if not (doc / name / "index.html").is_file():
103
+ sys.exit(f"cargo doc did not write {name}/index.html")
104
+ href = html.escape(f"{name}/index.html", quote=True)
105
+ label = html.escape(name)
106
+ index.write_text(
107
+ "<!DOCTYPE html>\n"
108
+ '<html lang="en">\n'
109
+ "<head>\n"
110
+ '<meta charset="utf-8">\n'
111
+ f"<title>{label}</title>\n"
112
+ f'<meta http-equiv="refresh" content="0; url={href}">\n'
113
+ f'<link rel="canonical" href="{href}">\n'
114
+ "</head>\n"
115
+ "<body>\n"
116
+ f'<p><a href="{href}">{label}</a></p>\n'
117
+ "</body>\n"
118
+ "</html>\n"
119
+ )
120
+ PY
121
+ # The generated Python page imports readcon_db. The docs environment does not
122
+ # ship that extension, so build it into the interpreter Sphinx is using.
123
+ if ! python3 -c "import readcon_db" >/dev/null 2>&1; then
124
+ echo "install readcon_db for autodoc"
125
+ python3 -m pip --version >/dev/null 2>&1 || python3 -m ensurepip --upgrade
126
+ python3 -m pip install maturin
127
+ # Pixi sets both VIRTUAL_ENV and CONDA_PREFIX. Maturin refuses that pair.
128
+ # CONDA_PREFIX is the docs environment.
129
+ (
130
+ cd "$ROOT/python"
131
+ env -u VIRTUAL_ENV maturin develop --release
132
+ )
133
+ fi
77
134
  sphinx-build -W -b html "$OUT" "$ROOT/docs/_build/html"
78
135
  mkdir -p "$ROOT/docs/_build/html/rust"
79
136
  cp -a "$ROOT/target/doc/." "$ROOT/docs/_build/html/rust/"
@@ -26,7 +26,8 @@ except ImportError:
26
26
 
27
27
  ROOT = Path(__file__).resolve().parent.parent
28
28
  # The published writer whose CON and JSON round trips the tests rely on.
29
- READCON_CORE_PIN = "=0.17.1"
29
+ # 0.21.0 is the first release with atom-id correspondence.
30
+ READCON_CORE_PIN = "=0.21.0"
30
31
 
31
32
 
32
33
  def read(root, rel):
@@ -21,6 +21,8 @@
21
21
  //! readcon-db reindex <corpus_dir>
22
22
  //! readcon-db annotate-topology <corpus_dir> --cutoff A [--graph G] [--hops N] [--seams PATH]
23
23
  //! readcon-db find-by-topology <corpus_dir> <file.con>
24
+ //! readcon-db index-canonical <corpus_dir>
25
+ //! readcon-db find-by-atom-order <corpus_dir> <file.con>
24
26
  //! readcon-db hash-file <file.con>
25
27
  //! readcon-db migrate <corpus_dir>
26
28
  //! ```
@@ -53,6 +55,8 @@ fn usage() -> ExitCode {
53
55
  readcon-db reindex <corpus_dir>
54
56
  readcon-db annotate-topology <corpus_dir> --cutoff A [--graph G] [--hops N] [--seams PATH]
55
57
  readcon-db find-by-topology <corpus_dir> <file.con>
58
+ readcon-db index-canonical <corpus_dir>
59
+ readcon-db find-by-atom-order <corpus_dir> <file.con>
56
60
  readcon-db shard-init <root> [--shards N]
57
61
  readcon-db shard-ingest <root> --shard S --start-id T [--units JSON] [--no-compress] <file.con>...
58
62
  readcon-db shard-select <root> [--symbol S] ...
@@ -234,6 +238,33 @@ fn main() -> ExitCode {
234
238
  println!(" ...");
235
239
  }
236
240
  }
241
+ "index-canonical" => {
242
+ let corpus = args.first().ok_or("corpus_dir")?.clone();
243
+ let db = ConCorpus::open_existing(&corpus)?;
244
+ let n = db.index_canonical_identity()?;
245
+ println!("indexed {n} frames");
246
+ }
247
+ "find-by-atom-order" => {
248
+ let corpus = args.first().ok_or("corpus_dir")?.clone();
249
+ let file = args.get(1).ok_or("file.con")?.clone();
250
+ let db = ConCorpus::open_readonly(&corpus)?;
251
+ let hits = db.find_by_atom_order_path(&file)?;
252
+ if hits.is_empty() {
253
+ println!("query 0: 0 keys");
254
+ }
255
+ for hit in &hits {
256
+ let perm = hit
257
+ .permutation
258
+ .iter()
259
+ .map(|i| i.to_string())
260
+ .collect::<Vec<_>>()
261
+ .join(",");
262
+ println!(
263
+ "query {}: traj={} frame={} permutation={perm}",
264
+ hit.query_index, hit.key.traj_id, hit.key.frame_idx
265
+ );
266
+ }
267
+ }
237
268
  "select" | "dedup-export" => {
238
269
  let corpus = args.first().ok_or("corpus")?.clone();
239
270
  let mut traj = None;