Auto3D 3.1.1__tar.gz → 3.2.1__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 (281) hide show
  1. {auto3d-3.1.1/src/Auto3D.egg-info → auto3d-3.2.1}/PKG-INFO +5 -4
  2. {auto3d-3.1.1 → auto3d-3.2.1}/README.md +3 -3
  3. {auto3d-3.1.1 → auto3d-3.2.1}/pyproject.toml +24 -4
  4. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/__init__.py +6 -9
  5. auto3d-3.2.1/src/Auto3D/domain/clash_relief.py +176 -0
  6. auto3d-3.2.1/src/Auto3D/domain/conformer_budget.py +92 -0
  7. {auto3d-3.1.1/src/Auto3D/foundation/utils → auto3d-3.2.1/src/Auto3D/domain}/connectivity.py +95 -35
  8. {auto3d-3.1.1/src/Auto3D/foundation/utils → auto3d-3.2.1/src/Auto3D/domain}/convergence.py +10 -15
  9. auto3d-3.2.1/src/Auto3D/domain/embedding.py +497 -0
  10. {auto3d-3.1.1/src/Auto3D/foundation/utils → auto3d-3.2.1/src/Auto3D/domain}/energy.py +97 -60
  11. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/domain/filtering.py +77 -48
  12. auto3d-3.2.1/src/Auto3D/domain/geometry.py +137 -0
  13. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/domain/id_mapping.py +26 -14
  14. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/domain/ranking.py +332 -187
  15. auto3d-3.2.1/src/Auto3D/domain/stereo_check.py +396 -0
  16. auto3d-3.2.1/src/Auto3D/domain/stereochemistry.py +238 -0
  17. auto3d-3.2.1/src/Auto3D/domain/stereochemistry_smiles.py +300 -0
  18. auto3d-3.2.1/src/Auto3D/engines/batch_opt/batchopt.py +596 -0
  19. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/engines/batch_opt/fire_optimizer.py +33 -31
  20. auto3d-3.2.1/src/Auto3D/engines/batch_opt/model_wrapper.py +657 -0
  21. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/engines/batch_opt/optimization_engine.py +196 -51
  22. auto3d-3.2.1/src/Auto3D/engines/batch_opt/padding.py +205 -0
  23. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/engines/isomers/factory.py +58 -35
  24. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/engines/isomers/omega.py +64 -19
  25. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/engines/isomers/rdkit_sdf.py +42 -36
  26. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/engines/isomers/rdkit_smi.py +94 -60
  27. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/engines/isomers/tautomers.py +3 -4
  28. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/engines/model_factory.py +205 -40
  29. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/engines/models/__init__.py +9 -9
  30. auto3d-3.2.1/src/Auto3D/engines/models/adapter/__init__.py +38 -0
  31. auto3d-3.2.1/src/Auto3D/engines/models/adapter/aimnet2.py +260 -0
  32. auto3d-3.2.1/src/Auto3D/engines/models/adapter/ani.py +189 -0
  33. auto3d-3.2.1/src/Auto3D/engines/models/adapter/base.py +346 -0
  34. auto3d-3.2.1/src/Auto3D/engines/models/adapter/compiling.py +187 -0
  35. auto3d-3.2.1/src/Auto3D/engines/models/adapter/custom.py +116 -0
  36. auto3d-3.2.1/src/Auto3D/engines/models/adapter/validation.py +94 -0
  37. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/engines/models/ani2xt.py +34 -48
  38. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/engines/models/availability.py +2 -2
  39. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/engines/models/contract.py +161 -77
  40. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/engines/models/loading.py +17 -3
  41. auto3d-3.2.1/src/Auto3D/engines/models/policy.py +337 -0
  42. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/engines/models/preflight.py +150 -35
  43. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/engines/models/species.py +7 -17
  44. {auto3d-3.1.1/src/Auto3D/foundation → auto3d-3.2.1/src/Auto3D/engines}/torch_config.py +9 -11
  45. auto3d-3.2.1/src/Auto3D/entry/ASE/geometry.py +260 -0
  46. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/entry/ASE/thermo/calculator.py +35 -32
  47. auto3d-3.2.1/src/Auto3D/entry/ASE/thermo/driver.py +849 -0
  48. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/entry/ASE/thermo/properties.py +96 -36
  49. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/entry/ASE/thermo/vibrations.py +409 -47
  50. auto3d-3.2.1/src/Auto3D/entry/SPE.py +115 -0
  51. auto3d-3.2.1/src/Auto3D/entry/_run_setup.py +225 -0
  52. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/entry/auto3D.py +129 -51
  53. auto3d-3.2.1/src/Auto3D/entry/tautomer.py +238 -0
  54. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/foundation/config.py +329 -179
  55. auto3d-3.2.1/src/Auto3D/foundation/constants.py +383 -0
  56. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/foundation/exceptions.py +23 -10
  57. auto3d-3.2.1/src/Auto3D/foundation/process_lifecycle.py +106 -0
  58. auto3d-3.2.1/src/Auto3D/foundation/results.py +123 -0
  59. auto3d-3.2.1/src/Auto3D/foundation/utils/__init__.py +39 -0
  60. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/foundation/utils/atomic_io.py +49 -19
  61. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/foundation/utils/logging_config.py +58 -0
  62. auto3d-3.2.1/src/Auto3D/foundation/utils/molprops.py +44 -0
  63. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/foundation/utils/output_guard.py +35 -27
  64. auto3d-3.2.1/src/Auto3D/foundation/utils/output_names.py +44 -0
  65. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/foundation/utils/reconciliation.py +23 -13
  66. auto3d-3.2.1/src/Auto3D/foundation/utils/sdf_io.py +514 -0
  67. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/foundation/utils/smi_io.py +106 -2
  68. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/orchestration/chunk_manager.py +171 -59
  69. auto3d-3.2.1/src/Auto3D/orchestration/finalize.py +242 -0
  70. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/orchestration/job_layout.py +34 -9
  71. auto3d-3.2.1/src/Auto3D/orchestration/pipeline/input_checks.py +581 -0
  72. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/orchestration/processors.py +8 -5
  73. auto3d-3.2.1/src/Auto3D/orchestration/run_logging.py +187 -0
  74. auto3d-3.2.1/src/Auto3D/orchestration/supervisor.py +220 -0
  75. auto3d-3.2.1/src/Auto3D/orchestration/workflow.py +663 -0
  76. auto3d-3.2.1/src/Auto3D/orchestration/workflow_workers.py +502 -0
  77. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/presentation/auto3Dcli.py +11 -28
  78. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/presentation/cli/app.py +117 -59
  79. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/presentation/cli/commands/config.py +23 -32
  80. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/presentation/cli/commands/models.py +66 -42
  81. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/presentation/cli/commands/properties.py +18 -22
  82. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/presentation/cli/commands/run.py +147 -103
  83. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/presentation/cli/commands/validate.py +3 -4
  84. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/presentation/cli/config_schema.py +37 -85
  85. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/presentation/cli/console.py +2 -2
  86. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/presentation/cli/errors.py +103 -26
  87. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/presentation/cli/progress.py +0 -1
  88. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/presentation/cli/results.py +0 -1
  89. {auto3d-3.1.1 → auto3d-3.2.1/src/Auto3D.egg-info}/PKG-INFO +5 -4
  90. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D.egg-info/SOURCES.txt +51 -14
  91. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D.egg-info/requires.txt +1 -0
  92. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_SPE.py +37 -3
  93. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_adapter_atom_mask.py +47 -5
  94. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_adapter_fp64_contract.py +13 -3
  95. auto3d-3.2.1/tests/test_adapter_package_layout.py +38 -0
  96. auto3d-3.2.1/tests/test_adapter_template.py +159 -0
  97. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_ani2xt_atom_energies.py +2 -2
  98. auto3d-3.2.1/tests/test_ase_geometry.py +390 -0
  99. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_atomic_io.py +93 -6
  100. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_auto3Dcli.py +3 -1
  101. auto3d-3.2.1/tests/test_available_cpu_count.py +53 -0
  102. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_batchopt.py +230 -73
  103. auto3d-3.2.1/tests/test_bench_scripts.py +38 -0
  104. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_chunk_manager.py +287 -95
  105. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_cli.py +5 -5
  106. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_cli_app.py +154 -22
  107. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_cli_config_schema.py +61 -4
  108. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_cli_errors.py +93 -1
  109. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_cli_exit_codes.py +151 -32
  110. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_cli_property_commands.py +108 -36
  111. auto3d-3.2.1/tests/test_compile_values.py +245 -0
  112. auto3d-3.2.1/tests/test_config.py +344 -0
  113. auto3d-3.2.1/tests/test_config_bounds.py +204 -0
  114. auto3d-3.2.1/tests/test_config_parallel_embedding.py +251 -0
  115. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_config_parity.py +68 -17
  116. auto3d-3.1.1/tests/test_utils_molprops.py → auto3d-3.2.1/tests/test_conformer_budget.py +2 -37
  117. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_conftest_isolation_guards.py +6 -0
  118. auto3d-3.1.1/tests/test_utils_connectivity.py → auto3d-3.2.1/tests/test_connectivity.py +137 -10
  119. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_custom_nnp_contract.py +70 -1
  120. auto3d-3.2.1/tests/test_docs_compile_figures.py +13 -0
  121. auto3d-3.2.1/tests/test_docs_reproducibility.py +12 -0
  122. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_durability.py +261 -27
  123. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_e_tot_units.py +22 -28
  124. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_embed_params.py +8 -1
  125. auto3d-3.2.1/tests/test_energy_constants.py +76 -0
  126. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_filtering.py +35 -5
  127. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_filtering_thermo_failed.py +1 -1
  128. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_fire_optimizer.py +137 -19
  129. auto3d-3.2.1/tests/test_geometry.py +112 -0
  130. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_helpers_pipeline_output.py +30 -2
  131. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_hessian_invocation_contract.py +17 -12
  132. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_id_mapping.py +24 -5
  133. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_import_boundaries.py +82 -10
  134. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_isomer_engine.py +9 -4
  135. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_isomer_engine_hardening.py +255 -46
  136. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_isomers.py +158 -14
  137. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_job_layout.py +31 -0
  138. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_layer_boundaries.py +67 -23
  139. auto3d-3.2.1/tests/test_legacy_names.py +27 -0
  140. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_legacy_yaml_parity.py +3 -1
  141. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_logging_config.py +74 -0
  142. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_model_adapter.py +269 -23
  143. auto3d-3.2.1/tests/test_model_caching.py +230 -0
  144. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_model_factory.py +97 -27
  145. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_model_preflight.py +76 -7
  146. auto3d-3.2.1/tests/test_model_wrapper.py +708 -0
  147. auto3d-3.2.1/tests/test_molprops.py +30 -0
  148. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_mp_start_method.py +7 -5
  149. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_no_aimnet.py +13 -1
  150. auto3d-3.2.1/tests/test_non_finite_rows.py +150 -0
  151. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_optimization_engine.py +83 -1
  152. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_optimization_engine_indexing.py +54 -7
  153. auto3d-3.2.1/tests/test_output_names.py +51 -0
  154. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_output_overwrite_gates.py +3 -3
  155. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_packaging_metadata.py +3 -3
  156. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_padding.py +107 -3
  157. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_padding_invariance.py +21 -14
  158. auto3d-3.2.1/tests/test_parallel_embed.py +793 -0
  159. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_pipeline_e2e.py +57 -2
  160. auto3d-3.2.1/tests/test_policy.py +198 -0
  161. auto3d-3.2.1/tests/test_preflight_registry_offline.py +184 -0
  162. auto3d-3.2.1/tests/test_public_api.py +135 -0
  163. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_ranking.py +184 -39
  164. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_ranking_by_gibbs.py +96 -17
  165. auto3d-3.2.1/tests/test_record_policy_agreement.py +245 -0
  166. auto3d-3.2.1/tests/test_results.py +101 -0
  167. auto3d-3.2.1/tests/test_run_setup.py +395 -0
  168. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_sdf_isomer_enumeration.py +136 -3
  169. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_smiles_stereo_warning.py +70 -15
  170. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_spe_energy_only.py +69 -42
  171. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_species_conversion.py +1 -1
  172. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_species_module.py +11 -1
  173. auto3d-3.2.1/tests/test_stereo_check_positions.py +18 -0
  174. auto3d-3.2.1/tests/test_stereo_identity.py +496 -0
  175. auto3d-3.2.1/tests/test_stereo_postopt.py +469 -0
  176. auto3d-3.1.1/tests/test_utils_stereochemistry.py → auto3d-3.2.1/tests/test_stereochemistry.py +24 -58
  177. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_stereochemistry_validation.py +1 -110
  178. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_suite_hygiene.py +61 -0
  179. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_tauto.py +2 -2
  180. auto3d-3.2.1/tests/test_tautomer_select.py +315 -0
  181. auto3d-3.2.1/tests/test_thermo_conventions.py +105 -0
  182. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_thermo_etot_sync.py +1 -1
  183. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_thermo_helpers.py +123 -77
  184. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_thermo_imaginary_mode_inversion.py +71 -5
  185. auto3d-3.2.1/tests/test_thermo_linearity.py +163 -0
  186. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_thermo_projection.py +333 -1
  187. auto3d-3.2.1/tests/test_thermo_record_assertions.py +268 -0
  188. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_thermo_relative_energies.py +112 -55
  189. auto3d-3.2.1/tests/test_thermo_temperature_validation.py +94 -0
  190. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_thermo_transition_state.py +1 -0
  191. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_torch_config.py +15 -15
  192. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_utils.py +12 -12
  193. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_utils_reconciliation.py +126 -0
  194. auto3d-3.2.1/tests/test_utils_sdf_io.py +634 -0
  195. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_utils_smi_io.py +109 -0
  196. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_utils_validation.py +21 -21
  197. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_validate_run_parity.py +1 -1
  198. auto3d-3.2.1/tests/test_validation.py +577 -0
  199. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_validation_errors.py +8 -8
  200. auto3d-3.2.1/tests/test_worker_lifecycle.py +255 -0
  201. auto3d-3.2.1/tests/test_workflow.py +2159 -0
  202. auto3d-3.2.1/tests/test_workflow_package_layout.py +129 -0
  203. auto3d-3.1.1/src/Auto3D/domain/clash_relief.py +0 -103
  204. auto3d-3.1.1/src/Auto3D/domain/embedding.py +0 -229
  205. auto3d-3.1.1/src/Auto3D/engines/batch_opt/batchopt.py +0 -444
  206. auto3d-3.1.1/src/Auto3D/engines/batch_opt/model_wrapper.py +0 -336
  207. auto3d-3.1.1/src/Auto3D/engines/batch_opt/padding.py +0 -96
  208. auto3d-3.1.1/src/Auto3D/engines/models/adapter.py +0 -849
  209. auto3d-3.1.1/src/Auto3D/engines/models/policy.py +0 -142
  210. auto3d-3.1.1/src/Auto3D/entry/ASE/geometry.py +0 -232
  211. auto3d-3.1.1/src/Auto3D/entry/ASE/thermo/driver.py +0 -708
  212. auto3d-3.1.1/src/Auto3D/entry/SPE.py +0 -182
  213. auto3d-3.1.1/src/Auto3D/entry/tautomer.py +0 -168
  214. auto3d-3.1.1/src/Auto3D/foundation/constants.py +0 -168
  215. auto3d-3.1.1/src/Auto3D/foundation/results.py +0 -82
  216. auto3d-3.1.1/src/Auto3D/foundation/utils/__init__.py +0 -60
  217. auto3d-3.1.1/src/Auto3D/foundation/utils/geometry.py +0 -112
  218. auto3d-3.1.1/src/Auto3D/foundation/utils/molprops.py +0 -75
  219. auto3d-3.1.1/src/Auto3D/foundation/utils/sdf_io.py +0 -207
  220. auto3d-3.1.1/src/Auto3D/foundation/utils/stereo_check.py +0 -166
  221. auto3d-3.1.1/src/Auto3D/foundation/utils/stereochemistry.py +0 -566
  222. auto3d-3.1.1/src/Auto3D/orchestration/pipeline/input_checks.py +0 -408
  223. auto3d-3.1.1/src/Auto3D/orchestration/workflow.py +0 -672
  224. auto3d-3.1.1/src/Auto3D/orchestration/workflow_workers.py +0 -365
  225. auto3d-3.1.1/tests/test_ase_geometry.py +0 -76
  226. auto3d-3.1.1/tests/test_config.py +0 -514
  227. auto3d-3.1.1/tests/test_model_caching.py +0 -108
  228. auto3d-3.1.1/tests/test_model_wrapper.py +0 -406
  229. auto3d-3.1.1/tests/test_parallel_embed.py +0 -263
  230. auto3d-3.1.1/tests/test_public_api.py +0 -67
  231. auto3d-3.1.1/tests/test_results.py +0 -45
  232. auto3d-3.1.1/tests/test_stereo_identity.py +0 -242
  233. auto3d-3.1.1/tests/test_stereo_postopt.py +0 -220
  234. auto3d-3.1.1/tests/test_tautomer_select.py +0 -108
  235. auto3d-3.1.1/tests/test_thermo_record_assertions.py +0 -85
  236. auto3d-3.1.1/tests/test_utils_energy_constants.py +0 -67
  237. auto3d-3.1.1/tests/test_utils_geometry.py +0 -143
  238. auto3d-3.1.1/tests/test_utils_sdf_io.py +0 -315
  239. auto3d-3.1.1/tests/test_validation.py +0 -303
  240. auto3d-3.1.1/tests/test_workflow.py +0 -1108
  241. {auto3d-3.1.1 → auto3d-3.2.1}/LICENSE +0 -0
  242. {auto3d-3.1.1 → auto3d-3.2.1}/MANIFEST.in +0 -0
  243. {auto3d-3.1.1 → auto3d-3.2.1}/setup.cfg +0 -0
  244. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/domain/__init__.py +0 -0
  245. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/engines/__init__.py +0 -0
  246. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/engines/batch_opt/__init__.py +0 -0
  247. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/engines/isomers/__init__.py +0 -0
  248. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/engines/isomers/base.py +0 -0
  249. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/engines/models/ani2xt_no_repulsion.pt +0 -0
  250. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/entry/ASE/__init__.py +0 -0
  251. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/entry/ASE/thermo/__init__.py +0 -0
  252. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/entry/__init__.py +0 -0
  253. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/foundation/__init__.py +0 -0
  254. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/foundation/registry.py +0 -0
  255. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/orchestration/__init__.py +0 -0
  256. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/orchestration/pipeline/__init__.py +0 -0
  257. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/presentation/__init__.py +0 -0
  258. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/presentation/cli/__init__.py +0 -0
  259. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/presentation/cli/commands/__init__.py +0 -0
  260. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D/py.typed +0 -0
  261. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D.egg-info/dependency_links.txt +0 -0
  262. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D.egg-info/entry_points.txt +0 -0
  263. {auto3d-3.1.1 → auto3d-3.2.1}/src/Auto3D.egg-info/top_level.txt +0 -0
  264. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_ase_torch_config.py +0 -0
  265. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_auto3D.py +0 -0
  266. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_cli_commands_config.py +0 -0
  267. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_cli_console.py +0 -0
  268. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_cli_models_command.py +0 -0
  269. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_cli_results.py +0 -0
  270. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_cli_security.py +0 -0
  271. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_custom_nnp_eager.py +0 -0
  272. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_element_sets.py +0 -0
  273. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_lazy_torchani_import.py +0 -0
  274. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_notebook_properties.py +0 -0
  275. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_optimization_engine_validation.py +0 -0
  276. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_processors.py +0 -0
  277. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_progress.py +0 -0
  278. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_registry.py +0 -0
  279. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_tautomer_stereo.py +0 -0
  280. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_thermo.py +0 -0
  281. {auto3d-3.1.1 → auto3d-3.2.1}/tests/test_thermo_reference.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Auto3D
3
- Version: 3.1.1
3
+ Version: 3.2.1
4
4
  Summary: Generating Low-energy 3D Conformers from SMILES/SDF
5
5
  Author-email: Zhen Liu <liu5@andrew.cmu.edu>, Tetiana Zubatiuk <tetiana@zubatyuk.com>, Adrian Roitberg <roitberg@ufl.edu>, Olexandr Isayev <olexandr@olexandrisayev.com>
6
6
  Maintainer-email: Olexandr Isayev <olexandr@olexandrisayev.com>
@@ -45,6 +45,7 @@ Requires-Dist: ase>=3.23.0; extra == "ase"
45
45
  Provides-Extra: dev
46
46
  Requires-Dist: pytest>=7.0; extra == "dev"
47
47
  Requires-Dist: pytest-cov>=4.0; extra == "dev"
48
+ Requires-Dist: pytest-timeout>=2.3; extra == "dev"
48
49
  Requires-Dist: mypy>=1.0; extra == "dev"
49
50
  Requires-Dist: types-requests; extra == "dev"
50
51
  Requires-Dist: ruff==0.15.9; extra == "dev"
@@ -104,12 +105,12 @@ and ANI2xt engines and ASE thermochemistry working out of the box; add the
104
105
  default AIMNet2 engine with one pip command inside the environment:
105
106
 
106
107
  ```bash
107
- conda install -c conda-forge auto3d # once the 3.1.1 feedstock update lands
108
+ conda install -c conda-forge auto3d # 3.2.0 on conda-forge
108
109
  pip install aimnet # adds the AIMNet2 engines
109
110
  ```
110
111
 
111
- If conda-forge still shows an older version, install with pip inside a conda
112
- environment instead — `installation.yml` sets up the supported combination:
112
+ To install with pip inside a conda environment instead, `installation.yml`
113
+ sets up the supported combination:
113
114
 
114
115
  ```bash
115
116
  conda env create --file installation.yml --name auto3D
@@ -44,12 +44,12 @@ and ANI2xt engines and ASE thermochemistry working out of the box; add the
44
44
  default AIMNet2 engine with one pip command inside the environment:
45
45
 
46
46
  ```bash
47
- conda install -c conda-forge auto3d # once the 3.1.1 feedstock update lands
47
+ conda install -c conda-forge auto3d # 3.2.0 on conda-forge
48
48
  pip install aimnet # adds the AIMNet2 engines
49
49
  ```
50
50
 
51
- If conda-forge still shows an older version, install with pip inside a conda
52
- environment instead — `installation.yml` sets up the supported combination:
51
+ To install with pip inside a conda environment instead, `installation.yml`
52
+ sets up the supported combination:
53
53
 
54
54
  ```bash
55
55
  conda env create --file installation.yml --name auto3D
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "Auto3D"
7
- version = "3.1.1"
7
+ version = "3.2.1"
8
8
  description = "Generating Low-energy 3D Conformers from SMILES/SDF"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
@@ -70,6 +70,7 @@ ase = [
70
70
  dev = [
71
71
  "pytest>=7.0",
72
72
  "pytest-cov>=4.0",
73
+ "pytest-timeout>=2.3",
73
74
  "mypy>=1.0",
74
75
  # requests ships no inline types; without the stubs mypy reports
75
76
  # `import-untyped` at models/preflight.py's download path.
@@ -128,9 +129,7 @@ select = [
128
129
  ]
129
130
  ignore = [
130
131
  "E501", # line too long (handled by formatter)
131
- "E402", # module level import not at top (needed for sys.path manipulation)
132
132
  "E741", # ambiguous variable name (scientific notation l, I, O)
133
- "N801", # class name should use CapWords (legacy code compatibility)
134
133
  "N802", # function name should be lowercase (legacy API compatibility)
135
134
  "N803", # argument name should be lowercase (scientific computing conventions)
136
135
  "N806", # variable name should be lowercase (scientific computing conventions)
@@ -176,6 +175,9 @@ ignore = [
176
175
  # one commit, sorting 34 files' imports was no longer the disruptive change it
177
176
  # had been the argument against. The code is enabled for tests/ again.
178
177
  "tests/*" = [
178
+ "N801", # class name should use CapWords (e.g. `userNNP1`/`userNNP2` fixtures
179
+ # mimicking a real user-provided NNP class; unrelated to this PR's
180
+ # three renames, so left as pre-existing debt here too)
179
181
  "F401", # unused imports (legacy test scaffolding, e.g. optional-dep guards)
180
182
  "E712", # `== True`/`== False` comparisons (common in older tests)
181
183
  "E702", # multiple statements on one line (semicolons in legacy tests)
@@ -242,9 +244,10 @@ testpaths = ["tests"]
242
244
  python_files = "test_*.py"
243
245
  python_classes = "Test*"
244
246
  python_functions = "test_*"
245
- addopts = "-v --tb=short -m 'not slow'"
247
+ addopts = "-v --tb=short -m 'not slow' --strict-markers"
246
248
  markers = [
247
249
  "slow: marks tests as slow (deselect with '-m \"not slow\"')",
250
+ "timeout: per-test wall-clock limit (pytest-timeout)",
248
251
  ]
249
252
  filterwarnings = [
250
253
  "error::pytest.PytestUnraisableExceptionWarning",
@@ -252,6 +255,23 @@ filterwarnings = [
252
255
  # must stay visible so tests can assert them (audit M34).
253
256
  "default::DeprecationWarning:Auto3D.*",
254
257
  "default::UserWarning:Auto3D.*",
258
+ # A `module` selector matches the frame a warning is ATTRIBUTED to (per
259
+ # stacklevel), not the frame that raised it; both of these are raised
260
+ # from Auto3D with a stacklevel that deliberately attributes them to the
261
+ # caller's own module, so `Auto3D.*` above cannot gate either one -- only
262
+ # a message-based filter keeps "no production path uses this" enforced.
263
+ "error:Auto3DOptions is not a dict:DeprecationWarning",
264
+ # Same reasoning as the filter above, for the ensemble_opt legacy-key path.
265
+ "error:The optimizer parameter key opttol:DeprecationWarning",
266
+ # Same reasoning again, for the three retired-name module __getattr__ hooks:
267
+ # a caller-attributed stacklevel means only a message-based filter can
268
+ # enforce "no production path imports an old name".
269
+ "error:Legacy name:DeprecationWarning",
270
+ # Same reasoning again, for Auto3DOptions' mpi_np/enumerate_isomer ->
271
+ # isomer_threads/enumerate_isomers aliases (P-m15): "error" so the suite
272
+ # fails if any production path still constructs a config with an old
273
+ # option name instead of the renamed one.
274
+ "error:Option name:DeprecationWarning",
255
275
  # Third-party noise we do not control.
256
276
  "ignore:.*pkg_resources is deprecated.*:DeprecationWarning",
257
277
  "ignore:.*Importing 'parser.split_arg_string' is deprecated.*:DeprecationWarning",
@@ -31,20 +31,14 @@ __version__ = _detect_version()
31
31
  # --help`, a build script reading `__version__`, a tool that merely lists
32
32
  # installed distributions -- and none of them need torch or rdkit.
33
33
  #
34
- # This file used to end with three eager optional-dependency probes (openeye,
35
- # torchani, and `from Auto3D.engines.batch_opt.ANI2xt_no_rep import ANI2xt`) wrapped in
36
- # `warnings.catch_warnings()`. Nothing consumed any of them, and the third one
37
- # defeated the `_LAZY_API` mechanism below outright: it reached ANI2xt_no_rep ->
38
- # the Auto3D.foundation.utils barrel -> utils.validation -> Auto3D.engines.models.* + torch, which
39
- # turned `import Auto3D` into 1175 modules and 1.35 s and eagerly loaded 20
40
- # Auto3D submodules. Every probe is already duplicated where it is load-bearing
41
- # and where its result is actually used:
34
+ # Each optional dependency is checked where it is load-bearing and where
35
+ # its result is actually used, not here:
42
36
  # * openeye -> isomers/omega.py and isomers/tautomers.py (names used at
43
37
  # call time) and pipeline/input_checks.py (raises
44
38
  # DependencyError with a hint)
45
39
  # * torchani -> pipeline/input_checks.py (same) and models/ani2xt.py
46
40
  # * ANI2xt -> constructed only through model_factory / models.adapter
47
- # Do not reintroduce a probe here. A dependency is checked where it is needed.
41
+ # Do not add a probe here. A dependency is checked where it is needed.
48
42
 
49
43
  __all__ = [
50
44
  "__version__",
@@ -65,6 +59,8 @@ __all__ = [
65
59
  # Tautomers
66
60
  "get_stable_tautomers",
67
61
  "select_tautomers",
62
+ # Progress reporting
63
+ "ProgressEvent",
68
64
  ]
69
65
 
70
66
  # name -> (module, attribute) for lazy public-API imports. generate_conformers is
@@ -82,6 +78,7 @@ _LAZY_API: dict[str, tuple[str, str]] = {
82
78
  "calc_thermo": ("Auto3D.entry.ASE.thermo", "calc_thermo"),
83
79
  "get_stable_tautomers": ("Auto3D.entry.tautomer", "get_stable_tautomers"),
84
80
  "select_tautomers": ("Auto3D.entry.tautomer", "select_tautomers"),
81
+ "ProgressEvent": ("Auto3D.orchestration.workflow_workers", "ProgressEvent"),
85
82
  }
86
83
 
87
84
 
@@ -0,0 +1,176 @@
1
+ #!/usr/bin/env python
2
+ """Force-field relief of a clashing embedded conformer.
3
+
4
+ A domain operation, not a generic helper: it runs MMFF (with a UFF fallback),
5
+ it can change the molecule it is handed, and it makes a keep/reject decision
6
+ about stereochemistry. That is why it sits beside the embedding code rather
7
+ than under ``Auto3D.foundation.utils``, whose modules are leaves that neither optimize nor
8
+ judge.
9
+ """
10
+
11
+ from __future__ import annotations
12
+
13
+ import logging
14
+
15
+ import numpy as np
16
+ from rdkit import Chem
17
+ from rdkit.Chem import AllChem
18
+
19
+ from Auto3D.domain.connectivity import UFF_BOND_RADII
20
+ from Auto3D.domain.geometry import min_pairwise_distance
21
+ from Auto3D.domain.stereo_check import stereo_descriptors_from_3d
22
+ from Auto3D.foundation.constants import MIN_ATOM_DISTANCE, MIN_BONDED_FRACTION
23
+
24
+ logger = logging.getLogger("auto3d")
25
+
26
+ __all__ = ["relieve_clash"]
27
+
28
+
29
+ def _shortest_bonded_ratio(
30
+ mol: Chem.Mol, positions: np.ndarray, bonded_pairs: set[frozenset[int]]
31
+ ) -> float:
32
+ """Minimum, over every bonded pair, of distance / UFF reference length.
33
+
34
+ The radius-scaled form of the bonded floor: each bond
35
+ is judged against ITS OWN reference length (``r_i + r_j`` from
36
+ ``domain.connectivity.UFF_BOND_RADII``), not a single flat distance, so
37
+ a bond between heavier elements -- whose reference length is longer --
38
+ is not under-covered relative to a light one.
39
+
40
+ A pair whose element is outside ``UFF_BOND_RADII`` (e.g. an alkali/
41
+ alkaline-earth counterion or a transition-metal coordination bond) has
42
+ no reference length to scale by and is skipped -- "no opinion", the same
43
+ policy ``check_connectivity`` uses for the same elements.
44
+
45
+ Returns:
46
+ The minimum ratio, or ``inf`` if ``bonded_pairs`` is empty or every
47
+ pair in it involves an untabulated element.
48
+ """
49
+ ratios = []
50
+ for pair in bonded_pairs:
51
+ i, j = tuple(pair)
52
+ r_i = UFF_BOND_RADII.get(mol.GetAtomWithIdx(i).GetAtomicNum())
53
+ r_j = UFF_BOND_RADII.get(mol.GetAtomWithIdx(j).GetAtomicNum())
54
+ if r_i is None or r_j is None:
55
+ continue
56
+ distance = float(np.linalg.norm(positions[i] - positions[j]))
57
+ ratios.append(distance / (r_i + r_j))
58
+ return min(ratios) if ratios else float("inf")
59
+
60
+
61
+ def relieve_clash(
62
+ mol: Chem.Mol,
63
+ conf_id: int,
64
+ min_distance: float = MIN_ATOM_DISTANCE,
65
+ ) -> bool:
66
+ """Optimize a clashing conformer in place and report whether it is usable.
67
+
68
+ A conformer is considered "clashing" when its minimum pairwise
69
+ NON-BONDED interatomic distance is below ``min_distance``, or when any
70
+ BONDED pair's distance is below ``MIN_BONDED_FRACTION`` of that bond's
71
+ own UFF reference length -- bonded pairs are excluded from the
72
+ first test but still need a floor of their own, scaled per bond
73
+ rather than flat, or a physically impossible bond length (a crushed
74
+ embedding) would pass through unchecked. Such conformers are relaxed
75
+ with MMFF; when the molecule lacks full MMFF parameters (elements like
76
+ B, Se or some Si valences, where ``MMFFOptimizeMolecule`` returns -1 and
77
+ does nothing), the function falls back to UFF so the conformer is not
78
+ discarded for lack of a force field.
79
+
80
+ The force-field relaxation can itself invert a stereocenter or rotate a
81
+ double bond. This runs before the enumerated SDF is written, so the
82
+ downstream post-optimization stereochemistry check would otherwise read an
83
+ already-changed geometry as its own "before" reference and never notice.
84
+ Stereochemistry is therefore checked before and after the relaxation, on
85
+ this same molecule object, and a conformer whose configuration changed is
86
+ rejected here rather than passed downstream.
87
+
88
+ Known limitation: the "before" snapshot is read while the conformer is
89
+ still in violation of ``min_distance`` — by definition, since that is the
90
+ only way execution reaches this branch. Tag perception on a geometry that
91
+ is itself clashing is not a trustworthy baseline, unlike the equivalent
92
+ check in ``batch_opt/batchopt.py``, whose "before" reading is always
93
+ taken from a valid, non-clashing conformer. This matters only when the
94
+ branch is actually reached: across roughly 650 conformers sampled from
95
+ Auto3D's real ``EmbedMultipleConfs`` output (glucose, cholesterol, a
96
+ tripeptide, macrocycles, a cage compound, and molecules with B/Se/
97
+ hypervalent Si), none ever fell below the clash threshold. Under 196
98
+ artificially forced clashes, this guard rejected 96 conformers, and about
99
+ 56% of those rejections had a post-relaxation configuration that actually
100
+ matched the molecule's true configuration -- spurious rejections caused
101
+ by the unreliable baseline rather than a real inversion. Both rates were
102
+ measured against the pre-3.2.0 ``_CIPCode`` descriptor; re-measuring them
103
+ against the chiral-tag descriptor that replaced it changed nothing at this
104
+ seam (0 of 105 clean relaxations and 10 of 420 noised ones flip under
105
+ either reading, molecule by molecule), so the two figures still describe
106
+ what happens here. The known improvement is to compare against the
107
+ molecule's graph-encoded stereo tags instead of a 3D read of the clashing
108
+ geometry, and that is now a measurement rather than a research question:
109
+ a tag carried on the graph and a tag derived from the coordinates are the
110
+ same ``CHI_TETRAHEDRAL_CW``/``CCW`` alphabet, so the two are directly
111
+ comparable -- what still has to be measured is how often a record
112
+ reaching this branch carries a graph tag to compare against at all.
113
+
114
+ Args:
115
+ mol: RDKit molecule holding the conformer.
116
+ conf_id: Index of the conformer to check/optimize.
117
+ min_distance: Minimum acceptable interatomic distance (Angstroms).
118
+
119
+ Returns:
120
+ True if the (possibly optimized) conformer passes BOTH tests --
121
+ its minimum pairwise NON-BONDED distance is >= ``min_distance`` AND
122
+ every BONDED pair's distance is at least ``MIN_BONDED_FRACTION`` of
123
+ that bond's own UFF reference length -- and its stereochemistry
124
+ survived unchanged; False if it still fails either test or if the
125
+ relaxation changed its configuration.
126
+ """
127
+ # A bonded pair is not a NON-BONDED clash candidate: H2's
128
+ # equilibrium bond length (0.741 A) sits below MIN_ATOM_DISTANCE and is
129
+ # not a clash. But excluding bonded pairs outright would leave them with
130
+ # no floor at all, and a bonded pair at a physically impossible length
131
+ # (a crushed embedding) is exactly the geometry this guard exists to
132
+ # catch -- so a bonded pair still has its own floor, scaled by its
133
+ # own UFF reference length (MIN_BONDED_FRACTION) and tested
134
+ # alongside the non-bonded one. The exclusion set is read off the
135
+ # molecular graph once per call rather than cached, since relieve_clash
136
+ # can be called again after the force field has changed the geometry
137
+ # (but not the connectivity) between calls.
138
+ bonded_pairs = {frozenset((b.GetBeginAtomIdx(), b.GetEndAtomIdx())) for b in mol.GetBonds()}
139
+
140
+ def _survives(positions) -> bool:
141
+ return (
142
+ min_pairwise_distance(positions, exclude=bonded_pairs) >= min_distance
143
+ and _shortest_bonded_ratio(mol, positions, bonded_pairs) >= MIN_BONDED_FRACTION
144
+ )
145
+
146
+ positions = mol.GetConformer(conf_id).GetPositions()
147
+ # Closing the dead band: a conformer exactly AT the bonded threshold is
148
+ # kept (0.6 and the UFF radii involved are all exactly representable).
149
+ # The non-bonded comparison is not exact the same way:
150
+ # min_pairwise_distance casts to float32, so an exact 0.9 A separation
151
+ # comes back as 0.8999999761581421 -- just under min_distance -- and
152
+ # goes to the force field rather than being kept outright. Harmless in
153
+ # practice (one extra force-field call on a measure-zero geometry), but
154
+ # worth stating correctly rather than claiming both thresholds behave
155
+ # the same at their exact boundary.
156
+ if _survives(positions):
157
+ return True
158
+
159
+ # Clashing conformer: try MMFF, fall back to UFF when MMFF is unavailable.
160
+ before = stereo_descriptors_from_3d(mol, conf_id=conf_id)
161
+ if AllChem.MMFFHasAllMoleculeParams(mol):
162
+ AllChem.MMFFOptimizeMolecule(mol, confId=conf_id)
163
+ else:
164
+ AllChem.UFFOptimizeMolecule(mol, confId=conf_id)
165
+
166
+ # Clash relief is a force-field relaxation and can invert a center just as
167
+ # the neural network optimization can. It runs before the enumerated SDF is
168
+ # written, so the post-optimization check downstream would read an already
169
+ # inverted geometry as its reference and never notice. Reject the conformer
170
+ # here instead; the embedder simply keeps the ones that survive.
171
+ if stereo_descriptors_from_3d(mol, conf_id=conf_id) != before:
172
+ logger.warning("Discarding a conformer whose stereochemistry changed during clash relief.")
173
+ return False
174
+
175
+ positions = mol.GetConformer(conf_id).GetPositions()
176
+ return _survives(positions)
@@ -0,0 +1,92 @@
1
+ #!/usr/bin/env python
2
+ """The conformer budget: how many conformers to embed per molecule.
3
+
4
+ The conformer budget is the policy that decides how many conformers to embed
5
+ per molecule; it is domain logic, so it lives here and not beside the file
6
+ I/O helpers in ``Auto3D.foundation.utils``.
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ from rdkit import Chem
12
+ from rdkit.Chem import rdMolDescriptors
13
+
14
+ from Auto3D.foundation.constants import (
15
+ CONFORMER_MULTIPLIER,
16
+ CONFORMER_ROTATABLE_COEFF,
17
+ CONFORMER_ROTATABLE_EXP,
18
+ MAX_CONFORMERS_CAP,
19
+ )
20
+
21
+ __all__ = ["calculate_conformer_count"]
22
+
23
+
24
+ def calculate_conformer_count(mol: Chem.Mol) -> int:
25
+ """Calculate the number of conformers to generate for a molecule.
26
+
27
+ Uses a formula based on the number of rotatable bonds, with a minimum
28
+ of the heavy atom count and a maximum cap. The result is floored at 1 so
29
+ a molecule never gets 0 conformers (which would silently drop tiny species
30
+ such as ``[H+]`` or a lone atom from the pipeline).
31
+
32
+ Rotatable bonds are counted on the heavy-atom graph (``Chem.RemoveAllHs``,
33
+ which also drops isotope-labeled hydrogens) using RDKit's default
34
+ (strict) definition, which does not count amide C-N rotors -- not on
35
+ whatever hydrogen state ``mol`` happens to carry: with explicit
36
+ hydrogens, RDKit's ``CalcNumRotatableBonds`` also counts C-O-H / C-N-H
37
+ torsions (glycerol requests 238 conformers with explicit Hs, 52 without),
38
+ for hydroxyl/amine orientations that heavy-atom symmetry pruning collapses
39
+ to one per skeleton (see ``Auto3D.domain.embedding.embed_params``) -- the
40
+ larger with-H request bought nothing for those orientations, only more
41
+ ETKDG attempts, which did leave more distinct skeletons for polyols after
42
+ pruning (measured with those same embedding settings at
43
+ ``CONFORMER_RANDOM_SEED``, ``pruneRmsThresh=0.3``,
44
+ ``useSymmetryForPruning=True``: glycerol, ``OCC(O)CO``, keeps 9 conformers
45
+ whether 52 or 238 are requested, under RDKit 2025.09.6 and under 2026.9.1
46
+ alike; alpha-D-glucopyranose,
47
+ ``C([C@@H]1[C@H]([C@@H]([C@H]([C@H](O1)O)O)O)O)O``, keeps 12 of 16
48
+ requested at the new heavy-atom budget vs. 69 of 321 requested at the old
49
+ with-H budget under RDKit 2025.09.6, and 14 of 16 vs. 83 of 321 under
50
+ 2026.9.1 -- the installed RDKit changes how many of the requested pool
51
+ survive pruning, not which budget is smaller; see
52
+ ``benchmarks/results-notes/2026-10-09-rdkit-2026-09-kept-counts.md``).
53
+ Computing the budget on the heavy-atom
54
+ graph makes the SMILES path (no-H) and the SDF/parallel paths (with-H)
55
+ agree on the same request; a caller that wants the larger pool back asks
56
+ for it explicitly with ``max_confs``.
57
+
58
+ Formula: min(max(1, num_heavy, 2 * 8.481 * (num_rotatable ** 1.642)), 1000)
59
+ The formula is Auto3D's own rule, adapted from Chan, Morris and Hutchison
60
+ (J. Chem. Theory Comput. 2021, 17, 2099-2106): the rotatable-bond
61
+ coefficient and exponent are cited to that work, the factor of 2 and the
62
+ heavy-atom floor are Auto3D's choices. None of the three has been checked
63
+ against the paper's text (a conformational-entropy study).
64
+
65
+ Reference: https://doi.org/10.1021/acs.jctc.0c01213
66
+
67
+ Args:
68
+ mol: RDKit molecule object (with or without hydrogens).
69
+
70
+ Returns:
71
+ Number of conformers to generate (always >= 1).
72
+
73
+ Example:
74
+ >>> from rdkit import Chem
75
+ >>> mol = Chem.MolFromSmiles("CCCCCC") # hexane
76
+ >>> count = calculate_conformer_count(mol)
77
+ >>> 1 <= count <= 1000
78
+ True
79
+ """
80
+ # RemoveAllHs, not RemoveHs: the latter keeps isotope-labeled hydrogens
81
+ # (D, T), so a deuterated hydroxyl would still count its C-O-H torsion and
82
+ # a labeled analog would get a larger budget than its protium parent.
83
+ num_rotatable = rdMolDescriptors.CalcNumRotatableBonds(Chem.RemoveAllHs(mol))
84
+ num_heavy = sum(1 for atom in mol.GetAtoms() if atom.GetAtomicNum() > 1)
85
+
86
+ formula_count = int(
87
+ CONFORMER_MULTIPLIER * CONFORMER_ROTATABLE_COEFF * (num_rotatable**CONFORMER_ROTATABLE_EXP)
88
+ )
89
+
90
+ # Floor at 1: a heavy-atom-free species (e.g. [H+]) or a single atom must
91
+ # still receive at least one conformer instead of being silently dropped.
92
+ return min(max(1, num_heavy, formula_count), MAX_CONFORMERS_CAP)
@@ -18,7 +18,74 @@ from rdkit.Chem import rdMolTransforms
18
18
 
19
19
  logger = logging.getLogger("auto3d")
20
20
 
21
- __all__ = ["check_connectivity", "amend_mol", "get_mol_connectivity"]
21
+ __all__ = ["UFF_BOND_RADII", "check_connectivity", "amend_mol", "get_mol_connectivity"]
22
+
23
+ #: UFF bond radii (Rappe et al. JACS 1992, Table 1), in angstroms. These
24
+ #: radii neglect the bond-order and electronegativity corrections in the
25
+ #: original paper. Where several types exist for the same element, the
26
+ #: largest of the types reachable from ordinary organic input was used --
27
+ #: not the largest in the table outright. Hydrogen is the one place that
28
+ #: distinction matters: UFF also tabulates ``H_b`` (bridging hydrogen, the
29
+ #: three-center B-H-B bond) at 0.460 A, larger than the ``H_`` 0.354 A used
30
+ #: here, but ``H_b`` is irrelevant to druglike input and adopting it would
31
+ #: loosen every X-H broken-bond threshold by 0.13 A (the hydrogen
32
+ #: qualification). Every other tabulated element's value here
33
+ #: already is its largest type (verified against an independent
34
+ #: transcription of Table 1): C_3 > C_R, N_3 > N_R, O_R > O_3, S_R > S_3+2,
35
+ #: P_3+3 > P_3+5, B_3 > B_2, and F/Cl/Br/I/Ge/As/Se/Sb/Te have one type each.
36
+ #: Consequence of the selection rule itself: a single bond-order-blind
37
+ #: reference length makes the broken-bond (1.25x) check lenient and the
38
+ #: formed-bond (1.1x) check strict, so a stretched aromatic/conjugated bond
39
+ #: or a short multiple bond can be mis-judged. The molecular graph already
40
+ #: carries bond orders (see get_mol_connectivity); a bond-order-aware
41
+ #: reference would be more accurate but is intentionally not used here.
42
+ #:
43
+ #: Exposed at module level (rather than local to check_connectivity) so
44
+ #: clash_relief.relieve_clash can scale its own bonded-pair floor by the
45
+ #: same per-element reference length instead of
46
+ #: carrying a second, independently-maintained copy of these numbers.
47
+ UFF_BOND_RADII: dict[int, float] = {
48
+ 1: 0.354,
49
+ 5: 0.838,
50
+ 6: 0.757,
51
+ 7: 0.700,
52
+ 8: 0.680, # UFF O_R (resonant/aromatic oxygen); was 0.658 (O_3), not the largest.
53
+ 9: 0.668,
54
+ 14: 1.117,
55
+ 15: 1.101, # UFF P_3+3 (trivalent phosphorus); was 1.117, a copy of Si's radius.
56
+ 16: 1.077, # UFF S_R (aromatic sulfur); was 1.064 (S_3+2), not the largest.
57
+ 17: 1.044,
58
+ 32: 1.197,
59
+ 33: 1.211,
60
+ 34: 1.190,
61
+ 35: 1.192,
62
+ 51: 1.407,
63
+ 52: 1.386,
64
+ 53: 1.382,
65
+ }
66
+
67
+ #: Atomic numbers already named by :func:`check_connectivity`'s untabulated-element
68
+ #: warning in this process.
69
+ #:
70
+ #: Module state, deliberately: the skip lives in an O(n^2) atom-pair loop, and a
71
+ #: run optimizes the same species thousands of times, so a per-pair -- or even
72
+ #: per-call -- warning would bury the log it is supposed to inform. One line per
73
+ #: element per process is the budget. It also must not be silent: skipping those
74
+ #: pairs means ``check_connectivity`` returns True for a geometry it never
75
+ #: actually checked, so a dissociated metal complex passes the filter.
76
+ #:
77
+ #: Per *process*, and that is not the same as per run: ``check_connectivity``
78
+ #: runs inside each ``workflow_workers.optim_rank_wrapper`` worker, which has
79
+ #: its own copy of this module, so a run spread over N chunk workers can emit
80
+ #: the line up to N times for one element. Deduplicating across processes would
81
+ #: need shared state for a log line, which is not worth it; read the budget as
82
+ #: "not once per atom pair", not as "exactly once per run".
83
+ #:
84
+ #: An autouse fixture in ``tests/conftest.py`` gives every test a fresh set
85
+ #: (``monkeypatch.setattr(connectivity, "_REPORTED_UNTABULATED_ELEMENTS",
86
+ #: set())``) rather than leaving a previous test's elements behind, which would
87
+ #: make a test asserting an element *is* named pass or fail by ordering.
88
+ _REPORTED_UNTABULATED_ELEMENTS: set[int] = set()
22
89
 
23
90
 
24
91
  def check_connectivity(mol: Chem.Mol) -> bool:
@@ -39,40 +106,22 @@ def check_connectivity(mol: Chem.Mol) -> bool:
39
106
  and electronegativity corrections. Bond is considered broken if length > 1.25x
40
107
  reference, and formed if distance < 1.1x reference.
41
108
 
109
+ Any atom pair involving an element outside that table is skipped, and the
110
+ element is named in one WARNING the first time it is met in this process
111
+ -- once per worker process, so a chunked run may say it more than once
112
+ for the same element (see ``_REPORTED_UNTABULATED_ELEMENTS``) -- so a
113
+ True from this function
114
+ for a molecule containing such an element is "found nothing wrong among
115
+ the pairs I could judge", not "checked everything".
116
+
42
117
  Bonds involving elements outside the covalent-radii table (e.g. alkali/
43
118
  alkaline-earth counterions or transition-metal coordination bonds, M-L)
44
119
  are NOT validated -- such pairs are skipped ("no opinion"), so the
45
120
  dissociation of an M-L bond will not be flagged as invalid connectivity.
46
121
  """
47
- # Initialize UFF bond radii (Rappe et al. JACS 1992)
48
- # Units of angstroms
49
- # These radii neglect the bond-order and electronegativity corrections in the
50
- # original paper. Where several values exist for the same atom, the largest
51
- # was used. Consequence: a single bond-order-blind reference length makes the
52
- # broken-bond (1.25x) check lenient and the formed-bond (1.1x) check strict,
53
- # so a stretched aromatic/conjugated bond or a short multiple bond can be
54
- # mis-judged. The molecular graph already carries bond orders (see
55
- # get_mol_connectivity); a bond-order-aware reference would be more accurate
56
- # but is intentionally not used here.
57
- Radii = {
58
- 1: 0.354,
59
- 5: 0.838,
60
- 6: 0.757,
61
- 7: 0.700,
62
- 8: 0.658,
63
- 9: 0.668,
64
- 14: 1.117,
65
- 15: 1.117,
66
- 16: 1.064,
67
- 17: 1.044,
68
- 32: 1.197,
69
- 33: 1.211,
70
- 34: 1.190,
71
- 35: 1.192,
72
- 51: 1.407,
73
- 52: 1.386,
74
- 53: 1.382,
75
- }
122
+ # UFF bond radii: see the module-level UFF_BOND_RADII docstring for the
123
+ # selection rule and its one qualification (hydrogen).
124
+ Radii = UFF_BOND_RADII
76
125
 
77
126
  atoms = [atom for atom in mol.GetAtoms()]
78
127
  n = len(atoms)
@@ -91,8 +140,19 @@ def check_connectivity(mol: Chem.Mol) -> bool:
91
140
  # Elements outside the UFF radii table (e.g. Na, K, Mg, Fe, Zn in
92
141
  # salts/metal complexes) have no reference radius. Skip such pairs
93
142
  # ("no opinion") rather than indexing the dict blindly, which would
94
- # raise KeyError and crash the whole filtering pass.
143
+ # raise KeyError and crash the whole filtering pass -- but say so
144
+ # once per element, because "no opinion" on every pair means
145
+ # this function returns True for a geometry it never checked.
95
146
  if atomic_num_i not in Radii or atomic_num_j not in Radii:
147
+ for z in (atomic_num_i, atomic_num_j):
148
+ if z in Radii or z in _REPORTED_UNTABULATED_ELEMENTS:
149
+ continue
150
+ _REPORTED_UNTABULATED_ELEMENTS.add(z)
151
+ logger.warning(
152
+ "Element %s has no reference radius; connectivity checks "
153
+ "skip pairs involving it.",
154
+ Chem.GetPeriodicTable().GetElementSymbol(z),
155
+ )
96
156
  continue
97
157
 
98
158
  bond = mol.GetBondBetweenAtoms(atom_i_idx, atom_j_idx)
@@ -155,10 +215,10 @@ def amend_mol(
155
215
  except (ValueError, RuntimeError, KeyError) as e:
156
216
  # ValueError: from RDKit SanitizeMol validation errors
157
217
  # RuntimeError: from RDKit internal errors during molecule processing
158
- # KeyError: defensive only. check_connectivity no longer raises KeyError
159
- # for unknown elements (it now skips them); retained to swallow any
160
- # stray dict-lookup error from RDKit internals rather than crash the
161
- # amendment of a single molecule.
218
+ # KeyError: `check_connectivity` never raises `KeyError`; this `except`
219
+ # is defensive-only, to swallow any stray dict-lookup error from
220
+ # RDKit internals rather than crash the amendment of a single
221
+ # molecule.
162
222
  logger.debug(f"Molecule amendment failed: {type(e).__name__}: {e}")
163
223
  return None
164
224
 
@@ -1,4 +1,3 @@
1
- # src/Auto3D/utils/convergence.py
2
1
  """The one place that knows what the ``Converged`` SDF property means.
3
2
 
4
3
  ``Converged`` is written by :mod:`Auto3D.engines.batch_opt.batchopt` for every record
@@ -6,20 +5,6 @@ it optimizes -- ``"True"`` or ``"False"`` -- and read by the three filters that
6
5
  decide which conformers survive (:class:`Auto3D.domain.ranking.ConformerRanker`,
7
6
  :func:`Auto3D.domain.filtering.filter_conformers`).
8
7
 
9
- All three used to read it as::
10
-
11
- try:
12
- converged = mol.GetProp('Converged').lower() == 'true'
13
- except KeyError:
14
- converged = False
15
-
16
- which silently deletes every record of any SDF **not** produced by
17
- ``batchopt``: an ``opt_geometry`` output, an ORCA/Gaussian export, a
18
- hand-built conformer set. ``ConformerRanker`` is public and documented, so
19
- pointing it at such a file returned ``[]``, wrote a **0-byte** SDF, and exited
20
- 0. The only message was an INFO line on a logger tree that has no handler
21
- outside ``main()``.
22
-
23
8
  A record that never claimed to be the output of an optimization is not a
24
9
  record that failed one. Absence of the property therefore means "not filtered
25
10
  on convergence" -- the record is kept, and the other filters (connectivity,
@@ -34,6 +19,7 @@ from rdkit import Chem
34
19
  __all__ = [
35
20
  "CONVERGED_PROP",
36
21
  "THERMO_FAILED_PROP",
22
+ "OPTIMIZATION_FAILED_PROP",
37
23
  "thermo_succeeded_or_unfiltered",
38
24
  "set_converged",
39
25
  "has_convergence_flag",
@@ -48,6 +34,15 @@ CONVERGED_PROP = "Converged"
48
34
  #: without importing ase and torch, the same reason ``CONVERGED_PROP`` lives
49
35
  #: here rather than in ``batch_opt``.
50
36
  THERMO_FAILED_PROP = "Thermo_failed"
37
+ #: Written by ``Auto3D.engines.batch_opt.batchopt.Optimizer.run`` for a record
38
+ #: whose energy went non-finite mid-optimization: ``"non_finite_energy"``,
39
+ #: the only reason today. No setter, same as ``THERMO_FAILED_PROP`` above --
40
+ #: that property has none either, and its callers (``ASE/thermo``) just
41
+ #: ``mol.SetProp`` directly. A record carrying this always also carries an
42
+ #: explicit ``Converged=False``, which ``converged_or_unfiltered`` already
43
+ #: drops, so no filter needs to know this property exists; it is written
44
+ #: purely for a reader asking why a record is missing from the ranked output.
45
+ OPTIMIZATION_FAILED_PROP = "Optimization_failed"
51
46
 
52
47
 
53
48
  def set_converged(mol: Chem.Mol, converged: bool) -> None: