firecode 1.6.0__tar.gz → 2.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. firecode-2.0.0/.coveragerc +29 -0
  2. {firecode-1.6.0 → firecode-2.0.0}/.gitignore +1 -0
  3. {firecode-1.6.0 → firecode-2.0.0}/CHANGELOG.md +25 -6
  4. firecode-2.0.0/PKG-INFO +151 -0
  5. firecode-2.0.0/README.md +120 -0
  6. {firecode-1.6.0 → firecode-2.0.0}/firecode/__main__.py +59 -38
  7. {firecode-1.6.0 → firecode-2.0.0}/firecode/ase_manipulations.py +501 -221
  8. {firecode-1.6.0 → firecode-2.0.0}/firecode/atropisomer_module.py +0 -1
  9. firecode-1.6.0/firecode/calculators/_ase_uma.py → firecode-2.0.0/firecode/calculators/ase_uma.py +33 -10
  10. firecode-2.0.0/firecode/calculators/solvation_delta_calc.py +246 -0
  11. firecode-1.6.0/firecode/calculators/_xtb.py → firecode-2.0.0/firecode/calculators/xtb.py +44 -322
  12. firecode-2.0.0/firecode/context_managers.py +178 -0
  13. firecode-2.0.0/firecode/dispatcher.py +331 -0
  14. {firecode-1.6.0 → firecode-2.0.0}/firecode/embedder.py +275 -444
  15. {firecode-1.6.0 → firecode-2.0.0}/firecode/embedder_options.py +54 -58
  16. firecode-2.0.0/firecode/ensemble.py +297 -0
  17. firecode-2.0.0/firecode/interfaces/crest.py +457 -0
  18. firecode-2.0.0/firecode/interfaces/goat.py +415 -0
  19. firecode-2.0.0/firecode/md/equilibration.py +277 -0
  20. firecode-2.0.0/firecode/md/packmol.py +359 -0
  21. firecode-2.0.0/firecode/modify_settings.py +128 -0
  22. {firecode-1.6.0 → firecode-2.0.0}/firecode/multiembed.py +2 -1
  23. {firecode-1.6.0 → firecode-2.0.0}/firecode/operators.py +226 -71
  24. {firecode-1.6.0 → firecode-2.0.0}/firecode/optimization_methods.py +119 -177
  25. {firecode-1.6.0 → firecode-2.0.0}/firecode/pka.py +2 -48
  26. {firecode-1.6.0 → firecode-2.0.0}/firecode/pt.py +1 -1
  27. {firecode-1.6.0 → firecode-2.0.0}/firecode/quotes.json +5 -1
  28. {firecode-1.6.0 → firecode-2.0.0}/firecode/rdkit_tools.py +17 -2
  29. {firecode-1.6.0 → firecode-2.0.0}/firecode/references.py +9 -0
  30. firecode-2.0.0/firecode/settings.py +67 -0
  31. firecode-2.0.0/firecode/solvents.py +226 -0
  32. {firecode-1.6.0 → firecode-2.0.0}/firecode/standalone_optimizer.py +364 -124
  33. firecode-2.0.0/firecode/tests/C2H4.xyz +8 -0
  34. {firecode-1.6.0 → firecode-2.0.0}/firecode/tests/conftest.py +4 -0
  35. {firecode-1.6.0 → firecode-2.0.0}/firecode/tests/embed_multiembed/embed_multiembed.txt +1 -1
  36. firecode-2.0.0/firecode/tests/operator_crest_search/operator_crest_search.txt +2 -0
  37. firecode-2.0.0/firecode/tests/operator_crest_search/salt.xyz +20 -0
  38. firecode-2.0.0/firecode/tests/operator_equilibrate/C2H4.xyz +8 -0
  39. firecode-2.0.0/firecode/tests/operator_equilibrate/operator_equilibrate.txt +2 -0
  40. firecode-2.0.0/firecode/tests/operator_goat/.firecoderc +2 -0
  41. firecode-2.0.0/firecode/tests/operator_goat/H2O.xyz +5 -0
  42. firecode-2.0.0/firecode/tests/operator_goat/operator_goat.txt +2 -0
  43. {firecode-1.6.0 → firecode-2.0.0}/firecode/tests/operator_neb/operator_neb.txt +1 -1
  44. firecode-2.0.0/firecode/tests/operator_pka/operator_pka.txt +4 -0
  45. firecode-2.0.0/firecode/tests/operator_racerts/operator_racerts.txt +4 -0
  46. firecode-2.0.0/firecode/tests/operator_racerts/taut_TS.xyz +11 -0
  47. {firecode-1.6.0 → firecode-2.0.0}/firecode/tests/operator_rdkit_search/operator_rdkit_search.txt +1 -1
  48. firecode-2.0.0/firecode/tests/operator_saddle/operator_saddle.txt +2 -0
  49. firecode-2.0.0/firecode/tests/operator_saddle/propane_ts.xyz +13 -0
  50. firecode-2.0.0/firecode/tests/operator_scan+neb/operator_scan+neb.txt +2 -0
  51. firecode-2.0.0/firecode/tests/operator_scan+neb/taut.xyz +11 -0
  52. firecode-2.0.0/firecode/tests/test_suite.py +304 -0
  53. firecode-2.0.0/firecode/thermochemistry.py +670 -0
  54. {firecode-1.6.0 → firecode-2.0.0}/firecode/torsion_module.py +1 -8
  55. {firecode-1.6.0 → firecode-2.0.0}/firecode/units.py +16 -0
  56. {firecode-1.6.0 → firecode-2.0.0}/firecode/utils.py +65 -162
  57. {firecode-1.6.0 → firecode-2.0.0}/pixi.lock +773 -162
  58. {firecode-1.6.0 → firecode-2.0.0}/pyproject.toml +28 -7
  59. firecode-1.6.0/.ase/gui.py +0 -1
  60. firecode-1.6.0/PKG-INFO +0 -81
  61. firecode-1.6.0/README.md +0 -52
  62. firecode-1.6.0/docs/conf.py +0 -64
  63. firecode-1.6.0/docs/embeddings.rst +0 -74
  64. firecode-1.6.0/docs/examples.rst +0 -188
  65. firecode-1.6.0/docs/images/atropo.png +0 -0
  66. firecode-1.6.0/docs/images/complex_embed_cd.png +0 -0
  67. firecode-1.6.0/docs/images/embeds.svg +0 -449
  68. firecode-1.6.0/docs/images/intro_embed.PNG +0 -0
  69. firecode-1.6.0/docs/images/logo.png +0 -0
  70. firecode-1.6.0/docs/images/orbitals.png +0 -0
  71. firecode-1.6.0/docs/images/peptide.png +0 -0
  72. firecode-1.6.0/docs/images/peptide_chemdraw.png +0 -0
  73. firecode-1.6.0/docs/images/plot.svg +0 -1534
  74. firecode-1.6.0/docs/images/qz_firecode.gif +0 -0
  75. firecode-1.6.0/docs/images/trimolecular.png +0 -0
  76. firecode-1.6.0/docs/index.rst +0 -13
  77. firecode-1.6.0/docs/installation.rst +0 -85
  78. firecode-1.6.0/docs/introduction.rst +0 -93
  79. firecode-1.6.0/docs/license.rst +0 -551
  80. firecode-1.6.0/docs/operators_keywords.rst +0 -214
  81. firecode-1.6.0/docs/requirements.txt +0 -2
  82. firecode-1.6.0/docs/usage.rst +0 -62
  83. firecode-1.6.0/firecode/modify_settings.py +0 -199
  84. firecode-1.6.0/firecode/settings.py +0 -71
  85. firecode-1.6.0/firecode/solvents.py +0 -131
  86. firecode-1.6.0/firecode/tests/embed_cyclical/C2H4.xyz +0 -8
  87. firecode-1.6.0/firecode/tests/operator_crest_search/dimer.xyz +0 -12
  88. firecode-1.6.0/firecode/tests/operator_crest_search/operator_crest_search.txt +0 -6
  89. firecode-1.6.0/firecode/tests/operator_pka/operator_pka.txt +0 -4
  90. firecode-1.6.0/firecode/tests/operator_scan+neb/SN2.xyz +0 -8
  91. firecode-1.6.0/firecode/tests/operator_scan+neb/operator_scan+neb.txt +0 -2
  92. firecode-1.6.0/firecode/tests/operator_scan_linear/dimer.xyz +0 -12
  93. firecode-1.6.0/firecode/tests/operator_scan_linear/operator_scan_linear.txt +0 -2
  94. firecode-1.6.0/firecode/tests/test_suite.py +0 -162
  95. {firecode-1.6.0 → firecode-2.0.0}/.github/workflows/test.yml +0 -0
  96. {firecode-1.6.0 → firecode-2.0.0}/.pre-commit-config.yaml +0 -0
  97. {firecode-1.6.0 → firecode-2.0.0}/.readthedocs.yaml +0 -0
  98. {firecode-1.6.0 → firecode-2.0.0}/LICENSE +0 -0
  99. {firecode-1.6.0 → firecode-2.0.0}/MANIFEST.in +0 -0
  100. {firecode-1.6.0 → firecode-2.0.0}/firecode/__init__.py +0 -0
  101. {firecode-1.6.0 → firecode-2.0.0}/firecode/algebra.py +0 -0
  102. {firecode-1.6.0 → firecode-2.0.0}/firecode/embeds.py +0 -0
  103. {firecode-1.6.0 → firecode-2.0.0}/firecode/errors.py +0 -0
  104. {firecode-1.6.0 → firecode-2.0.0}/firecode/graph_manipulations.py +0 -0
  105. {firecode-1.6.0 → firecode-2.0.0}/firecode/hypermolecule_class.py +0 -0
  106. {firecode-1.6.0 → firecode-2.0.0}/firecode/parameters.py +0 -0
  107. {firecode-1.6.0 → firecode-2.0.0}/firecode/profiler.py +0 -0
  108. {firecode-1.6.0 → firecode-2.0.0}/firecode/quotes.py +0 -0
  109. {firecode-1.6.0 → firecode-2.0.0}/firecode/reactive_atoms_classes.py +0 -0
  110. {firecode-1.6.0/firecode/tests → firecode-2.0.0/firecode/tests/embed_chelotropic}/C2H4.xyz +0 -0
  111. {firecode-1.6.0 → firecode-2.0.0}/firecode/tests/embed_chelotropic/HCOOOH.xyz +0 -0
  112. {firecode-1.6.0 → firecode-2.0.0}/firecode/tests/embed_chelotropic/embed_chelotropic.txt +0 -0
  113. {firecode-1.6.0/firecode/tests/embed_chelotropic → firecode-2.0.0/firecode/tests/embed_cyclical}/C2H4.xyz +0 -0
  114. {firecode-1.6.0 → firecode-2.0.0}/firecode/tests/embed_cyclical/embed_cyclical.txt +0 -0
  115. {firecode-1.6.0 → firecode-2.0.0}/firecode/tests/embed_multiembed/HCOOH.xyz +0 -0
  116. {firecode-1.6.0 → firecode-2.0.0}/firecode/tests/embed_string/CH3Cl.xyz +0 -0
  117. {firecode-1.6.0 → firecode-2.0.0}/firecode/tests/embed_string/HCOOH.xyz +0 -0
  118. {firecode-1.6.0 → firecode-2.0.0}/firecode/tests/embed_string/embed_string.txt +0 -0
  119. {firecode-1.6.0 → firecode-2.0.0}/firecode/tests/embed_trimolecular/CH3Cl.xyz +0 -0
  120. {firecode-1.6.0 → firecode-2.0.0}/firecode/tests/embed_trimolecular/HCOOH.xyz +0 -0
  121. {firecode-1.6.0 → firecode-2.0.0}/firecode/tests/embed_trimolecular/embed_trimolecular.txt +0 -0
  122. {firecode-1.6.0 → firecode-2.0.0}/firecode/tests/operator_fsm/anti_to_gauche.xyz +0 -0
  123. {firecode-1.6.0 → firecode-2.0.0}/firecode/tests/operator_fsm/operator_fsm.txt +0 -0
  124. {firecode-1.6.0 → firecode-2.0.0}/firecode/tests/operator_neb/anti_to_gauche.xyz +0 -0
  125. {firecode-1.6.0 → firecode-2.0.0}/firecode/tests/operator_pka/HCOOH.xyz +0 -0
  126. {firecode-1.6.0 → firecode-2.0.0}/firecode/tests/operator_pka/Me2NH2+.xyz +0 -0
  127. {firecode-1.6.0 → firecode-2.0.0}/firecode/tests/operator_pka/Me3N.xyz +0 -0
  128. {firecode-1.6.0 → firecode-2.0.0}/firecode/tests/operator_rdkit_search/butane.xyz +0 -0
  129. {firecode-1.6.0 → firecode-2.0.0}/firecode/tests/operator_scan_dihedral/C2F2H4.xyz +0 -0
  130. {firecode-1.6.0 → firecode-2.0.0}/firecode/tests/operator_scan_dihedral/operator_scan_dihedral.txt +0 -0
  131. {firecode-1.6.0 → firecode-2.0.0}/firecode/typing_.py +0 -0
  132. {firecode-1.6.0 → firecode-2.0.0}/icon.ico +0 -0
@@ -0,0 +1,29 @@
1
+ [run]
2
+ source = prism_pruner
3
+ omit =
4
+ firecode/__main__.py
5
+ */.pixi/*
6
+ */tests/*
7
+ # */venv/*
8
+ # setup.py
9
+ # */__pycache__/*
10
+
11
+ [report]
12
+ exclude_lines =
13
+ # Have to re-enable the standard pragma
14
+ pragma: no cover
15
+
16
+ # Don't complain about missing debug-only code:
17
+ def __repr__
18
+ if self\.debug
19
+
20
+ # Don't complain if tests don't hit defensive assertion code:
21
+ raise AssertionError
22
+ raise NotImplementedError
23
+
24
+ # Don't complain if non-runnable code isn't run:
25
+ if 0:
26
+ if __name__ == .__main__.:
27
+
28
+ # Don't complain if an ellipsis isn't run (typically in an abstractmethod):
29
+ ^\s*\.\.\.
@@ -7,5 +7,6 @@ firecode.egg-info/
7
7
 
8
8
  firecode/calculators/uma-s-1p1.pt
9
9
  firecode/calculators/uma-s-1p2.pt
10
+ firecode/calculators/esen_sm_conserving_all.pt
10
11
  coverage.xml
11
12
  .coverage
@@ -1,10 +1,29 @@
1
1
 
2
- <!-- - Introduced compatibility of SADDLE and NEB keywords for scan> runs with both 2 indices (distance scans) and 4 indices (distance scans) -->
3
-
4
- <!-- - ... mep_relax> BETA
5
-
6
- <!-- FINALSPLEVEL keyword? -->
7
- <!-- add documentation: SCRAMBLECHECK kw, fsm>, neb>, rdkit_search>, standalone optimizer, non-inline constraints-->
2
+ <!-- add documentation: SCRAMBLECHECK kw, fsm>, neb>, rdkit_search>, standalone optimizer, non-inline constraints-->
3
+ <!-- add number of active constraints printout for parallel multithread functions -->
4
+
5
+
6
+ ## FIRECODE 2.0.0 🔥 (WIP)
7
+ - Restructured and expanded solvent module.
8
+ - Implemented vibrational analysis via ASE including quasi-RRHO thermochemistry to get free energies.
9
+ - Added Sella dependency to perform saddle points optimization with the `saddle>` operator.
10
+ - Added FREQ keyword, computing free energies at the end of embedding or refine runs.
11
+ - Added `freq>` operator for standalone frequency analysis on any ensemble.
12
+ - Added T (temperature, in K), T_C (temperature, in °C), P (pressure, in atm), and C (concentration, in mol/L) keywords.
13
+ - Updated CREST interface to version 3 of the program (see [paper](https://doi.org/10.1063/5.0197592) and [documentation](https://crest-lab.github.io/crest-docs/))
14
+ - Added delta solvation implementation for gas-phase ML models, providing energies _and_ forces via TBLITE in the geometry optimization loop. Activate with environmental variable FIRECODE_SOLV_IMPLEM_FOR_ML="opt"
15
+ - Dropped support for native XTB calculator, and XTB-pyhton interface, since TBLITE is the modern successor.
16
+ - Added basic [racerts](https://github.com/digital-chemistry-laboratory/racerts) interface ("rdkit_search>" operator, alias of "racerts>").
17
+ - Removed PROCS keyword.
18
+ - Removed force field pre-optimization and related keywords (FFCALC, FFLEVEL)
19
+ - Added basic interface to ORCA's [GOAT](https://onlinelibrary.wiley.com/doi/abs/10.1002/anie.202500393) via the `goat>` operator (GFN2-xTB level with GFN-FF uphill steps).
20
+ - Renamed "CRESTNCI" keyword to "NCI" to cater for both CREST and GOAT.
21
+ - Significant restructuring of some core code organization (interfaces, context_manager.py, settings.py)
22
+ - Separated interfaces with external programs in "interfaces".
23
+ - Added the use of environmental variables throughout the codebase. Defaults in settings.py, specific context managers in utils.py.
24
+ - Environment variables in settings.py can now be overridden by a local `.firecoderc` with key=value pairs in the same folder as the input file.
25
+ - Added automated [packmol](https://github.com/m3g/packmol) solvator interface (`packmol>` operator, **preview**!).
26
+ <!-- - Added MD equilibration of solvated boxes (`equilibrate>`) -->
8
27
 
9
28
  ## FIRECODE 1.6.0 🔥 (March 11 2026)
10
29
  - Refreshed constraints handling in operators.
@@ -0,0 +1,151 @@
1
+ Metadata-Version: 2.4
2
+ Name: firecode
3
+ Version: 2.0.0
4
+ Summary: FIRECODE: Filtering Refiner and Embedder for Conformationally Dense Ensembles
5
+ Author-email: Nicolò Tampellini <nicolo.tampellini@yale.edu>
6
+ License-Expression: LGPL-3.0-or-later
7
+ License-File: LICENSE
8
+ Requires-Python: <3.13,>=3.12
9
+ Requires-Dist: ase
10
+ Requires-Dist: inquirerpy
11
+ Requires-Dist: matplotlib
12
+ Requires-Dist: mlfsm
13
+ Requires-Dist: networkx
14
+ Requires-Dist: numpy
15
+ Requires-Dist: prettytable
16
+ Requires-Dist: prism-pruner
17
+ Requires-Dist: psutil
18
+ Requires-Dist: racerts>=0.1.6
19
+ Requires-Dist: rdkit>=2025.9.3
20
+ Requires-Dist: rich
21
+ Requires-Dist: scipy
22
+ Requires-Dist: sella>=2.4.2
23
+ Provides-Extra: aimnet2
24
+ Requires-Dist: aimnet[ase]; extra == 'aimnet2'
25
+ Provides-Extra: full
26
+ Requires-Dist: aimnet[ase]; extra == 'full'
27
+ Requires-Dist: fairchem-core; extra == 'full'
28
+ Provides-Extra: uma
29
+ Requires-Dist: fairchem-core; extra == 'uma'
30
+ Description-Content-Type: text/markdown
31
+
32
+
33
+ # FIRECODE - Filtering Refiner and Embedder for Conformationally Dense Ensembles
34
+
35
+ <div align="center">
36
+
37
+ [![License: GNU LGPL v3](https://img.shields.io/github/license/ntampellini/firecode)](https://opensource.org/licenses/LGPL-3.0)
38
+ ![Python Version](https://img.shields.io/badge/Python-3.12-blue)
39
+ [![Powered by: Pixi](https://img.shields.io/badge/Powered_by-Pixi-facc15)](https://pixi.sh)
40
+ ![Size](https://img.shields.io/github/languages/code-size/ntampellini/firecode)
41
+ ![Lines](https://sloc.xyz/github/ntampellini/firecode/)
42
+ [![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/ntampellini/firecode)](https://www.codefactor.io/repository/github/ntampellini/firecode)
43
+ [![codecov](https://codecov.io/gh/ntampellini/FIRECODE/graph/badge.svg?token=D9TM6S33D8)](https://codecov.io/gh/ntampellini/FIRECODE)
44
+
45
+ [![PyPI](https://img.shields.io/pypi/v/firecode)](https://pypi.org/project/firecode/)
46
+ [![Wheel](https://img.shields.io/pypi/wheel/firecode)](https://pypi.org/project/firecode/)
47
+ [![Documentation Status](https://readthedocs.org/projects/firecode/badge/?version=latest)](https://firecode.readthedocs.io/en/latest/?badge=latest)
48
+ ![PyPI - Downloads](https://img.shields.io/pypi/dm/firecode)
49
+ [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v1.json)](https://github.com/charliermarsh/ruff)
50
+
51
+ ![Twitter](https://img.shields.io/twitter/url?url=https%3A%2F%2Ftwitter.com%2Fntampellini_&label=%40ntampellini_&link=https%3A%2F%2Ftwitter.com%2Fntampellini_)
52
+
53
+ </div>
54
+
55
+ <p align="center">
56
+
57
+ <img src="docs/images/logo.png" alt="FIRECODE logo" class="center" width="500"/>
58
+
59
+ </p>
60
+
61
+ FIRECODE is a computational chemistry workflow driver and hub for the generation, optimization and refinement of conformational ensembles, including transition state and thermochemical utilities.
62
+
63
+
64
+
65
+ <!-- It runs flexible workflows for conformer generation (via [CREST](https://github.com/crest-lab/crest), [RDKit](https://github.com/rdkit/rdkit)), double-ended TS search ([NEB](https://ase-lib.org/ase/neb.html) via [ASE](https://github.com/rosswhitfield/ase), [ML-FSM](https://github.com/thegomeslab/ML-FSM)), and (constrained) ensemble optimization through popular calculators like [XTB](https://github.com/grimme-lab/xtb), [TBLITE](https://github.com/tblite/tblite), [ORCA](https://www.orcasoftware.de/tutorials_orca/), and Pytorch Neural Network models ([AIMNET2](https://github.com/isayevlab/AIMNet2), [UMA](https://huggingface.co/facebook/UMA)) via [ASE](https://github.com/rosswhitfield/ase).
66
+
67
+ Conformational pruning is performed with the now standalone [PRISM Pruner](https://github.com/ntampellini/prism_pruner).
68
+
69
+ As a legacy feature from [TSCoDe](https://github.com/ntampellini/TSCoDe), FIRECODE can also assemble non-covalent adducts from conformational ensembles (embedding) programmatically. -->
70
+
71
+ ## Calculators
72
+
73
+ - [xTB](https://github.com/grimme-lab/xtb) *(native)*
74
+ - [tblite](https://github.com/tblite/tblite) *(via [ASE](https://github.com/rosswhitfield/ase))*
75
+ - [AIMNET2](https://github.com/isayevlab/AIMNet2) *(via [ASE](https://github.com/rosswhitfield/ase))*
76
+ - [UMA](https://huggingface.co/facebook/UMA) *(via [ASE](https://github.com/rosswhitfield/ase))*
77
+
78
+ ## Interfaces / utilities
79
+
80
+ - [CREST](https://github.com/crest-lab/crest) *(conformational search)*
81
+ - [GOAT](https://onlinelibrary.wiley.com/doi/abs/10.1002/anie.202500393) *(conformational search)*
82
+ - [racerts](https://github.com/digital-chemistry-laboratory/racerts) *(conformational search)*
83
+ - [ETKDG](https://pubs.acs.org/doi/10.1021/acs.jcim.0c00025) *(via [rdkit](https://github.com/rdkit/rdkit), conformational search)*
84
+ - [TSCoDe](https://github.com/ntampellini/TSCoDe) *(conformational embedding)*
85
+ - [prism_pruner](https://github.com/ntampellini/prism_pruner) *(conformational pruning)*
86
+ - [ML-FSM](https://pubs.acs.org/doi/10.1021/acs.jcim.0c00025) *(two-ended TS search)*
87
+ - [Sella](https://github.com/zadorlab/sella) *(saddle point optimization)*
88
+ <!-- - [packmol](https://github.com/m3g/packmol) *(explicit solvation)* -->
89
+
90
+ ...plus frequency calculation, NEB optimization, and more are all implemented in the code in a calculator-agnostic way.
91
+
92
+ ## Installation
93
+
94
+ The package is distributed via `pip`, and the use of [`uv`](https://docs.astral.sh/uv/) is highly recommended. The default installation is minimalistic, and torch/GPU support requires dedicated installs:
95
+
96
+ ```python
97
+ uv pip install firecode # XTB, TBLITE, ORCA
98
+ uv pip install firecode[aimnet2] # + AIMNET2
99
+ uv pip install firecode[uma] # + UMA/OMOL
100
+ uv pip install firecode[full] # + AIMNET2, UMA/OMOL
101
+ ```
102
+
103
+ More installation details in the documentation.
104
+
105
+ ## Usage
106
+
107
+ Installation exposes the main program working on a plain text file as well as a standalone optimizer.
108
+
109
+ ```
110
+ 🔥 firecode [-h] [-s] [-t] input.txt [-n NAME] [-p]
111
+
112
+ positional arguments:
113
+ inpufile.txt Input filename, can be any text file.
114
+
115
+ optional arguments:
116
+ -h, --help Show this help message and exit.
117
+ -s, --setup Guided setup of the calculation settings.
118
+ -n, --name NAME Specify a custom name for the run.
119
+ -cl,--command_line Read instructions from the command line instead of from an input file.
120
+ -p, --profile Profile the run through cProfiler.
121
+ ```
122
+
123
+ ```
124
+ 🔥 firecode_opt [-h] [-i] [-t TEMPERATURE] [-c CALCULATOR] [-m METHOD] [-s SOLVENT] [-o] [-f] [--ts] [--irc] [--cfile CFILE] [-n] [--debug]
125
+ filenames [filenames ...]
126
+
127
+ positional arguments:
128
+ filenames Input filename(s), in .xyz format
129
+
130
+ options:
131
+ -h, --help show this help message and exit
132
+ -i, --interactive Set options interactively.
133
+ -t TEMPERATURE, --temperature TEMPERATURE
134
+ Temperature, in degrees Celsius.
135
+ -c CALCULATOR, --calculator CALCULATOR
136
+ Calculator (default UMA).
137
+ -m METHOD, --method METHOD
138
+ Method (default OMOL for UMA).
139
+ -s SOLVENT, --solvent SOLVENT
140
+ Solvent (default ch2cl2).
141
+ -o, --opt Optimize the geometry.
142
+ -f, --freq Perform vibrational analysis.
143
+ --ts, --saddle Optimize to a TS.
144
+ --irc Run an IRC calculation.
145
+ --cfile CFILE Uses a constraint file.
146
+ -n, --newfile Write optimized structure to a new file (*_opt.xyz).
147
+ --debug Does not delete optimization data.
148
+ ```
149
+
150
+ ## Documentation
151
+ Documentation on how to install and use the program can be found on [readthedocs](https://firecode.readthedocs.io/en/latest/index.html).
@@ -0,0 +1,120 @@
1
+
2
+ # FIRECODE - Filtering Refiner and Embedder for Conformationally Dense Ensembles
3
+
4
+ <div align="center">
5
+
6
+ [![License: GNU LGPL v3](https://img.shields.io/github/license/ntampellini/firecode)](https://opensource.org/licenses/LGPL-3.0)
7
+ ![Python Version](https://img.shields.io/badge/Python-3.12-blue)
8
+ [![Powered by: Pixi](https://img.shields.io/badge/Powered_by-Pixi-facc15)](https://pixi.sh)
9
+ ![Size](https://img.shields.io/github/languages/code-size/ntampellini/firecode)
10
+ ![Lines](https://sloc.xyz/github/ntampellini/firecode/)
11
+ [![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/ntampellini/firecode)](https://www.codefactor.io/repository/github/ntampellini/firecode)
12
+ [![codecov](https://codecov.io/gh/ntampellini/FIRECODE/graph/badge.svg?token=D9TM6S33D8)](https://codecov.io/gh/ntampellini/FIRECODE)
13
+
14
+ [![PyPI](https://img.shields.io/pypi/v/firecode)](https://pypi.org/project/firecode/)
15
+ [![Wheel](https://img.shields.io/pypi/wheel/firecode)](https://pypi.org/project/firecode/)
16
+ [![Documentation Status](https://readthedocs.org/projects/firecode/badge/?version=latest)](https://firecode.readthedocs.io/en/latest/?badge=latest)
17
+ ![PyPI - Downloads](https://img.shields.io/pypi/dm/firecode)
18
+ [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v1.json)](https://github.com/charliermarsh/ruff)
19
+
20
+ ![Twitter](https://img.shields.io/twitter/url?url=https%3A%2F%2Ftwitter.com%2Fntampellini_&label=%40ntampellini_&link=https%3A%2F%2Ftwitter.com%2Fntampellini_)
21
+
22
+ </div>
23
+
24
+ <p align="center">
25
+
26
+ <img src="docs/images/logo.png" alt="FIRECODE logo" class="center" width="500"/>
27
+
28
+ </p>
29
+
30
+ FIRECODE is a computational chemistry workflow driver and hub for the generation, optimization and refinement of conformational ensembles, including transition state and thermochemical utilities.
31
+
32
+
33
+
34
+ <!-- It runs flexible workflows for conformer generation (via [CREST](https://github.com/crest-lab/crest), [RDKit](https://github.com/rdkit/rdkit)), double-ended TS search ([NEB](https://ase-lib.org/ase/neb.html) via [ASE](https://github.com/rosswhitfield/ase), [ML-FSM](https://github.com/thegomeslab/ML-FSM)), and (constrained) ensemble optimization through popular calculators like [XTB](https://github.com/grimme-lab/xtb), [TBLITE](https://github.com/tblite/tblite), [ORCA](https://www.orcasoftware.de/tutorials_orca/), and Pytorch Neural Network models ([AIMNET2](https://github.com/isayevlab/AIMNet2), [UMA](https://huggingface.co/facebook/UMA)) via [ASE](https://github.com/rosswhitfield/ase).
35
+
36
+ Conformational pruning is performed with the now standalone [PRISM Pruner](https://github.com/ntampellini/prism_pruner).
37
+
38
+ As a legacy feature from [TSCoDe](https://github.com/ntampellini/TSCoDe), FIRECODE can also assemble non-covalent adducts from conformational ensembles (embedding) programmatically. -->
39
+
40
+ ## Calculators
41
+
42
+ - [xTB](https://github.com/grimme-lab/xtb) *(native)*
43
+ - [tblite](https://github.com/tblite/tblite) *(via [ASE](https://github.com/rosswhitfield/ase))*
44
+ - [AIMNET2](https://github.com/isayevlab/AIMNet2) *(via [ASE](https://github.com/rosswhitfield/ase))*
45
+ - [UMA](https://huggingface.co/facebook/UMA) *(via [ASE](https://github.com/rosswhitfield/ase))*
46
+
47
+ ## Interfaces / utilities
48
+
49
+ - [CREST](https://github.com/crest-lab/crest) *(conformational search)*
50
+ - [GOAT](https://onlinelibrary.wiley.com/doi/abs/10.1002/anie.202500393) *(conformational search)*
51
+ - [racerts](https://github.com/digital-chemistry-laboratory/racerts) *(conformational search)*
52
+ - [ETKDG](https://pubs.acs.org/doi/10.1021/acs.jcim.0c00025) *(via [rdkit](https://github.com/rdkit/rdkit), conformational search)*
53
+ - [TSCoDe](https://github.com/ntampellini/TSCoDe) *(conformational embedding)*
54
+ - [prism_pruner](https://github.com/ntampellini/prism_pruner) *(conformational pruning)*
55
+ - [ML-FSM](https://pubs.acs.org/doi/10.1021/acs.jcim.0c00025) *(two-ended TS search)*
56
+ - [Sella](https://github.com/zadorlab/sella) *(saddle point optimization)*
57
+ <!-- - [packmol](https://github.com/m3g/packmol) *(explicit solvation)* -->
58
+
59
+ ...plus frequency calculation, NEB optimization, and more are all implemented in the code in a calculator-agnostic way.
60
+
61
+ ## Installation
62
+
63
+ The package is distributed via `pip`, and the use of [`uv`](https://docs.astral.sh/uv/) is highly recommended. The default installation is minimalistic, and torch/GPU support requires dedicated installs:
64
+
65
+ ```python
66
+ uv pip install firecode # XTB, TBLITE, ORCA
67
+ uv pip install firecode[aimnet2] # + AIMNET2
68
+ uv pip install firecode[uma] # + UMA/OMOL
69
+ uv pip install firecode[full] # + AIMNET2, UMA/OMOL
70
+ ```
71
+
72
+ More installation details in the documentation.
73
+
74
+ ## Usage
75
+
76
+ Installation exposes the main program working on a plain text file as well as a standalone optimizer.
77
+
78
+ ```
79
+ 🔥 firecode [-h] [-s] [-t] input.txt [-n NAME] [-p]
80
+
81
+ positional arguments:
82
+ inpufile.txt Input filename, can be any text file.
83
+
84
+ optional arguments:
85
+ -h, --help Show this help message and exit.
86
+ -s, --setup Guided setup of the calculation settings.
87
+ -n, --name NAME Specify a custom name for the run.
88
+ -cl,--command_line Read instructions from the command line instead of from an input file.
89
+ -p, --profile Profile the run through cProfiler.
90
+ ```
91
+
92
+ ```
93
+ 🔥 firecode_opt [-h] [-i] [-t TEMPERATURE] [-c CALCULATOR] [-m METHOD] [-s SOLVENT] [-o] [-f] [--ts] [--irc] [--cfile CFILE] [-n] [--debug]
94
+ filenames [filenames ...]
95
+
96
+ positional arguments:
97
+ filenames Input filename(s), in .xyz format
98
+
99
+ options:
100
+ -h, --help show this help message and exit
101
+ -i, --interactive Set options interactively.
102
+ -t TEMPERATURE, --temperature TEMPERATURE
103
+ Temperature, in degrees Celsius.
104
+ -c CALCULATOR, --calculator CALCULATOR
105
+ Calculator (default UMA).
106
+ -m METHOD, --method METHOD
107
+ Method (default OMOL for UMA).
108
+ -s SOLVENT, --solvent SOLVENT
109
+ Solvent (default ch2cl2).
110
+ -o, --opt Optimize the geometry.
111
+ -f, --freq Perform vibrational analysis.
112
+ --ts, --saddle Optimize to a TS.
113
+ --irc Run an IRC calculation.
114
+ --cfile CFILE Uses a constraint file.
115
+ -n, --newfile Write optimized structure to a new file (*_opt.xyz).
116
+ --debug Does not delete optimization data.
117
+ ```
118
+
119
+ ## Documentation
120
+ Documentation on how to install and use the program can be found on [readthedocs](https://firecode.readthedocs.io/en/latest/index.html).
@@ -14,13 +14,14 @@ GNU General Public License for more details.
14
14
 
15
15
  https://github.com/ntampellini/firecode
16
16
 
17
- Nicolo' Tampellini - nicolo.tampellini@yale.edu
17
+ Nicolo' Tampellini - ntamp@mit.edu
18
18
 
19
19
  """
20
20
 
21
21
  import argparse
22
22
  import os
23
23
  import sys
24
+ from io import TextIOWrapper
24
25
 
25
26
  from rich.traceback import install
26
27
 
@@ -28,13 +29,16 @@ install(show_locals=True)
28
29
 
29
30
 
30
31
  def main() -> None:
31
- sys.stdout = open(sys.stdout.fileno(), mode="w", encoding="utf8", buffering=1)
32
- sys.stderr = open(sys.stdout.fileno(), mode="w", encoding="utf8", buffering=1)
32
+ # Redirect stdout and stderr to handle encoding errors
33
+ sys.stdout = TextIOWrapper(
34
+ sys.stdout.buffer, encoding="utf-8", errors="replace", write_through=True
35
+ )
36
+
37
+ sys.stderr = TextIOWrapper(
38
+ sys.stdout.buffer, encoding="utf-8", errors="replace", write_through=True
39
+ )
33
40
 
34
- usage = """\n\n 🔥 python -m firecode [-h] [-s] [-t] input.txt [-n NAME] [-p]
35
- 🔥 python -m firecode -cl "refine> crest_search> mol.xyz"
36
- 🔥 python -m firecode -c
37
- 🔥 python -m firecode -o mol.xyz
41
+ usage = """\n\n 🔥 firecode [-h] [-s] [-t] input.txt [-n NAME] [-p]
38
42
 
39
43
  positional arguments:
40
44
  inpufile.txt Input filename, can be any text file.
@@ -44,9 +48,7 @@ def main() -> None:
44
48
  -s, --setup Guided setup of the calculation settings.
45
49
  -n, --name NAME Specify a custom name for the run.
46
50
  -cl,--command_line Read instructions from the command line instead of from an input file.
47
- -c, --cite Print citation links.
48
51
  -p, --profile Profile the run through cProfiler.
49
- -o, --optimize FILE Run a standalone structure optimization tool.
50
52
 
51
53
  """
52
54
 
@@ -70,13 +72,6 @@ def main() -> None:
70
72
  parser.add_argument(
71
73
  "-n", "--name", help="Specify a custom name for the run.", action="store", required=False
72
74
  )
73
- parser.add_argument(
74
- "-c",
75
- "--cite",
76
- help="Print the appropriate document links for citation purposes.",
77
- action="store_true",
78
- required=False,
79
- )
80
75
  parser.add_argument(
81
76
  "-p",
82
77
  "--profile",
@@ -84,19 +79,13 @@ def main() -> None:
84
79
  action="store_true",
85
80
  required=False,
86
81
  )
87
- parser.add_argument(
88
- "-o",
89
- "--optimize",
90
- help="Run a standalone structure optimization tool.",
91
- action="store",
92
- required=False,
93
- nargs="+",
94
- )
95
82
 
96
83
  args = parser.parse_args()
97
84
 
98
- if (not (args.setup or args.command_line or args.optimize)) and args.inputfile is None:
99
- parser.error("One of the following arguments are required: inputfile, -t, -s, -o.\n")
85
+ env_variables_handling()
86
+
87
+ if (not (args.setup or args.command_line)) and args.inputfile is None:
88
+ parser.error("One of the following arguments are required: inputfile, -t, -s.\n")
100
89
 
101
90
  if args.setup:
102
91
  from firecode.modify_settings import run_setup
@@ -104,18 +93,6 @@ def main() -> None:
104
93
  run_setup()
105
94
  sys.exit(0)
106
95
 
107
- if args.cite:
108
- print(
109
- "No citation link is available for FIRECODE yet. You can link to the code on https://www.github.com/ntampellini/firecode"
110
- )
111
- sys.exit(0)
112
-
113
- if args.optimize:
114
- from firecode.standalone_optimizer import main
115
-
116
- main(args.optimize)
117
- sys.exit(0)
118
-
119
96
  if args.command_line:
120
97
  filename = "input_firecode.txt"
121
98
  with open(filename, "w") as f:
@@ -140,5 +117,49 @@ def main() -> None:
140
117
  # run the program
141
118
 
142
119
 
120
+ def env_variables_handling() -> None:
121
+ """Handles global environment variables and associated processes.
122
+
123
+ Priority should be given to handling env vars with locally-scoped
124
+ context managers, if possible (see the env_override function).
125
+ """
126
+ from pathlib import Path
127
+ from shutil import rmtree
128
+
129
+ # remove compilation cache for jax: we might be running on different
130
+ # hardware from the last firecode run, and that might result in nasty
131
+ # compatibility issues with stale compilation of the jax library.
132
+ jax_comp_cache_dir = Path.home() / ".cache/sella/jax_cache"
133
+ rmtree(str(jax_comp_cache_dir), ignore_errors=True)
134
+
135
+ # export "FIRECODE_*" environment variables
136
+ from firecode.settings import ENV_VARS
137
+
138
+ for key, value in ENV_VARS.items():
139
+ os.environ.setdefault(key, value)
140
+
141
+ # override/add from global .firecoderc
142
+ if Path("~/.firecoderc").exists():
143
+ set_env_vars_from_file("~/.firecoderc")
144
+
145
+ # override/add from local .firecoderc
146
+ if ".firecoderc" in os.listdir(os.getcwd()):
147
+ set_env_vars_from_file(".firecoderc")
148
+
149
+
150
+ def set_env_vars_from_file(filename: str) -> None:
151
+ """Set environment variable from a text file."""
152
+ with open(filename, "r") as f:
153
+ lines = f.readlines()
154
+
155
+ print(f"--> Setting environment variables from {filename}")
156
+ for line in lines:
157
+ key, value = line.split("=")
158
+ key = key.strip().upper()
159
+ value = value.strip()
160
+ os.environ[key] = value
161
+ print(f" {key}={value}")
162
+
163
+
143
164
  if __name__ == "__main__":
144
165
  main()