grimace-py 0.1.9__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 (217) hide show
  1. grimace_py-0.1.9/.github/workflows/ci.yml +113 -0
  2. grimace_py-0.1.9/.github/workflows/release.yml +85 -0
  3. grimace_py-0.1.9/.gitignore +28 -0
  4. grimace_py-0.1.9/Cargo.lock +140 -0
  5. grimace_py-0.1.9/Cargo.toml +24 -0
  6. grimace_py-0.1.9/LICENSE +131 -0
  7. grimace_py-0.1.9/PKG-INFO +461 -0
  8. grimace_py-0.1.9/README.md +436 -0
  9. grimace_py-0.1.9/THIRD_PARTY_NOTICES.md +65 -0
  10. grimace_py-0.1.9/benchmarks/README.md +4 -0
  11. grimace_py-0.1.9/benchmarks/python/.gitkeep +1 -0
  12. grimace_py-0.1.9/benchmarks/rust/.gitkeep +1 -0
  13. grimace_py-0.1.9/docs/README.md +14 -0
  14. grimace_py-0.1.9/docs/api/.gitkeep +1 -0
  15. grimace_py-0.1.9/docs/api/python.md +304 -0
  16. grimace_py-0.1.9/docs/architecture/.gitkeep +1 -0
  17. grimace_py-0.1.9/docs/architecture/rust-first.md +58 -0
  18. grimace_py-0.1.9/docs/testing-fixtures.md +62 -0
  19. grimace_py-0.1.9/docs/timings.md +79 -0
  20. grimace_py-0.1.9/docs/timings.tsv +19 -0
  21. grimace_py-0.1.9/notes/001_full_stereo_difficulty.txt +154 -0
  22. grimace_py-0.1.9/notes/002_rdkit_miner_jsonl_resume.txt +140 -0
  23. grimace_py-0.1.9/notes/003_perf_history.txt +36 -0
  24. grimace_py-0.1.9/notes/004_perf_history.jsonl +135 -0
  25. grimace_py-0.1.9/notes/005_test_suite_structure.txt +334 -0
  26. grimace_py-0.1.9/notes/006_v0.1.8_release_notes.md +40 -0
  27. grimace_py-0.1.9/notes/007_v0.1.9_release_notes.md +21 -0
  28. grimace_py-0.1.9/notes/perf_reports/2026-04-22T071328+0000_33971ae4c361_cid634876_unrooted_nonstereo_exact.perf.txt +312 -0
  29. grimace_py-0.1.9/notes/perf_reports/2026-04-22T074005+0000_25254b25a734_cid634876_unrooted_nonstereo_exact.perf.txt +326 -0
  30. grimace_py-0.1.9/notes/perf_reports/2026-04-22T084931+0000_e36751c39103_cid634876_unrooted_nonstereo_exact.perf.txt +330 -0
  31. grimace_py-0.1.9/notes/perf_reports/2026-04-22T085302+0000_e36751c39103_cid634876_unrooted_nonstereo_exact.perf.txt +332 -0
  32. grimace_py-0.1.9/notes/perf_reports/2026-04-22T105347+0000_f63a90ec601f_cid634876_unrooted_nonstereo_exact_after_f63a90e.perf.txt +450 -0
  33. grimace_py-0.1.9/notes/perf_reports/2026-04-22T125244+0000_dcf6632d04b9_cid634876_unrooted_nonstereo_exact_after_perm_specialization.perf.txt +457 -0
  34. grimace_py-0.1.9/notes/perf_reports/2026-04-22T125415+0000_00270ad9724b_cid634876_unrooted_nonstereo_exact_after_00270ad.perf.txt +448 -0
  35. grimace_py-0.1.9/notes/perf_reports/2026-04-22T133345+0000_7d3cb46eafd5_cid634876_unrooted_nonstereo_exact_after_linear_exact_buckets.perf.txt +464 -0
  36. grimace_py-0.1.9/notes/perf_reports/2026-04-22T134836+0000_7d3cb46eafd5_cid634876_unrooted_nonstereo_exact_after_structural_bucket_cmp.perf.txt +468 -0
  37. grimace_py-0.1.9/notes/perf_reports/2026-04-23T081952+0000_02bf1ef1c160_large_stereo_determinized_decoder_all_roots.perf.txt +171 -0
  38. grimace_py-0.1.9/notes/perf_reports/2026-04-23T083358+0000_fd5bd30e40a1_large_stereo_determinized_decoder_all_roots_after_trim_ring_plan_set.perf.txt +167 -0
  39. grimace_py-0.1.9/notes/perf_reports/2026-04-23T094927+0000_d3a0a8d0f628_large_stereo_determinized_decoder_all_roots_after_compact_ring_label_payloads.perf.txt +172 -0
  40. grimace_py-0.1.9/notes/perf_reports/2026-04-23T095245+0000_373d6e2fe3a3_large_stereo_determinized_decoder_all_roots_after_linear_successor_buckets.perf.txt +186 -0
  41. grimace_py-0.1.9/notes/perf_reports/2026-04-23T095651+0000_c5011da00d72_large_stereo_determinized_decoder_all_roots_after_prefix_free_completion_cache.perf.txt +187 -0
  42. grimace_py-0.1.9/notes/perf_reports/2026-04-23T101015+0000_6695797b13bb_large_stereo_determinized_decoder_all_roots_after_sparse_pending.perf.txt +180 -0
  43. grimace_py-0.1.9/notes/perf_reports/2026-04-23T110003+0000_834f32cc3954_large_stereo_determinized_decoder_all_roots_after_structural_grouped_dedup.perf.txt +189 -0
  44. grimace_py-0.1.9/notes/perf_reports/2026-04-23T115554+0000_a1db4c0c57ad_large_stereo_determinized_decoder_all_roots_after_enter_atom_local_dedup.perf.txt +189 -0
  45. grimace_py-0.1.9/notes/perf_reports/2026-04-23T120054+0000_29c7fa7316cf_large_stereo_determinized_decoder_all_roots_after_enter_atom_insert_dedup.perf.txt +185 -0
  46. grimace_py-0.1.9/notes/perf_reports/2026-04-23T122553+0000_b6870974a98f_large_stereo_determinized_decoder_all_roots_after_trivial_completion_fast_path.perf.txt +274 -0
  47. grimace_py-0.1.9/notes/perf_reports/2026-04-23T122956+0000_5d637334945f_large_stereo_determinized_decoder_all_roots_after_stack_first_cmp.perf.txt +270 -0
  48. grimace_py-0.1.9/notes/perf_reports/2026-04-23T133159+0000_e1e1abd65a49_large_stereo_determinized_decoder_all_roots_after_zero_ring_fast_path.perf.txt +264 -0
  49. grimace_py-0.1.9/notes/perf_reports/2026-04-23T141130+0000_d717507092e5_large_stereo_determinized_decoder_all_roots_after_shared_prefix.perf.txt +248 -0
  50. grimace_py-0.1.9/notes/perf_reports/2026-04-23T142010+0000_d717507092e5_large_stereo_determinized_decoder_all_roots_after_shared_prefix_and_visited.perf.txt +256 -0
  51. grimace_py-0.1.9/notes/perf_reports/2026-04-23T142317+0000_d717507092e5_large_stereo_determinized_decoder_all_roots_after_shared_prefix_visited_and_linear_transitions.perf.txt +260 -0
  52. grimace_py-0.1.9/notes/perf_reports/2026-04-23T143306+0000_d717507092e5_large_stereo_determinized_decoder_all_roots_after_shared_prefix_visited_linear_retry.perf.txt +248 -0
  53. grimace_py-0.1.9/notes/perf_reports/2026-04-23T143712+0000_d717507092e5_large_stereo_determinized_decoder_all_roots_after_atom_stereo_process_children_fast_path.perf.txt +256 -0
  54. grimace_py-0.1.9/notes/perf_reports/2026-04-23T144008+0000_d717507092e5_large_stereo_determinized_decoder_all_roots_after_atom_stereo_enter_and_process_fast_paths.perf.txt +253 -0
  55. grimace_py-0.1.9/notes/perf_reports/2026-04-23T144753+0000_d717507092e5_large_stereo_determinized_decoder_all_roots_doublecheck.perf.txt +247 -0
  56. grimace_py-0.1.9/notes/perf_reports/2026-04-23T145403+0000_d717507092e5_large_stereo_determinized_decoder_all_roots_after_atom_stereo_completion_bypass.perf.txt +310 -0
  57. grimace_py-0.1.9/notes/perf_reports/2026-04-23T145426+0000_d717507092e5_large_stereo_determinized_decoder_all_roots_after_atom_stereo_completion_bypass_long.perf.txt +131 -0
  58. grimace_py-0.1.9/notes/perf_reports/2026-04-23T150320+0000_d717507092e5_large_stereo_determinized_decoder_all_roots_after_direct_grouped_successors.perf.txt +231 -0
  59. grimace_py-0.1.9/notes/perf_reports/2026-04-23T150606+0000_d717507092e5_large_stereo_determinized_decoder_all_roots_after_direct_choice_and_grouped_successors.perf.txt +135 -0
  60. grimace_py-0.1.9/notes/perf_reports/2026-04-23T151544+0000_d717507092e5_flatten_public_decoder_wrapper_large_stereo_det_all_roots.perf.txt +397 -0
  61. grimace_py-0.1.9/notes/perf_reports/2026-04-23T151558+0000_d717507092e5_flatten_public_decoder_wrapper_large_stereo_det_all_roots_steady.perf.txt +244 -0
  62. grimace_py-0.1.9/notes/perf_reports/2026-04-23T151854+0000_d717507092e5_direct_branch_choice_successors_large_stereo_all_roots_steady.perf.txt +227 -0
  63. grimace_py-0.1.9/notes/perf_reports/2026-04-23T152954+0000_6752ac7ca436_reuse_decoder_prepared_graphs_and_trim_python_choice_overhead_large_stereo_det_all_roots.perf.txt +224 -0
  64. grimace_py-0.1.9/notes/perf_reports/2026-04-23T160737+0000_d9505620d101_stereo_grouped_successors_linear_large_stereo_det_all_roots.perf.txt +240 -0
  65. grimace_py-0.1.9/notes/perf_reports/2026-04-23T173723+0000_128fa08fc697_large_stereo_determinized_decoder_root_minus_one_after_raw_core_merged_states.perf.txt +588 -0
  66. grimace_py-0.1.9/notes/perf_reports/2026-04-23T174523+0000_a3f0963c74eb_large_stereo_exact_enum_root_minus_one_loops30.perf.txt +310 -0
  67. grimace_py-0.1.9/notes/perf_reports/2026-04-23T190409+0000_b1a3c1b0b71b_large_stereo_exact_enum_after_direct_atom_stereo_path.perf.txt +460 -0
  68. grimace_py-0.1.9/notes/perf_reports/2026-04-23T191702+0000_9e430c5a9785_large_stereo_exact_enum_after_neighbor_group_port.perf.txt +432 -0
  69. grimace_py-0.1.9/notes/perf_reports/2026-04-23T192532+0000_e3efba660a91_large_stereo_exact_enum_after_drained_exact_helper.perf.txt +451 -0
  70. grimace_py-0.1.9/notes/perf_reports/2026-04-23T193320+0000_e3efba660a91_large_stereo_exact_enum_after_exact_enter_atom_clone_cuts.perf.txt +464 -0
  71. grimace_py-0.1.9/notes/perf_reports/2026-04-23T194511+0000_8b14d6660407_large_stereo_exact_enum_after_exact_action_stack_capacity_cuts.perf.txt +453 -0
  72. grimace_py-0.1.9/notes/perf_reports/2026-04-23T194755+0000_8b14d6660407_large_stereo_exact_enum_after_exact_base_stack_slices.perf.txt +446 -0
  73. grimace_py-0.1.9/notes/perf_reports/2026-04-23T201257+0000_f49655fee861_large_stereo_exact_enum_after_arc_pending_free_labels.perf.txt +407 -0
  74. grimace_py-0.1.9/notes/perf_reports/2026-04-23T203259+0000_14b0674e54db_large_stereo_exact_enum_after_shared_stereo_side_state.perf.txt +389 -0
  75. grimace_py-0.1.9/notes/perf_reports/2026-04-23T203952+0000_9072d27ad258_large_stereo_exact_enum_after_nonchiral_prefix_reuse.perf.txt +412 -0
  76. grimace_py-0.1.9/notes/perf_reports/2026-04-23T204750+0000_9072d27ad258_large_stereo_exact_enum_after_shared_exact_snapshots.perf.txt +413 -0
  77. grimace_py-0.1.9/notes/perf_reports/2026-04-23T204854+0000_9072d27ad258_large_stereo_exact_enum_after_emitdeferred_base_reuse.perf.txt +405 -0
  78. grimace_py-0.1.9/notes/perf_reports/2026-04-24T051441+0000_6f00e26f6f37_large_stereo_exact_enum_after_exact_shared_core_delta.perf.txt +428 -0
  79. grimace_py-0.1.9/notes/perf_reports/2026-04-24T053620+0000_e70981e84e8e_large_stereo_exact_enum_after_shared_pending_base.perf.txt +433 -0
  80. grimace_py-0.1.9/notes/perf_reports/2026-04-24T054349+0000_e225f7c6b064_large_stereo_exact_enum_after_exact_atom_only_state_simplify.perf.txt +445 -0
  81. grimace_py-0.1.9/notes/perf_reports/2026-04-24T055452+0000_597cb8944dd3_large_stereo_exact_enum_after_inline_single_child.perf.txt +475 -0
  82. grimace_py-0.1.9/notes/perf_reports/2026-04-24T083005+0000_f60ccf9a768a_large_stereo_exact_enum_after_direct_single_child_path.perf.txt +469 -0
  83. grimace_py-0.1.9/notes/perf_reports/2026-04-24T084103+0000_965a4a811fc9_large_stereo_exact_enum_after_trivial_ring_and_child_bypass.perf.txt +464 -0
  84. grimace_py-0.1.9/notes/perf_reports/2026-04-24T084801+0000_3625d65bdfa3_large_stereo_exact_enum_after_lazy_pending_clone.perf.txt +416 -0
  85. grimace_py-0.1.9/notes/perf_reports/2026-04-24T091507+0000_e48ba07d3edf_large_stereo_exact_enum_after_compact_exact_actions.perf.txt +413 -0
  86. grimace_py-0.1.9/pyproject.toml +38 -0
  87. grimace_py-0.1.9/python/grimace/__init__.py +181 -0
  88. grimace_py-0.1.9/python/grimace/_core.pyi +151 -0
  89. grimace_py-0.1.9/python/grimace/_reference/__init__.py +93 -0
  90. grimace_py-0.1.9/python/grimace/_reference/_data/reference/README.md +15 -0
  91. grimace_py-0.1.9/python/grimace/_reference/_data/reference/rdkit_random/branches/connected_nonstereo/policies/rdkit_random_connected_nonstereo_v1.json +37 -0
  92. grimace_py-0.1.9/python/grimace/_reference/_data/reference/rdkit_random/branches/connected_nonstereo/snapshots/rdkit_random_connected_nonstereo_v1/0b96ec7f/README.md +11 -0
  93. grimace_py-0.1.9/python/grimace/_reference/_data/reference/rdkit_random/branches/connected_nonstereo/snapshots/rdkit_random_connected_nonstereo_v1/0b96ec7f/core_exact_sets.json +17207 -0
  94. grimace_py-0.1.9/python/grimace/_reference/_data/reference/rdkit_random/branches/connected_nonstereo/snapshots/rdkit_random_connected_nonstereo_v1/0b96ec7f/first_1000_len_le_40_metrics.json.gz +0 -0
  95. grimace_py-0.1.9/python/grimace/_reference/_data/reference/rdkit_random/branches/general/policies/rdkit_random_v1.json +33 -0
  96. grimace_py-0.1.9/python/grimace/_reference/_data/reference/rdkit_random/branches/general/snapshots/rdkit_random_v1/cd052771/README.md +9 -0
  97. grimace_py-0.1.9/python/grimace/_reference/_data/reference/rdkit_random/branches/general/snapshots/rdkit_random_v1/cd052771/core_exact_sets.json +20284 -0
  98. grimace_py-0.1.9/python/grimace/_reference/_data/reference/rdkit_random/branches/general/snapshots/rdkit_random_v1/cd052771/first_1000_len_le_40_metrics.json.gz +0 -0
  99. grimace_py-0.1.9/python/grimace/_reference/_data/top_100000_CIDs.tsv.gz +0 -0
  100. grimace_py-0.1.9/python/grimace/_reference/_paths.py +38 -0
  101. grimace_py-0.1.9/python/grimace/_reference/artifacts.py +186 -0
  102. grimace_py-0.1.9/python/grimace/_reference/dataset.py +191 -0
  103. grimace_py-0.1.9/python/grimace/_reference/policy.py +100 -0
  104. grimace_py-0.1.9/python/grimace/_reference/prepared_graph.py +905 -0
  105. grimace_py-0.1.9/python/grimace/_reference/rdkit_random.py +190 -0
  106. grimace_py-0.1.9/python/grimace/_reference/rooted/__init__.py +21 -0
  107. grimace_py-0.1.9/python/grimace/_reference/rooted/connected_nonstereo.py +843 -0
  108. grimace_py-0.1.9/python/grimace/_reference/rooted/connected_stereo.py +2079 -0
  109. grimace_py-0.1.9/python/grimace/_reference/rooted_enumerator.py +32 -0
  110. grimace_py-0.1.9/python/grimace/_runtime.py +1190 -0
  111. grimace_py-0.1.9/python/grimace/py.typed +1 -0
  112. grimace_py-0.1.9/rust/crates/.gitkeep +1 -0
  113. grimace_py-0.1.9/rust/src/frontier.rs +113 -0
  114. grimace_py-0.1.9/rust/src/lib.rs +34 -0
  115. grimace_py-0.1.9/rust/src/prepared_graph.rs +1100 -0
  116. grimace_py-0.1.9/rust/src/rooted_nonstereo.rs +2018 -0
  117. grimace_py-0.1.9/rust/src/rooted_stereo.rs +5881 -0
  118. grimace_py-0.1.9/rust/src/smiles_shared.rs +37 -0
  119. grimace_py-0.1.9/rust-toolchain.toml +3 -0
  120. grimace_py-0.1.9/scripts/README.md +127 -0
  121. grimace_py-0.1.9/scripts/generate_reference_artifacts.py +72 -0
  122. grimace_py-0.1.9/scripts/mine_rdkit_regressions.py +888 -0
  123. grimace_py-0.1.9/scripts/record_perf_hotspots.py +254 -0
  124. grimace_py-0.1.9/tests/README.md +51 -0
  125. grimace_py-0.1.9/tests/__init__.py +1 -0
  126. grimace_py-0.1.9/tests/contract/__init__.py +1 -0
  127. grimace_py-0.1.9/tests/contract/test_artifacts.py +76 -0
  128. grimace_py-0.1.9/tests/contract/test_dataset.py +53 -0
  129. grimace_py-0.1.9/tests/contract/test_exports.py +48 -0
  130. grimace_py-0.1.9/tests/contract/test_pinned_rdkit_fixtures.py +386 -0
  131. grimace_py-0.1.9/tests/contract/test_policy.py +102 -0
  132. grimace_py-0.1.9/tests/contract/test_prepared_graph.py +197 -0
  133. grimace_py-0.1.9/tests/fixtures/.gitkeep +1 -0
  134. grimace_py-0.1.9/tests/fixtures/rdkit_disconnected_sampling/root_zero_smiles.json +35 -0
  135. grimace_py-0.1.9/tests/fixtures/rdkit_exact_small_support/2026.03.1.json +1077 -0
  136. grimace_py-0.1.9/tests/fixtures/rdkit_rooted_random/2026.03.1.json +23 -0
  137. grimace_py-0.1.9/tests/fixtures/rdkit_serializer_regressions/2026.03.1/00_core_writer_flags.json +260 -0
  138. grimace_py-0.1.9/tests/fixtures/rdkit_serializer_regressions/2026.03.1/10_chirality_smiles.json +608 -0
  139. grimace_py-0.1.9/tests/fixtures/rdkit_serializer_regressions/2026.03.1/20_stereo_directional_isotopes.json +455 -0
  140. grimace_py-0.1.9/tests/fixtures/rdkit_serializer_regressions/2026.03.1/30_aromatic_charge_normalization.json +362 -0
  141. grimace_py-0.1.9/tests/fixtures/rdkit_serializer_regressions/2026.03.1/40_dative_fragment_order.json +356 -0
  142. grimace_py-0.1.9/tests/fixtures/rdkit_serializer_regressions/2026.03.1/50_molblock_stereo.json +394 -0
  143. grimace_py-0.1.9/tests/fixtures/rdkit_serializer_regressions/2026.03.1/90_large_sampled_regressions.json +117 -0
  144. grimace_py-0.1.9/tests/fixtures/rdkit_stereo_regressions/rooted_membership.json +19 -0
  145. grimace_py-0.1.9/tests/fixtures/rdkit_stereo_regressions/steroid_ring_coupled_component.json +7 -0
  146. grimace_py-0.1.9/tests/fixtures/rdkit_writer_membership/2026.03.1/10_chirality.json +59 -0
  147. grimace_py-0.1.9/tests/fixtures/rdkit_writer_membership/2026.03.1/20_writer_flags.json +179 -0
  148. grimace_py-0.1.9/tests/fixtures/rdkit_writer_membership/2026.03.1/30_dataset_regressions.json +41 -0
  149. grimace_py-0.1.9/tests/fixtures/reference/README.md +15 -0
  150. grimace_py-0.1.9/tests/fixtures/reference/rdkit_random/branches/connected_nonstereo/policies/rdkit_random_connected_nonstereo_v1.json +37 -0
  151. grimace_py-0.1.9/tests/fixtures/reference/rdkit_random/branches/connected_nonstereo/snapshots/rdkit_random_connected_nonstereo_v1/0b96ec7f/README.md +11 -0
  152. grimace_py-0.1.9/tests/fixtures/reference/rdkit_random/branches/connected_nonstereo/snapshots/rdkit_random_connected_nonstereo_v1/0b96ec7f/core_exact_sets.json +17078 -0
  153. grimace_py-0.1.9/tests/fixtures/reference/rdkit_random/branches/connected_nonstereo/snapshots/rdkit_random_connected_nonstereo_v1/0b96ec7f/first_1000_len_le_40_metrics.json.gz +0 -0
  154. grimace_py-0.1.9/tests/fixtures/reference/rdkit_random/branches/general/policies/rdkit_random_v1.json +33 -0
  155. grimace_py-0.1.9/tests/fixtures/reference/rdkit_random/branches/general/snapshots/rdkit_random_v1/cd052771/README.md +9 -0
  156. grimace_py-0.1.9/tests/fixtures/reference/rdkit_random/branches/general/snapshots/rdkit_random_v1/cd052771/core_exact_sets.json +20287 -0
  157. grimace_py-0.1.9/tests/fixtures/reference/rdkit_random/branches/general/snapshots/rdkit_random_v1/cd052771/first_1000_len_le_40_metrics.json.gz +0 -0
  158. grimace_py-0.1.9/tests/fixtures/top_100000_CIDs.tsv.gz +0 -0
  159. grimace_py-0.1.9/tests/helpers/__init__.py +1 -0
  160. grimace_py-0.1.9/tests/helpers/assertions.py +29 -0
  161. grimace_py-0.1.9/tests/helpers/cases.py +152 -0
  162. grimace_py-0.1.9/tests/helpers/kernel.py +8 -0
  163. grimace_py-0.1.9/tests/helpers/mols.py +12 -0
  164. grimace_py-0.1.9/tests/helpers/pinned_rdkit_fixtures.py +235 -0
  165. grimace_py-0.1.9/tests/helpers/policies.py +30 -0
  166. grimace_py-0.1.9/tests/helpers/public_runtime.py +216 -0
  167. grimace_py-0.1.9/tests/helpers/rdkit_disconnected_sampling.py +29 -0
  168. grimace_py-0.1.9/tests/helpers/rdkit_exact_small_support.py +113 -0
  169. grimace_py-0.1.9/tests/helpers/rdkit_rooted_random.py +57 -0
  170. grimace_py-0.1.9/tests/helpers/rdkit_serializer_regressions.py +135 -0
  171. grimace_py-0.1.9/tests/helpers/rdkit_stereo_regressions.py +88 -0
  172. grimace_py-0.1.9/tests/helpers/rdkit_writer_membership.py +112 -0
  173. grimace_py-0.1.9/tests/helpers/tokenization.py +94 -0
  174. grimace_py-0.1.9/tests/integration/__init__.py +1 -0
  175. grimace_py-0.1.9/tests/integration/test_core_dataset_contracts.py +106 -0
  176. grimace_py-0.1.9/tests/integration/test_core_extension_smoke.py +184 -0
  177. grimace_py-0.1.9/tests/integration/test_local_scripts.py +53 -0
  178. grimace_py-0.1.9/tests/integration/test_public_all_roots_identities.py +146 -0
  179. grimace_py-0.1.9/tests/integration/test_public_decoder.py +798 -0
  180. grimace_py-0.1.9/tests/integration/test_public_prepared_equivalence.py +171 -0
  181. grimace_py-0.1.9/tests/integration/test_public_runtime_writer_flags.py +180 -0
  182. grimace_py-0.1.9/tests/integration/test_python_api_smoke.py +446 -0
  183. grimace_py-0.1.9/tests/integration/test_rdkit_regression_miner.py +337 -0
  184. grimace_py-0.1.9/tests/integration/test_token_inventory.py +259 -0
  185. grimace_py-0.1.9/tests/parity/__init__.py +1 -0
  186. grimace_py-0.1.9/tests/parity/nonstereo/__init__.py +1 -0
  187. grimace_py-0.1.9/tests/parity/nonstereo/test_kernel_enumerator.py +80 -0
  188. grimace_py-0.1.9/tests/parity/nonstereo/test_kernel_walker.py +119 -0
  189. grimace_py-0.1.9/tests/parity/stereo/__init__.py +1 -0
  190. grimace_py-0.1.9/tests/parity/stereo/test_kernel_enumerator.py +90 -0
  191. grimace_py-0.1.9/tests/parity/stereo/test_kernel_walker.py +86 -0
  192. grimace_py-0.1.9/tests/parity/test_kernel_prepared_graph.py +122 -0
  193. grimace_py-0.1.9/tests/perf/__init__.py +1 -0
  194. grimace_py-0.1.9/tests/perf/_history.py +83 -0
  195. grimace_py-0.1.9/tests/perf/test_kernel_nonstereo.py +96 -0
  196. grimace_py-0.1.9/tests/perf/test_kernel_stereo.py +127 -0
  197. grimace_py-0.1.9/tests/perf/test_readme_timings.py +498 -0
  198. grimace_py-0.1.9/tests/rdkit_serialization/__init__.py +1 -0
  199. grimace_py-0.1.9/tests/rdkit_serialization/_support.py +339 -0
  200. grimace_py-0.1.9/tests/rdkit_serialization/test_disconnected.py +69 -0
  201. grimace_py-0.1.9/tests/rdkit_serialization/test_exact_small_support.py +128 -0
  202. grimace_py-0.1.9/tests/rdkit_serialization/test_rooted_random.py +146 -0
  203. grimace_py-0.1.9/tests/rdkit_serialization/test_serializer_regressions.py +83 -0
  204. grimace_py-0.1.9/tests/rdkit_serialization/test_writer_flags.py +37 -0
  205. grimace_py-0.1.9/tests/rdkit_serialization/test_writer_membership.py +42 -0
  206. grimace_py-0.1.9/tests/reference/__init__.py +1 -0
  207. grimace_py-0.1.9/tests/reference/nonstereo/__init__.py +1 -0
  208. grimace_py-0.1.9/tests/reference/nonstereo/test_enumerator.py +194 -0
  209. grimace_py-0.1.9/tests/reference/nonstereo/test_walker.py +125 -0
  210. grimace_py-0.1.9/tests/reference/prepared/__init__.py +1 -0
  211. grimace_py-0.1.9/tests/reference/prepared/test_atom_tokens.py +156 -0
  212. grimace_py-0.1.9/tests/reference/stereo/__init__.py +1 -0
  213. grimace_py-0.1.9/tests/reference/stereo/test_enumerator.py +379 -0
  214. grimace_py-0.1.9/tests/reference/test_rdkit_random.py +62 -0
  215. grimace_py-0.1.9/tests/run_exact_public_invariants.py +25 -0
  216. grimace_py-0.1.9/tests/run_installed_package_correctness.py +23 -0
  217. grimace_py-0.1.9/tests/run_pinned_rdkit_parity.py +61 -0
@@ -0,0 +1,113 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ paths-ignore:
8
+ - "README.md"
9
+ - "docs/**"
10
+ pull_request:
11
+ workflow_dispatch:
12
+
13
+ jobs:
14
+ rust:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v5
18
+ - uses: dtolnay/rust-toolchain@stable
19
+ - name: Run Rust tests
20
+ run: cargo test --lib
21
+
22
+ tests:
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - uses: actions/checkout@v5
26
+ - uses: actions/setup-python@v6
27
+ with:
28
+ python-version: "3.12"
29
+ - uses: dtolnay/rust-toolchain@stable
30
+ - name: Create test environment
31
+ run: python -m venv .venv
32
+ - name: Install test tools
33
+ run: unset CONDA_PREFIX && . .venv/bin/activate && python -m pip install --upgrade pip maturin
34
+ - name: Install package into test environment
35
+ run: unset CONDA_PREFIX && . .venv/bin/activate && maturin develop --release
36
+ - name: Run Python test suite from source tree
37
+ run: unset CONDA_PREFIX && . .venv/bin/activate && python -m unittest discover -s tests -t . -q
38
+
39
+ rdkit-parity:
40
+ runs-on: ubuntu-latest
41
+ steps:
42
+ - uses: actions/checkout@v5
43
+ - uses: actions/setup-python@v6
44
+ with:
45
+ python-version: "3.12"
46
+ - uses: dtolnay/rust-toolchain@stable
47
+ - name: Create test environment
48
+ run: python -m venv .venv
49
+ - name: Install test tools
50
+ run: unset CONDA_PREFIX && . .venv/bin/activate && python -m pip install --upgrade pip maturin
51
+ - name: Install package into test environment
52
+ run: unset CONDA_PREFIX && . .venv/bin/activate && maturin develop --release
53
+ - name: Run pinned RDKit parity suite
54
+ run: unset CONDA_PREFIX && . .venv/bin/activate && python -m unittest tests.run_pinned_rdkit_parity -q
55
+
56
+ exact-public-invariants:
57
+ runs-on: ubuntu-latest
58
+ steps:
59
+ - uses: actions/checkout@v5
60
+ - uses: actions/setup-python@v6
61
+ with:
62
+ python-version: "3.12"
63
+ - uses: dtolnay/rust-toolchain@stable
64
+ - name: Create test environment
65
+ run: python -m venv .venv
66
+ - name: Install test tools
67
+ run: unset CONDA_PREFIX && . .venv/bin/activate && python -m pip install --upgrade pip maturin
68
+ - name: Install package into test environment
69
+ run: unset CONDA_PREFIX && . .venv/bin/activate && maturin develop --release
70
+ - name: Run exact public invariant suite
71
+ run: unset CONDA_PREFIX && . .venv/bin/activate && python -m unittest tests.run_exact_public_invariants -q
72
+
73
+ package:
74
+ runs-on: ubuntu-latest
75
+ strategy:
76
+ fail-fast: false
77
+ matrix:
78
+ python-version: ["3.12", "3.13"]
79
+ steps:
80
+ - uses: actions/checkout@v5
81
+ - uses: actions/setup-python@v6
82
+ with:
83
+ python-version: ${{ matrix.python-version }}
84
+ - uses: dtolnay/rust-toolchain@stable
85
+ - name: Install build tools
86
+ run: python -m pip install --upgrade pip maturin twine
87
+ - name: Build wheel
88
+ run: maturin build --release --out dist -i python${{ matrix.python-version }}
89
+ - name: Check distribution metadata
90
+ run: python -m twine check dist/grimace-*.whl
91
+ - name: Install built wheel
92
+ run: python -m pip install dist/grimace-*.whl
93
+ - name: Run installed-package correctness subset
94
+ run: python -m unittest tests.run_installed_package_correctness -q
95
+
96
+ sdist:
97
+ runs-on: ubuntu-latest
98
+ steps:
99
+ - uses: actions/checkout@v5
100
+ - uses: actions/setup-python@v6
101
+ with:
102
+ python-version: "3.12"
103
+ - uses: dtolnay/rust-toolchain@stable
104
+ - name: Install build tools
105
+ run: python -m pip install --upgrade pip maturin twine
106
+ - name: Build source distribution
107
+ run: maturin build --release --sdist --out dist -i python3.12
108
+ - name: Check source distribution metadata
109
+ run: python -m twine check dist/grimace-*.tar.gz
110
+ - name: Install built source distribution
111
+ run: python -m pip install dist/grimace-*.tar.gz
112
+ - name: Run installed-package correctness subset from source distribution
113
+ run: python -m unittest tests.run_installed_package_correctness -q
@@ -0,0 +1,85 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+ workflow_dispatch:
8
+
9
+ jobs:
10
+ wheel:
11
+ name: Build wheel (linux-x86_64, cp${{ matrix.python-version }})
12
+ runs-on: ${{ matrix.os }}
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ include:
17
+ - name: linux-x86_64
18
+ os: ubuntu-latest
19
+ target: x86_64
20
+ manylinux: "2_28"
21
+ python-version: "3.12"
22
+ - name: linux-x86_64
23
+ os: ubuntu-latest
24
+ target: x86_64
25
+ manylinux: "2_28"
26
+ python-version: "3.13"
27
+ steps:
28
+ - uses: actions/checkout@v5
29
+ - uses: actions/setup-python@v6
30
+ with:
31
+ python-version: ${{ matrix.python-version }}
32
+ - uses: PyO3/maturin-action@v1
33
+ with:
34
+ target: ${{ matrix.target }}
35
+ manylinux: ${{ matrix.manylinux }}
36
+ args: --release --out dist -i python${{ matrix.python-version }}
37
+ - name: Install built wheel
38
+ run: python -m pip install dist/*.whl
39
+ - name: Run installed-package correctness subset
40
+ run: python -m unittest tests.run_installed_package_correctness -q
41
+ - uses: actions/upload-artifact@v7
42
+ with:
43
+ name: wheel-${{ matrix.name }}-cp${{ matrix.python-version }}
44
+ path: dist
45
+
46
+ sdist:
47
+ name: Build source distribution
48
+ runs-on: ubuntu-latest
49
+ steps:
50
+ - uses: actions/checkout@v5
51
+ - uses: actions/setup-python@v6
52
+ with:
53
+ python-version: "3.12"
54
+ - uses: PyO3/maturin-action@v1
55
+ with:
56
+ command: sdist
57
+ args: --out dist
58
+ - name: Install built source distribution
59
+ run: python -m pip install dist/*.tar.gz
60
+ - name: Run installed-package correctness subset
61
+ run: python -m unittest tests.run_installed_package_correctness -q
62
+ - uses: actions/upload-artifact@v7
63
+ with:
64
+ name: sdist
65
+ path: dist
66
+
67
+ release:
68
+ name: Publish GitHub release
69
+ runs-on: ubuntu-latest
70
+ needs:
71
+ - wheel
72
+ - sdist
73
+ permissions:
74
+ contents: write
75
+ if: startsWith(github.ref, 'refs/tags/')
76
+ steps:
77
+ - uses: actions/download-artifact@v8
78
+ with:
79
+ path: dist
80
+ merge-multiple: true
81
+ - uses: softprops/action-gh-release@v2
82
+ with:
83
+ name: grimace-py ${{ github.ref_name }}
84
+ generate_release_notes: true
85
+ files: dist/*
@@ -0,0 +1,28 @@
1
+ dist/
2
+ build/
3
+ target/
4
+ pip-wheel-metadata/
5
+ *.egg-info/
6
+
7
+ __pycache__/
8
+ *.py[cod]
9
+ .pytest_cache/
10
+ .ruff_cache/
11
+ .mypy_cache/
12
+ .coverage
13
+ .coverage.*
14
+ htmlcov/
15
+ .venv/
16
+ .python-version
17
+
18
+ python/grimace/_core*.so
19
+ python/grimace/_core*.dylib
20
+ python/grimace/_core*.dll
21
+ python/grimace/_core*.pyd
22
+
23
+ Cargo.lock
24
+
25
+ .DS_Store
26
+ .codex
27
+ .idea/
28
+ .vscode/
@@ -0,0 +1,140 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 4
4
+
5
+ [[package]]
6
+ name = "grimace-kernel"
7
+ version = "0.1.9"
8
+ dependencies = [
9
+ "pyo3",
10
+ "rustc-hash",
11
+ ]
12
+
13
+ [[package]]
14
+ name = "heck"
15
+ version = "0.5.0"
16
+ source = "registry+https://github.com/rust-lang/crates.io-index"
17
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
18
+
19
+ [[package]]
20
+ name = "libc"
21
+ version = "0.2.186"
22
+ source = "registry+https://github.com/rust-lang/crates.io-index"
23
+ checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
24
+
25
+ [[package]]
26
+ name = "once_cell"
27
+ version = "1.21.4"
28
+ source = "registry+https://github.com/rust-lang/crates.io-index"
29
+ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
30
+
31
+ [[package]]
32
+ name = "portable-atomic"
33
+ version = "1.13.1"
34
+ source = "registry+https://github.com/rust-lang/crates.io-index"
35
+ checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49"
36
+
37
+ [[package]]
38
+ name = "proc-macro2"
39
+ version = "1.0.106"
40
+ source = "registry+https://github.com/rust-lang/crates.io-index"
41
+ checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
42
+ dependencies = [
43
+ "unicode-ident",
44
+ ]
45
+
46
+ [[package]]
47
+ name = "pyo3"
48
+ version = "0.28.3"
49
+ source = "registry+https://github.com/rust-lang/crates.io-index"
50
+ checksum = "91fd8e38a3b50ed1167fb981cd6fd60147e091784c427b8f7183a7ee32c31c12"
51
+ dependencies = [
52
+ "libc",
53
+ "once_cell",
54
+ "portable-atomic",
55
+ "pyo3-build-config",
56
+ "pyo3-ffi",
57
+ "pyo3-macros",
58
+ ]
59
+
60
+ [[package]]
61
+ name = "pyo3-build-config"
62
+ version = "0.28.3"
63
+ source = "registry+https://github.com/rust-lang/crates.io-index"
64
+ checksum = "e368e7ddfdeb98c9bca7f8383be1648fd84ab466bf2bc015e94008db6d35611e"
65
+ dependencies = [
66
+ "target-lexicon",
67
+ ]
68
+
69
+ [[package]]
70
+ name = "pyo3-ffi"
71
+ version = "0.28.3"
72
+ source = "registry+https://github.com/rust-lang/crates.io-index"
73
+ checksum = "7f29e10af80b1f7ccaf7f69eace800a03ecd13e883acfacc1e5d0988605f651e"
74
+ dependencies = [
75
+ "libc",
76
+ "pyo3-build-config",
77
+ ]
78
+
79
+ [[package]]
80
+ name = "pyo3-macros"
81
+ version = "0.28.3"
82
+ source = "registry+https://github.com/rust-lang/crates.io-index"
83
+ checksum = "df6e520eff47c45997d2fc7dd8214b25dd1310918bbb2642156ef66a67f29813"
84
+ dependencies = [
85
+ "proc-macro2",
86
+ "pyo3-macros-backend",
87
+ "quote",
88
+ "syn",
89
+ ]
90
+
91
+ [[package]]
92
+ name = "pyo3-macros-backend"
93
+ version = "0.28.3"
94
+ source = "registry+https://github.com/rust-lang/crates.io-index"
95
+ checksum = "c4cdc218d835738f81c2338f822078af45b4afdf8b2e33cbb5916f108b813acb"
96
+ dependencies = [
97
+ "heck",
98
+ "proc-macro2",
99
+ "pyo3-build-config",
100
+ "quote",
101
+ "syn",
102
+ ]
103
+
104
+ [[package]]
105
+ name = "quote"
106
+ version = "1.0.45"
107
+ source = "registry+https://github.com/rust-lang/crates.io-index"
108
+ checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924"
109
+ dependencies = [
110
+ "proc-macro2",
111
+ ]
112
+
113
+ [[package]]
114
+ name = "rustc-hash"
115
+ version = "2.1.2"
116
+ source = "registry+https://github.com/rust-lang/crates.io-index"
117
+ checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe"
118
+
119
+ [[package]]
120
+ name = "syn"
121
+ version = "2.0.117"
122
+ source = "registry+https://github.com/rust-lang/crates.io-index"
123
+ checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99"
124
+ dependencies = [
125
+ "proc-macro2",
126
+ "quote",
127
+ "unicode-ident",
128
+ ]
129
+
130
+ [[package]]
131
+ name = "target-lexicon"
132
+ version = "0.13.5"
133
+ source = "registry+https://github.com/rust-lang/crates.io-index"
134
+ checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
135
+
136
+ [[package]]
137
+ name = "unicode-ident"
138
+ version = "1.0.24"
139
+ source = "registry+https://github.com/rust-lang/crates.io-index"
140
+ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
@@ -0,0 +1,24 @@
1
+ [package]
2
+ name = "grimace-kernel"
3
+ version = "0.1.9"
4
+ description = "Rust core for the grimace Python package."
5
+ edition = "2021"
6
+ rust-version = "1.83"
7
+ license = "PolyForm-Noncommercial-1.0.0"
8
+ homepage = "https://github.com/numpde/grimace-py"
9
+ repository = "https://github.com/numpde/grimace-py"
10
+ documentation = "https://github.com/numpde/grimace-py/tree/main/docs"
11
+ readme = "README.md"
12
+
13
+ [features]
14
+ default = []
15
+ python-extension = ["pyo3/extension-module"]
16
+
17
+ [lib]
18
+ name = "_core"
19
+ crate-type = ["cdylib"]
20
+ path = "rust/src/lib.rs"
21
+
22
+ [dependencies]
23
+ pyo3 = { version = "0.28.2" }
24
+ rustc-hash = "2.1.1"
@@ -0,0 +1,131 @@
1
+ # PolyForm Noncommercial License 1.0.0
2
+
3
+ <https://polyformproject.org/licenses/noncommercial/1.0.0>
4
+
5
+ ## Acceptance
6
+
7
+ In order to get any license under these terms, you must agree
8
+ to them as both strict obligations and conditions to all
9
+ your licenses.
10
+
11
+ ## Copyright License
12
+
13
+ The licensor grants you a copyright license for the
14
+ software to do everything you might do with the software
15
+ that would otherwise infringe the licensor's copyright
16
+ in it for any permitted purpose. However, you may
17
+ only distribute the software according to [Distribution
18
+ License](#distribution-license) and make changes or new works
19
+ based on the software according to [Changes and New Works
20
+ License](#changes-and-new-works-license).
21
+
22
+ ## Distribution License
23
+
24
+ The licensor grants you an additional copyright license
25
+ to distribute copies of the software. Your license
26
+ to distribute covers distributing the software with
27
+ changes and new works permitted by [Changes and New Works
28
+ License](#changes-and-new-works-license).
29
+
30
+ ## Notices
31
+
32
+ You must ensure that anyone who gets a copy of any part of
33
+ the software from you also gets a copy of these terms or the
34
+ URL for them above, as well as copies of any plain-text lines
35
+ beginning with `Required Notice:` that the licensor provided
36
+ with the software. For example:
37
+
38
+ > Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
39
+
40
+ ## Changes and New Works License
41
+
42
+ The licensor grants you an additional copyright license to
43
+ make changes and new works based on the software for any
44
+ permitted purpose.
45
+
46
+ ## Patent License
47
+
48
+ The licensor grants you a patent license for the software that
49
+ covers patent claims the licensor can license, or becomes able
50
+ to license, that you would infringe by using the software.
51
+
52
+ ## Noncommercial Purposes
53
+
54
+ Any noncommercial purpose is a permitted purpose.
55
+
56
+ ## Personal Uses
57
+
58
+ Personal use for research, experiment, and testing for
59
+ the benefit of public knowledge, personal study, private
60
+ entertainment, hobby projects, amateur pursuits, or religious
61
+ observance, without any anticipated commercial application,
62
+ is use for a permitted purpose.
63
+
64
+ ## Noncommercial Organizations
65
+
66
+ Use by any charitable organization, educational institution,
67
+ public research organization, public safety or health
68
+ organization, environmental protection organization,
69
+ or government institution is use for a permitted purpose
70
+ regardless of the source of funding or obligations resulting
71
+ from the funding.
72
+
73
+ ## Fair Use
74
+
75
+ You may have "fair use" rights for the software under the
76
+ law. These terms do not limit them.
77
+
78
+ ## No Other Rights
79
+
80
+ These terms do not allow you to sublicense or transfer any of
81
+ your licenses to anyone else, or prevent the licensor from
82
+ granting licenses to anyone else. These terms do not imply
83
+ any other licenses.
84
+
85
+ ## Patent Defense
86
+
87
+ If you make any written claim that the software infringes or
88
+ contributes to infringement of any patent, your patent license
89
+ for the software granted under these terms ends immediately. If
90
+ your company makes such a claim, your patent license ends
91
+ immediately for work on behalf of your company.
92
+
93
+ ## Violations
94
+
95
+ The first time you are notified in writing that you have
96
+ violated any of these terms, or done anything with the software
97
+ not covered by your licenses, your licenses can nonetheless
98
+ continue if you come into full compliance with these terms,
99
+ and take practical steps to correct past violations, within
100
+ 32 days of receiving notice. Otherwise, all your licenses
101
+ end immediately.
102
+
103
+ ## No Liability
104
+
105
+ ***As far as the law allows, the software comes as is, without
106
+ any warranty or condition, and the licensor will not be liable
107
+ to you for any damages arising out of these terms or the use
108
+ or nature of the software, under any kind of legal claim.***
109
+
110
+ ## Definitions
111
+
112
+ The **licensor** is the individual or entity offering these
113
+ terms, and the **software** is the software the licensor makes
114
+ available under these terms.
115
+
116
+ **You** refers to the individual or entity agreeing to these
117
+ terms.
118
+
119
+ **Your company** is any legal entity, sole proprietorship,
120
+ or other kind of organization that you work for, plus all
121
+ organizations that have control over, are under the control of,
122
+ or are under common control with that organization. **Control**
123
+ means ownership of substantially all the assets of an entity,
124
+ or the power to direct its management and policies by vote,
125
+ contract, or otherwise. Control can be direct or indirect.
126
+
127
+ **Your licenses** are all the licenses granted to you for the
128
+ software under these terms.
129
+
130
+ **Use** means anything you do with the software requiring one
131
+ of your licenses.