├── .coveragerc ├── .gitattributes ├── .gitignore ├── .gitmodules ├── CHANGELOG.rst ├── CONTRIBUTING.rst ├── LICENSE.txt ├── MANIFEST.in ├── README.rst ├── conanfile.txt ├── docs ├── Makefile ├── make.bat └── source │ ├── _static │ └── .placeholder │ ├── api │ ├── api.rst │ ├── engine.rst │ ├── filters.rst │ ├── gears.rst │ ├── reaction_rules.rst │ ├── steering_wheel.rst │ └── utilities.rst │ ├── changelog.rst │ ├── conf.py │ ├── index.rst │ ├── readme.rst │ └── res │ ├── chemoton_header.png │ ├── chemoton_header.svg │ ├── chemoton_logo1.png │ ├── chemoton_logo1.svg │ └── chemoton_logo1_inverted.png ├── pytest.ini ├── requirements-dev.txt ├── requirements.txt ├── scine_chemoton ├── __init__.py ├── __main__.py ├── _version.py ├── default_settings.py ├── engine.py ├── filters │ ├── __init__.py │ ├── aggregate_filters.py │ ├── elementary_step_filters.py │ ├── further_exploration_filters.py │ ├── reaction_filters.py │ ├── reactive_site_filters.py │ └── structure_filters.py ├── gears │ ├── __init__.py │ ├── compound.py │ ├── conformers │ │ ├── __init__.py │ │ └── brute_force.py │ ├── elementary_steps │ │ ├── __init__.py │ │ ├── brute_force.py │ │ ├── minimal.py │ │ ├── minimum_energy_conformer.py │ │ ├── selected_structures.py │ │ └── trial_generator │ │ │ ├── __init__.py │ │ │ ├── bond_based.py │ │ │ ├── connectivity_analyzer.py │ │ │ ├── fast_dissociations.py │ │ │ ├── fragment_based.py │ │ │ └── template_based.py │ ├── kinetic_modeling │ │ ├── __init__.py │ │ ├── atomization.py │ │ ├── kinetic_modeling.py │ │ ├── kinetx_kinetic_modeling.py │ │ ├── prepare_kinetic_modeling_job.py │ │ ├── rms_kinetic_modeling.py │ │ └── rms_network_extractor.py │ ├── kinetics.py │ ├── network_refinement │ │ ├── __init__.py │ │ ├── aggregate_based_refinement.py │ │ ├── calculation_based_refinement.py │ │ ├── disabling.py │ │ ├── enabling.py │ │ ├── reaction_based_refinement.py │ │ └── refinement.py │ ├── pathfinder.py │ ├── reaction.py │ ├── rerun_calculations.py │ ├── scheduler.py │ ├── single_point.py │ └── thermo.py ├── reaction_rules │ ├── __init__.py │ ├── distance_rules.py │ ├── element_rules.py │ ├── polarization_rules.py │ └── reaction_rule_library.py ├── resources │ ├── __init__.py │ ├── formaldehyde.xyz │ └── methanol.xyz ├── steering_wheel │ ├── __init__.py │ ├── datastructures.py │ ├── network_expansions │ │ ├── __init__.py │ │ ├── basics.py │ │ ├── conformers.py │ │ └── reactions.py │ ├── result_transfer.py │ └── selections │ │ ├── __init__.py │ │ ├── basics.py │ │ ├── conformers.py │ │ ├── input_selections.py │ │ └── organometallic_complexes.py ├── tests │ ├── __init__.py │ ├── conftest.py │ ├── gears │ │ ├── __init__.py │ │ ├── conformers │ │ │ ├── __init__.py │ │ │ └── test_brute_force.py │ │ ├── elementary_steps │ │ │ ├── __init__.py │ │ │ ├── mock_trial_generator.py │ │ │ ├── test_aggregate_filters.py │ │ │ ├── test_brute_force.py │ │ │ ├── test_further_dissociations_reactive_site_filters.py │ │ │ ├── test_minimal.py │ │ │ ├── test_minimum_energy_conformer.py │ │ │ ├── test_model_forwarding.py │ │ │ ├── test_reactive_site_filters.py │ │ │ └── trial_generator │ │ │ │ ├── __init__.py │ │ │ │ ├── test_bond_based.py │ │ │ │ ├── test_connectivity_analyzer.py │ │ │ │ ├── test_fast_dissociations.py │ │ │ │ ├── test_fragment_based.py │ │ │ │ └── test_template_based.py │ │ ├── filters │ │ │ ├── __init__.py │ │ │ └── test_structure_filters.py │ │ ├── kinetic_modeling │ │ │ ├── __init__.py │ │ │ ├── test_atomization.py │ │ │ └── test_kinetic_modeling.py │ │ ├── refinement │ │ │ ├── __init__.py │ │ │ ├── test_aggregate_based_refinement.py │ │ │ ├── test_disabling.py │ │ │ ├── test_elementary_step_filters.py │ │ │ ├── test_enabling.py │ │ │ ├── test_reaction_filters.py │ │ │ └── test_refinement.py │ │ ├── test_common_gear_utilities.py │ │ ├── test_compound.py │ │ ├── test_compound_validation.py │ │ ├── test_kinetics.py │ │ ├── test_pathfinder.py │ │ ├── test_reaction.py │ │ ├── test_rerun_calculations.py │ │ ├── test_scheduler.py │ │ ├── test_single_point.py │ │ └── test_thermo.py │ ├── resources │ │ ├── __init__.py │ │ ├── allylvinylether.xyz │ │ ├── amide_acetal.json │ │ ├── amide_acetal.xyz │ │ ├── arginine.mol │ │ ├── arginine.xyz │ │ ├── arginine_frequencies.dat │ │ ├── chloride.xyz │ │ ├── cyclohexene.json │ │ ├── cyclohexene.xyz │ │ ├── ethene.mol │ │ ├── furfuryl_alcohol.json │ │ ├── furfuryl_alcohol.xyz │ │ ├── ga_complex.json │ │ ├── ga_complex.mol │ │ ├── ga_complex.xyz │ │ ├── grubbs.json │ │ ├── grubbs.xyz │ │ ├── h4o2.xyz │ │ ├── h4o2_frequencies.dat │ │ ├── hydrogen.xyz │ │ ├── hydrogenperoxide.json │ │ ├── hydrogenperoxide.xyz │ │ ├── hydroxide.xyz │ │ ├── iodine_atom.xyz │ │ ├── methane.xyz │ │ ├── ni_catalyst.json │ │ ├── ni_catalyst.xyz │ │ ├── proline_acid.xyz │ │ ├── proline_acid_propanal_product.json │ │ ├── proline_acid_propanal_product.xyz │ │ ├── proline_propanal_adduct.json │ │ ├── proline_propanal_adduct.xyz │ │ ├── proline_propanal_complex.json │ │ ├── proline_propanal_complex.xyz │ │ ├── propanal.xyz │ │ ├── propionic_acid_conf_guesses │ │ │ ├── propionic-0.xyz │ │ │ ├── propionic-1.xyz │ │ │ ├── propionic-10.xyz │ │ │ ├── propionic-11.xyz │ │ │ ├── propionic-2.xyz │ │ │ ├── propionic-3.xyz │ │ │ ├── propionic-4.xyz │ │ │ ├── propionic-5.xyz │ │ │ ├── propionic-6.xyz │ │ │ ├── propionic-7.xyz │ │ │ ├── propionic-8.xyz │ │ │ └── propionic-9.xyz │ │ ├── propionic_acid_conf_optimized │ │ │ ├── propionic-0.xyz │ │ │ ├── propionic-1.xyz │ │ │ ├── propionic-10.xyz │ │ │ ├── propionic-11.xyz │ │ │ ├── propionic-2.xyz │ │ │ ├── propionic-3.xyz │ │ │ ├── propionic-4.xyz │ │ │ ├── propionic-5.xyz │ │ │ ├── propionic-6.xyz │ │ │ ├── propionic-7.xyz │ │ │ ├── propionic-8.xyz │ │ │ └── propionic-9.xyz │ │ ├── substrate.json │ │ ├── substrate.xyz │ │ ├── substructures │ │ │ ├── ph.json │ │ │ └── ph.xyz │ │ ├── test.rtdb.pickle.obj │ │ ├── water.json │ │ ├── water.xyz │ │ ├── water_rc.xyz │ │ ├── zwitter_ion.json │ │ └── zwitter_ion.xyz │ ├── steering_wheel │ │ ├── __init__.py │ │ ├── test_basic_enhancements.py │ │ ├── test_conformer_selections.py │ │ ├── test_input_selections.py │ │ ├── test_organometallic_complexes_selection.py │ │ └── test_steering_wheel.py │ ├── test_cli_reactive_complex_assembly.py │ ├── test_default_settings.py │ └── utilities │ │ ├── __init__.py │ │ ├── db_object_wrappers │ │ ├── __init__.py │ │ ├── test_reaction_wrapper.py │ │ ├── test_thermodynamic_properties.py │ │ └── test_wrapper_factory_singleton.py │ │ ├── reactive_complexes │ │ ├── __init__.py │ │ ├── test_inter_reactive_complexes.py │ │ ├── test_lebedev_sphere.py │ │ ├── test_masm_pruning.py │ │ └── test_unit_circle.py │ │ ├── test_get_molecular_formulas.py │ │ ├── test_insert_initial_structure.py │ │ ├── test_masm.py │ │ ├── test_pickle.py │ │ ├── test_place_holder_model.py │ │ └── test_uncertainties.py └── utilities │ ├── __init__.py │ ├── calculation_creation_helpers.py │ ├── comparisons.py │ ├── datastructure_transfer.py │ ├── db_object_wrappers │ ├── __init__.py │ ├── aggregate_cache.py │ ├── aggregate_wrapper.py │ ├── ensemble_wrapper.py │ ├── reaction_cache.py │ ├── reaction_wrapper.py │ ├── thermodynamic_properties.py │ └── wrapper_caches.py │ ├── get_molecular_formula.py │ ├── insert_initial_structure.py │ ├── masm.py │ ├── model_combinations.py │ ├── options.py │ ├── place_holder_model.py │ ├── reactive_complexes │ ├── __init__.py │ ├── inter_reactive_complexes.py │ ├── lebedev_sphere.py │ └── unit_circle.py │ ├── uncertainties.py │ └── warnings.py ├── setup.cfg └── setup.py /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | source = 3 | scine_chemoton 4 | [report] 5 | omit = 6 | */python?.?/* 7 | */site-packages/nose/* 8 | # ignore _version.py 9 | .*version.* 10 | *_version.py 11 | */tests/* 12 | 13 | exclude_lines = 14 | if __name__ == '__main__': 15 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | scine_chemoton/_version.py export-subst 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/__pycache__ 2 | openhaptics/build/ 3 | openhaptics/scine_ui_haptic.* 4 | .hypothesis 5 | launch.sh 6 | 7 | # Byte-compiled / optimized / DLL files 8 | __pycache__/ 9 | *.py[cod] 10 | *$py.class 11 | 12 | # Distribution / packaging 13 | build/ 14 | venv/ 15 | *.egg-info/ 16 | *.egg 17 | *whl 18 | 19 | # Unit test / coverage reports 20 | .coverage 21 | .coverage.* 22 | .cache 23 | coverage.xml 24 | pytest_report.xml 25 | htmlcov 26 | 27 | # Sphinx documentation 28 | docs/build/ 29 | docs/source/generated/ 30 | docs/source/api/generated/ 31 | 32 | # pytest 33 | .pytest_cache/ 34 | 35 | # Editor files 36 | #mac 37 | .DS_Store 38 | *~ 39 | 40 | #vim 41 | *.swp 42 | *.swo 43 | 44 | #pycharm 45 | .idea/ 46 | 47 | #VSCode 48 | .vscode/ 49 | 50 | #conda 51 | spec-file.txt 52 | 53 | mongo* 54 | Wired* 55 | *.wt 56 | *.tar.gz 57 | *.bson 58 | 59 | #cache files 60 | .chemoton*.pickle 61 | .chemoton*.pkl 62 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "dev"] 2 | path = dev 3 | url = https://github.com/qcscine/development-utils.git 4 | -------------------------------------------------------------------------------- /CONTRIBUTING.rst: -------------------------------------------------------------------------------- 1 | Contributing to SCINE Chemoton 2 | ============================== 3 | 4 | Contribution Process 5 | -------------------- 6 | 7 | The development for this code is done in a private repository maintained by the 8 | Reiher Research Group. GitHub is only used for the official releases. 9 | 10 | If you would like to contribute a larger change, please write to scine@phys.chem.ethz.ch. 11 | For smaller changes, you can create a pull request on GitHub. If we agree with 12 | the changes, a member of the Reiher Research Group will include them in our 13 | development code. Of course, we will give proper acknowledgment for any external 14 | contribution (see below for a list of all contributors). As soon as these changes 15 | are available in an official release, we will close the corresponding pull requests 16 | and/or issues on GitHub. 17 | 18 | Please note that contributing a small change does in no way mean that you will 19 | be added to the author list of a future paper and/or Zenodo entry! 20 | 21 | Main Contributors 22 | ----------------- 23 | 24 | Almost all contributions to SCINE in general and this repository in specific come 25 | from members of the Reiher research group. 26 | 27 | Further Contributors 28 | -------------------- 29 | 30 | - Lucas Lang, University of Oslo 31 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group 2 | 3 | Redistribution and use in source and binary forms, with or without modification, 4 | are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this 7 | list of conditions and the following disclaimer. 8 | 9 | 2. Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation and/or 11 | other materials provided with the distribution. 12 | 13 | 3. Neither the name of the copyright holder nor the names of its contributors 14 | may be used to endorse or promote products derived from this software without 15 | specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 21 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 22 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 26 | OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include LICENSE 2 | include README.rst 3 | include CHANGELOG.rst 4 | include requirements.txt 5 | 6 | recursive-exclude * __pycache__ 7 | recursive-exclude * *.py[co] 8 | 9 | recursive-include docs *.rst conf.py Makefile make.bat 10 | 11 | include scine_chemoton/_version.py 12 | 13 | # Remove test files from install: 14 | prune tests 15 | 16 | # If including data files in the package, add them like: 17 | include scine_chemoton/resources/*xyz 18 | -------------------------------------------------------------------------------- /conanfile.txt: -------------------------------------------------------------------------------- 1 | [requires] 2 | scine_utilities/10.0.0@ 3 | scine_molassembler/3.0.0@ 4 | scine_database/1.4.0@ 5 | 6 | [options] 7 | scine_utilities:python=True 8 | scine_molassembler:python=True 9 | scine_database:python=True 10 | 11 | [generators] 12 | virtualenv_python 13 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = "-W" # This flag turns warnings into errors. 6 | SPHINXBUILD = sphinx-build 7 | SPHINXPROJ = PackagingScientificPython 8 | SOURCEDIR = source 9 | BUILDDIR = build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=source 11 | set BUILDDIR=build 12 | set SPHINXPROJ=PackagingScientificPython 13 | 14 | if "%1" == "" goto help 15 | 16 | %SPHINXBUILD% >NUL 2>NUL 17 | if errorlevel 9009 ( 18 | echo. 19 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 20 | echo.installed, then set the SPHINXBUILD environment variable to point 21 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 22 | echo.may add the Sphinx directory to PATH. 23 | echo. 24 | echo.If you don't have Sphinx installed, grab it from 25 | echo.http://sphinx-doc.org/ 26 | exit /b 1 27 | ) 28 | 29 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 30 | goto end 31 | 32 | :help 33 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 34 | 35 | :end 36 | popd 37 | -------------------------------------------------------------------------------- /docs/source/_static/.placeholder: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qcscine/chemoton/19719b640fb77bd24cabd998043f77064d611c6e/docs/source/_static/.placeholder -------------------------------------------------------------------------------- /docs/source/api/api.rst: -------------------------------------------------------------------------------- 1 | ============ 2 | Chemoton API 3 | ============ 4 | 5 | .. toctree:: 6 | :maxdepth: 4 7 | 8 | engine 9 | gears 10 | filters 11 | reaction_rules 12 | steering_wheel 13 | utilities 14 | -------------------------------------------------------------------------------- /docs/source/api/engine.rst: -------------------------------------------------------------------------------- 1 | Engine 2 | ====== 3 | .. automodule:: scine_chemoton.engine 4 | -------------------------------------------------------------------------------- /docs/source/api/filters.rst: -------------------------------------------------------------------------------- 1 | Filters 2 | ======= 3 | 4 | Chemoton per default considers every aggregate, reactive site, elementary step etc. 5 | as valid/active for reaction trials. However, they can be limited with so-called filters. 6 | All Filters have a default implementation that does not filter anything. 7 | 8 | .. autosummary:: 9 | :toctree: generated 10 | :recursive: 11 | 12 | scine_chemoton.filters 13 | -------------------------------------------------------------------------------- /docs/source/api/gears.rst: -------------------------------------------------------------------------------- 1 | Gears 2 | ===== 3 | 4 | Interface 5 | --------- 6 | .. autoclass:: scine_chemoton.gears.Gear 7 | :special-members: __call__ 8 | :noindex: 9 | 10 | Implementations 11 | --------------- 12 | 13 | .. autosummary:: 14 | :toctree: generated 15 | :recursive: 16 | 17 | scine_chemoton.gears 18 | 19 | -------------------------------------------------------------------------------- /docs/source/api/reaction_rules.rst: -------------------------------------------------------------------------------- 1 | Optional Reaction Rules 2 | ======================= 3 | 4 | Some reactive site filters allow specifying a set of reaction rules. 5 | The different types of reaction rules are defined here. 6 | 7 | .. autosummary:: 8 | :toctree: generated 9 | :recursive: 10 | 11 | scine_chemoton.reaction_rules 12 | 13 | -------------------------------------------------------------------------------- /docs/source/api/steering_wheel.rst: -------------------------------------------------------------------------------- 1 | Steering Wheel 2 | ============== 3 | 4 | Data Structures 5 | --------------- 6 | .. automodule:: scine_chemoton.steering_wheel.datastructures 7 | 8 | Interfaces 9 | ---------- 10 | .. autoclass:: scine_chemoton.steering_wheel.SteeringWheel 11 | .. autoclass:: scine_chemoton.steering_wheel.selections.Selection 12 | .. autoclass:: scine_chemoton.steering_wheel.selections.SelectionAndArray 13 | .. autoclass:: scine_chemoton.steering_wheel.selections.SelectionOrArray 14 | .. autoclass:: scine_chemoton.steering_wheel.network_expansions.NetworkExpansion 15 | 16 | Implementations 17 | --------------- 18 | 19 | Selections 20 | ~~~~~~~~~~ 21 | .. automodule:: scine_chemoton.steering_wheel.selections.input_selections 22 | .. automodule:: scine_chemoton.steering_wheel.selections.basics 23 | .. automodule:: scine_chemoton.steering_wheel.selections.conformers 24 | .. automodule:: scine_chemoton.steering_wheel.selections.organometallic_complexes 25 | 26 | Network Expansions 27 | ~~~~~~~~~~~~~~~~~~ 28 | .. automodule:: scine_chemoton.steering_wheel.network_expansions.basics 29 | .. automodule:: scine_chemoton.steering_wheel.network_expansions.conformers 30 | .. automodule:: scine_chemoton.steering_wheel.network_expansions.reactions 31 | -------------------------------------------------------------------------------- /docs/source/api/utilities.rst: -------------------------------------------------------------------------------- 1 | 2 | Utilities 3 | ========= 4 | 5 | Methods for structure manipulations 6 | """"""""""""""""""""""""""""""""""" 7 | .. automodule:: scine_chemoton.utilities.reactive_complexes 8 | .. automodule:: scine_chemoton.utilities.reactive_complexes.inter_reactive_complexes 9 | .. automodule:: scine_chemoton.utilities.reactive_complexes.lebedev_sphere 10 | .. automodule:: scine_chemoton.utilities.reactive_complexes.unit_circle 11 | .. automodule:: scine_chemoton.utilities.insert_initial_structure 12 | .. automodule:: scine_chemoton.utilities.masm 13 | 14 | Database Object Wrappers 15 | """""""""""""""""""""""" 16 | .. automodule:: scine_chemoton.utilities.db_object_wrappers.aggregate_cache 17 | .. automodule:: scine_chemoton.utilities.db_object_wrappers.aggregate_wrapper 18 | .. automodule:: scine_chemoton.utilities.db_object_wrappers.ensemble_wrapper 19 | .. automodule:: scine_chemoton.utilities.db_object_wrappers.reaction_cache 20 | .. automodule:: scine_chemoton.utilities.db_object_wrappers.reaction_wrapper 21 | .. automodule:: scine_chemoton.utilities.db_object_wrappers.thermodynamic_properties 22 | .. automodule:: scine_chemoton.utilities.db_object_wrappers.wrapper_caches 23 | -------------------------------------------------------------------------------- /docs/source/changelog.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../../CHANGELOG.rst 2 | -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | .. scine_chemoton master file 2 | 3 | Chemoton 4 | ======== 5 | 6 | .. image:: res/chemoton_header.png 7 | :width: 100 % 8 | :alt: Chemoton 9 | 10 | .. toctree:: 11 | :maxdepth: 3 12 | 13 | readme 14 | api/api 15 | changelog 16 | -------------------------------------------------------------------------------- /docs/source/readme.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../../README.rst 2 | :start-after: inclusion-marker-do-not-remove 3 | -------------------------------------------------------------------------------- /docs/source/res/chemoton_header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qcscine/chemoton/19719b640fb77bd24cabd998043f77064d611c6e/docs/source/res/chemoton_header.png -------------------------------------------------------------------------------- /docs/source/res/chemoton_logo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qcscine/chemoton/19719b640fb77bd24cabd998043f77064d611c6e/docs/source/res/chemoton_logo1.png -------------------------------------------------------------------------------- /docs/source/res/chemoton_logo1_inverted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qcscine/chemoton/19719b640fb77bd24cabd998043f77064d611c6e/docs/source/res/chemoton_logo1_inverted.png -------------------------------------------------------------------------------- /pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | filterwarnings = 3 | error 4 | ignore::ResourceWarning 5 | markers = 6 | slow: marks tests as slow (deselect with '-m "not slow"') 7 | serial 8 | -------------------------------------------------------------------------------- /requirements-dev.txt: -------------------------------------------------------------------------------- 1 | -r requirements.txt 2 | matplotlib 3 | pytest 4 | coverage 5 | recommonmark 6 | sphinx 7 | sphinx_rtd_theme 8 | sphinx_autodoc_typehints 9 | sphinx_copybutton 10 | numpydoc 11 | pylint 12 | pylint-exit 13 | mypy 14 | autopep8 15 | flake8 16 | autoflake 17 | types-setuptools 18 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # List required packages in this file, one per line. 2 | numpy 3 | networkx 4 | psutil 5 | typing_extensions>=4.4,<5.0 6 | scine_art>=2.0,<2.1 7 | scine_database>=1.4,<1.5 8 | scine_utilities>=10.0,<10.1 9 | scine_molassembler>=3.0,<3.1 10 | scipy 11 | setproctitle 12 | wrapt 13 | -------------------------------------------------------------------------------- /scine_chemoton/_version.py: -------------------------------------------------------------------------------- 1 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 2 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 3 | See LICENSE.txt for details. 4 | """ 5 | 6 | __version__ = '4.0.0' 7 | -------------------------------------------------------------------------------- /scine_chemoton/filters/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | -------------------------------------------------------------------------------- /scine_chemoton/gears/conformers/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | -------------------------------------------------------------------------------- /scine_chemoton/gears/elementary_steps/brute_force.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | # Standard library imports 9 | from typing import List, Union 10 | 11 | # Third party imports 12 | import scine_database as db 13 | from scine_database.queries import optimized_labels_enums 14 | 15 | # Local application imports 16 | from . import ElementaryStepGear 17 | 18 | 19 | class BruteForceElementarySteps(ElementaryStepGear): 20 | """ 21 | This Gear probes Reactions by trying to react all Structures of each 22 | Aggregate with all Structures of each other Aggregate. 23 | For each Structure-Structure combination multiple arrangements (possible 24 | Elementary Steps) will be tested. 25 | 26 | Attributes 27 | ---------- 28 | options : BruteForceElementarySteps.Options 29 | The options for the BruteForceElementarySteps Gear. 30 | aggregate_filter : scine_chemoton.gears.elementary_steps.aggregate_filters.AggregateFilter 31 | A filter for allowed reaction combinations, per default everything 32 | is permitted, no filter is applied. 33 | trial_generator : TrialGenerator 34 | The generator to set up elementary step trial calculations by enumerating 35 | reactive complexes and trial reaction coordinates 36 | 37 | Notes 38 | ----- 39 | This function assumes maximum spin when adding two Structures into one 40 | reactive complex. 41 | The need for elementary step guesses is tested by: 42 | 43 | a. for bimolecular reactions: checking whether there is already a 44 | calculation to search for a bimolecular reaction of the same 45 | structures with the same job order 46 | b. for unimolecular reactions: checking whether there is already a 47 | calculation to search for an intramolecular reaction of the same 48 | structure with the same job order 49 | """ 50 | 51 | def _get_eligible_structures(self, aggregate: Union[db.Compound, db.Flask]) -> List[db.ID]: 52 | eligible = [] 53 | for sid in aggregate.get_structures(): 54 | structure = db.Structure(sid, self._structures) 55 | if not self._check_structure_model(structure): 56 | continue 57 | # Only consider optimized structures, no guess structures or duplicates 58 | if not structure.explore() or structure.get_label() not in optimized_labels_enums(): 59 | continue 60 | eligible.append(sid) 61 | return eligible 62 | -------------------------------------------------------------------------------- /scine_chemoton/gears/elementary_steps/minimal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | # Standard library imports 9 | from typing import List, Union 10 | 11 | # Third party imports 12 | import scine_database as db 13 | from scine_database.queries import optimized_labels_enums 14 | 15 | # Local application imports 16 | from . import ElementaryStepGear 17 | 18 | 19 | class MinimalElementarySteps(ElementaryStepGear): 20 | """ 21 | This Gear probes Reactions by trying to react 22 | 23 | 1. one Structure of each aggregate with one Structure of each other aggregate 24 | (intermolecular reactions) 25 | 2. one Structure with itself intramoleculary for each aggregate. 26 | 27 | For each combination multiple arrangements (possible Elementary Steps) will 28 | be tested. 29 | 30 | Attributes 31 | ---------- 32 | options : MinimalElementarySteps.Options 33 | The options for the MinimalElementarySteps Gear. 34 | aggregate_filter : scine_chemoton.gears.elementary_steps.aggregate_filters.AggregateFilter 35 | A filter for allowed reaction combinations, per default everything 36 | is permitted, no filter is applied. 37 | trial_generator : TrialGenerator 38 | The generator to set up elementary step trial calculations by enumerating 39 | reactive complexes and trial reaction coordinates 40 | 41 | Notes 42 | ----- 43 | This function assumes maximum spin when adding two Structures into one 44 | reactive complex. 45 | The need for elementary step guesses is tested by: 46 | 47 | a. for bimolecular reactions: checking whether there is already a 48 | calculation to search for a bimolecular reaction of the same 49 | structures with the same job order 50 | b. for unimolecular reactions: checking whether there is already a 51 | calculation to search for an intramolecular reaction of the same 52 | structure with the same job order 53 | """ 54 | 55 | def _get_eligible_structures(self, aggregate: Union[db.Compound, db.Flask]) -> List[db.ID]: 56 | for sid in aggregate.get_structures(): 57 | structure = db.Structure(sid, self._structures) 58 | # Model check if structure model is set to None 59 | if not self._check_structure_model(structure): 60 | continue 61 | # Only consider optimized structures, no guess structures or duplicates 62 | if not structure.explore() or structure.get_label() not in optimized_labels_enums(): 63 | continue 64 | return [structure.id()] 65 | return [] 66 | -------------------------------------------------------------------------------- /scine_chemoton/gears/elementary_steps/selected_structures.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | # Standard library imports 9 | from typing import List, Union 10 | 11 | # Third party imports 12 | import scine_database as db 13 | 14 | # Local application imports 15 | from . import ElementaryStepGear 16 | 17 | 18 | class SelectedStructuresElementarySteps(ElementaryStepGear): 19 | """ 20 | This Gear probes Reactions by trying to react all predefined Structures 21 | with each other. 22 | For each Structure-Structure combination multiple arrangements (possible 23 | Elementary Steps) will be tested. 24 | 25 | Attributes 26 | ---------- 27 | options : ElementaryStepGear.Options 28 | The options for the BruteForceElementarySteps Gear. 29 | aggregate_filter : scine_chemoton.gears.elementary_steps.aggregate_filters.AggregateFilter 30 | A filter for allowed reaction combinations, per default everything 31 | is permitted, no filter is applied. 32 | trial_generator : TrialGenerator 33 | The generator to set up elementary step trial calculations by enumerating 34 | reactive complexes and trial reaction coordinates 35 | 36 | Notes 37 | ----- 38 | This function assumes maximum spin when adding two Structures into one 39 | reactive complex. 40 | The need for elementary step guesses is tested by: 41 | 42 | a. for bimolecular reactions: checking whether there is already a 43 | calculation to search for a bimolecular reaction of the same 44 | structures with the same job order 45 | b. for unimolecular reactions: checking whether there is already a 46 | calculation to search for an intramolecular reaction of the same 47 | structure with the same job order 48 | """ 49 | class Options(ElementaryStepGear.Options): 50 | """ 51 | The options of the SelectedStructuresElementaryStepGear. 52 | """ 53 | __slots__ = "selected_structures" 54 | 55 | def __init__(self, *args, **kwargs) -> None: 56 | super().__init__(*args, **kwargs) 57 | self.selected_structures: List[db.ID] = [] 58 | """ 59 | List[db.ID] 60 | The IDs of structure that are considered reactive 61 | """ 62 | 63 | options: Options 64 | 65 | def _get_eligible_structures(self, aggregate: Union[db.Compound, db.Flask]) -> List[db.ID]: 66 | return [sid for sid in aggregate.get_structures() if sid in self.options.selected_structures 67 | and self._check_structure_model(db.Structure(sid, self._structures))] 68 | -------------------------------------------------------------------------------- /scine_chemoton/gears/kinetic_modeling/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | -------------------------------------------------------------------------------- /scine_chemoton/gears/kinetic_modeling/kinetx_kinetic_modeling.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | from typing import List, Dict 9 | 10 | # Third party imports 11 | import scine_database as db 12 | import scine_utilities as utils 13 | 14 | from .prepare_kinetic_modeling_job import KineticModelingJobFactory 15 | from ...utilities.model_combinations import ModelCombination 16 | 17 | 18 | class KinetxKineticModelingJobFactory(KineticModelingJobFactory): 19 | """ 20 | A class that creates KiNetX kinetic modeling jobs. 21 | """ 22 | 23 | def __init__(self, model_combinations: List[ModelCombination], model_combinations_reactions: List[ModelCombination], 24 | manager: db.Manager, 25 | only_electronic: bool = False) -> None: 26 | super().__init__(model_combinations=model_combinations, 27 | model_combinations_reactions=model_combinations_reactions, 28 | manager=manager, only_electronic=only_electronic) 29 | 30 | def create_kinetic_modeling_job(self, settings: utils.ValueCollection) -> bool: 31 | reactions, aggregates = self._setup_general_settings(settings) 32 | if aggregates is None or reactions is None: 33 | return False 34 | # Take the maximum rate found for an elementary step. 35 | all_rates = [r.get_ts_theory_rate_constants(self.reference_state) for r in reactions] 36 | lhs = [k[0] for k in all_rates] 37 | rhs = [k[1] for k in all_rates] 38 | assert None not in lhs 39 | assert None not in rhs 40 | settings["lhs_rates"] = lhs # type: ignore 41 | settings["rhs_rates"] = rhs # type: ignore 42 | 43 | all_structure_ids = [a.get_db_object().get_centroid() for a in aggregates.values()] 44 | if self._calc_already_set_up(all_structure_ids, settings): 45 | return False 46 | 47 | return self._finalize_calculation(settings, [a.get_db_object().get_centroid() for a in aggregates.values()]) 48 | 49 | @staticmethod 50 | def get_job(): 51 | return db.Job('kinetx_kinetic_modeling') 52 | 53 | @staticmethod 54 | def get_default_settings(): 55 | return utils.ValueCollection({ 56 | "time_step": 1e-8, 57 | "solver": "cash_karp_5", 58 | "batch_interval": int(1e+3), 59 | "n_batches": int(1e+5), 60 | "convergence": 1e-10, 61 | "concentration_label_postfix": "" 62 | }) 63 | 64 | def _identical_model_definition(self, _: utils.ValueCollection, __: Dict): 65 | return True 66 | 67 | @staticmethod 68 | def order_dependent_setting_keys() -> List[str]: 69 | return [] 70 | -------------------------------------------------------------------------------- /scine_chemoton/gears/kinetic_modeling/rms_network_extractor.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | import scine_database as db 9 | import scine_utilities as utils 10 | 11 | from scine_chemoton.gears.kinetic_modeling.rms_kinetic_modeling import RMSKineticModelingJobFactory 12 | from scine_chemoton.gears.kinetic_modeling.kinetic_modeling import KineticModeling 13 | from scine_chemoton.gears.kinetic_modeling.atomization import MultiModelEnergyReferences 14 | 15 | 16 | class ReactionNetworkData: 17 | """ 18 | This class extracts the input values for a RMS kinetic modeling run from the database. 19 | 20 | Parameters 21 | ---------- 22 | manager : db.Manager 23 | The database manager. 24 | options : KineticModeling.Options 25 | The kinetic modeling options. Note that the model combinations and the reference state must be set 26 | explicitly and may not be None. 27 | use_zero_flux_truncation : bool 28 | If true, reaction previously modeled in a kinetic modeling run which have negligible concentration flux 29 | will be neglected. By default, True. 30 | """ 31 | 32 | def __init__(self, manager: db.Manager, options: KineticModeling.Options, 33 | use_zero_flux_truncation: bool = True): 34 | assert options.model_combinations_reactions 35 | assert options.reference_state 36 | rms_job_factory = RMSKineticModelingJobFactory(options.model_combinations, 37 | options.model_combinations_reactions, 38 | manager, MultiModelEnergyReferences([])) 39 | rms_job_factory.reference_state = options.reference_state 40 | rms_job_factory.max_barrier = options.max_barrier 41 | rms_job_factory.min_flux_truncation = options.min_flux_truncation 42 | rms_job_factory.use_zero_flux_truncation = use_zero_flux_truncation 43 | 44 | reactions, aggregates = rms_job_factory.get_reactions() 45 | self.reference_state = rms_job_factory.reference_state 46 | hartree_to_j_per_mol = utils.KJPERMOL_PER_HARTREE * 1e+3 47 | a_values = aggregates.values() 48 | enthalpies = [a.get_enthalpy(self.reference_state) for a in a_values] 49 | entropies = [a.get_entropy(self.reference_state) for a in a_values] 50 | ea = [r.get_free_energy_of_activation(self.reference_state)[0] for r in reactions] 51 | rxn_e = [r.get_reaction_free_energy(self.reference_state) for r in reactions] 52 | assert None not in rxn_e 53 | assert None not in ea 54 | assert None not in entropies 55 | assert None not in enthalpies 56 | self.aggregate_ids = [a.get_db_id().string() for a in a_values] 57 | self.reaction_ids = [r.get_db_id().string() for r in reactions] 58 | self.enthalpies = [e * hartree_to_j_per_mol for e in enthalpies] # type: ignore 59 | self.entropies = [e * hartree_to_j_per_mol for e in entropies] # type: ignore 60 | self.ea = [e * hartree_to_j_per_mol for e in ea] # type: ignore 61 | self.rxn_e = [e * hartree_to_j_per_mol for e in rxn_e] # type: ignore 62 | self.prefactors = [r.get_arrhenius_prefactor(self.reference_state) for r in reactions] 63 | self.exponents = [0 for _ in reactions] 64 | self.aggregates = aggregates 65 | self.reactions = reactions 66 | assert None not in entropies 67 | assert None not in ea 68 | rms_job_factory.assert_non_negative_barriers(self.enthalpies, self.entropies, self.ea, self.reaction_ids, 69 | self.aggregate_ids, self.reference_state.temperature) 70 | -------------------------------------------------------------------------------- /scine_chemoton/gears/network_refinement/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | -------------------------------------------------------------------------------- /scine_chemoton/gears/network_refinement/calculation_based_refinement.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | from typing import List, Dict, Set 9 | from json import dumps 10 | import os 11 | import pickle 12 | 13 | # Third party imports 14 | import scine_database as db 15 | 16 | from .refinement import NetworkRefinement 17 | from scine_database.queries import ( 18 | model_query, 19 | stop_on_timeout, 20 | ) 21 | 22 | 23 | class CalculationBasedRefinement(NetworkRefinement): 24 | """ 25 | This gear allows the refinement of results from previous calculations that produced elementary steps. For instance, 26 | one could recalculate the single point energies for all structures in the elementary step or rerun the transition 27 | state optimization with a different electronic structure model. 28 | """ 29 | 30 | class Options(NetworkRefinement.Options): 31 | """ 32 | See NetworkRefinement for options. 33 | """ 34 | 35 | options: Options 36 | 37 | def __init__(self) -> None: 38 | super().__init__() 39 | self._calculation_id_cache: Dict[str, Set[str]] = { 40 | "refine_single_points": set(), 41 | "refine_optimizations": set(), 42 | "double_ended_refinement": set(), 43 | "double_ended_new_connections": set(), 44 | "refine_single_ended_search": set(), 45 | "refine_structures_and_irc": set(), 46 | } 47 | 48 | def _loop(self, job_label: str): 49 | """ 50 | Create refinement calculations under the condition that there is a calculation that produced an elementary 51 | step that fulfills the elementary step filters. 52 | 53 | Parameters 54 | ---------- 55 | job_label: str 56 | The label for the refinement to be executed. 57 | """ 58 | self._load_calculation_id_cache() 59 | cache = self._calculation_id_cache[job_label] 60 | selection = { 61 | "$and": [ 62 | {"status": "complete"}, 63 | {"results.elementary_steps.0": {"$exists": True}}, 64 | ] 65 | + model_query(self.options.calculation_model) # type: ignore 66 | } 67 | cache_update: List[str] = list() 68 | for calculation in stop_on_timeout(self._calculations.iterate_calculations(dumps(selection))): 69 | if self.have_to_stop_at_next_break_point(): 70 | cache.update(set(cache_update)) 71 | self._save_calculation_id_cache() 72 | return 73 | str_id = calculation.id().string() 74 | if str_id in cache: 75 | continue 76 | calculation.link(self._calculations) 77 | elementary_steps = [db.ElementaryStep(step_id, self._elementary_steps) for step_id in 78 | calculation.get_results().get_elementary_steps()] 79 | any_qualified = any(self.elementary_step_filter.filter(step) for step in elementary_steps) 80 | if not any_qualified: 81 | continue 82 | calculation_fully_done = self._set_up_calculation(job_label, calculation) 83 | if calculation_fully_done: 84 | cache_update.append(str_id) 85 | cache.update(set(cache_update)) 86 | self._save_calculation_id_cache() 87 | 88 | def _save_calculation_id_cache(self) -> None: 89 | # save dictionary to pickle file 90 | with open(self.options.caching_file_name, 'wb') as f: 91 | pickle.dump(self._calculation_id_cache, f, protocol=pickle.HIGHEST_PROTOCOL) 92 | 93 | def _load_calculation_id_cache(self) -> None: 94 | if os.path.exists(self.options.caching_file_name) and os.path.getsize(self.options.caching_file_name) > 0: 95 | with open(self.options.caching_file_name, "rb") as f: 96 | load_cache = pickle.load(f) 97 | if load_cache: 98 | self._calculation_id_cache.update(load_cache) 99 | -------------------------------------------------------------------------------- /scine_chemoton/gears/single_point.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | import scine_database as db 9 | import scine_utilities as utils 10 | from scine_database.queries import stop_on_timeout, calculation_exists_in_structure 11 | 12 | from typing import List, Union 13 | from json import dumps 14 | 15 | # Local application imports 16 | from . import Gear 17 | from scine_chemoton.filters.structure_filters import StructureFilter 18 | from scine_chemoton.utilities.calculation_creation_helpers import finalize_calculation 19 | 20 | 21 | class SinglePoint(Gear): 22 | class Options(Gear.Options): 23 | """ 24 | The options for the SinglePoint Gear. 25 | 26 | This gear writes calculation entries to the database for every structure fitting the given label list and 27 | filter settings. 28 | Application example: Run single point calculations for gradients and forces for structures during 29 | training of a machine learning model. 30 | 31 | Notes 32 | ----- 33 | This gear per default does not consider the model of the structures and setups calculations with its model. 34 | If you want to consider only certain structures, you can give it a StructureFilter. 35 | """ 36 | __slots__ = ("allowed_labels", "job", "job_settings") 37 | 38 | def __init__(self) -> None: 39 | super().__init__() 40 | self.allowed_labels: List[Union[str, db.Label]] = [] 41 | """ 42 | allowed_labels : List[Union[str, db.Label]] 43 | Only structures with a label in the given list are considered by this gear. If none are provided, 44 | structures are considered independently of their label. 45 | """ 46 | self.job: db.Job = db.Job("scine_single_point") 47 | """ 48 | job : db.Job 49 | The calculation job. 50 | """ 51 | self.job_settings: utils.ValueCollection = utils.ValueCollection() 52 | """ 53 | job_settings : utils.ValueCollection 54 | The calculation settings. 55 | """ 56 | 57 | options: Options 58 | 59 | def __init__(self) -> None: 60 | super().__init__() 61 | self._required_collections = ["structures", "calculations"] 62 | self.structure_filter: StructureFilter = StructureFilter() 63 | 64 | def _propagate_db_manager(self, manager: db.Manager): 65 | self.structure_filter.initialize_collections(manager) 66 | 67 | def _sanity_check_configuration(self): 68 | if not isinstance(self.structure_filter, StructureFilter): 69 | raise TypeError(f"Expected a StructureFilter (or a class derived " 70 | f"from it) in {self.name}.options.structure_filter.") 71 | 72 | def __get_query_selection(self): 73 | """ 74 | Returns a dictionary that is used to query the database for structures to be considered by this gear. 75 | """ 76 | selection = {} 77 | if self.options.allowed_labels: 78 | label_strs = [label.name.lower() if isinstance(label, db.Label) else label.lower() 79 | for label in self.options.allowed_labels] 80 | selection["label"] = {"$in": label_strs} 81 | return selection 82 | 83 | def __calculation_already_set_up(self, structure: db.Structure) -> bool: 84 | """ 85 | Checks whether a calculation for the given structure already exists. 86 | Relies on an entry of the setup calculations in the structure document. 87 | """ 88 | return calculation_exists_in_structure(self.options.job.order, [structure.id()], self.options.model, 89 | self._structures, self._calculations, 90 | self.options.job_settings.as_dict()) 91 | 92 | def __set_up_calculation(self, structure: db.Structure): 93 | structure_id = structure.id() 94 | calc = db.Calculation() 95 | calc.link(self._calculations) 96 | calc.create(self.options.model, self.options.job, [structure_id]) 97 | calc.set_settings(self.options.job_settings) 98 | finalize_calculation(calc, self._structures, [structure_id]) 99 | 100 | def _loop_impl(self): 101 | selection = self.__get_query_selection() 102 | for structure in stop_on_timeout(self._structures.iterate_structures(dumps(selection))): 103 | if self.have_to_stop_at_next_break_point(): 104 | return 105 | structure.link(self._structures) 106 | if not self.structure_filter.filter(structure): 107 | continue 108 | if self.__calculation_already_set_up(structure): 109 | continue 110 | self.__set_up_calculation(structure) 111 | -------------------------------------------------------------------------------- /scine_chemoton/reaction_rules/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | from abc import ABC 8 | from collections import UserDict 9 | 10 | import scine_utilities as utils 11 | 12 | from scine_chemoton.gears import HasName 13 | 14 | 15 | class RuleSet(UserDict): 16 | """ 17 | Mainly exists for typing purposes, and default representation. 18 | """ 19 | 20 | def __repr__(self) -> str: 21 | return f"{self.__class__.__name__}({repr(self.data)})" 22 | 23 | 24 | class BaseRule(HasName, ABC): 25 | """ 26 | Mainly exists for typing purposes, and default representation. 27 | """ 28 | 29 | def __init__(self, *args, **kwargs) -> None: 30 | super().__init__(*args, **kwargs) 31 | self._remove_chemoton_from_name() 32 | 33 | def __repr__(self) -> str: 34 | return f"{self.__class__.__name__}()" 35 | 36 | 37 | def valid_element(element: str) -> bool: 38 | try: 39 | _ = utils.ElementInfo.element_from_symbol(element) 40 | except RuntimeError: 41 | return False 42 | return True 43 | -------------------------------------------------------------------------------- /scine_chemoton/reaction_rules/element_rules.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | # Standard library imports 9 | from abc import abstractmethod 10 | from typing import List, Union, Dict 11 | 12 | # Local application imports 13 | from . import valid_element, RuleSet, BaseRule 14 | 15 | 16 | class ElementBaseRule(BaseRule): 17 | """ 18 | A rule that defines reactivity simply based on element combinations 19 | """ 20 | 21 | def __init__(self, base_element: str, other_elements: Union[List[str], str]) -> None: 22 | """ 23 | Parameters 24 | ---------- 25 | base_element : str 26 | The element that is the base of the rule 27 | other_elements : Union[List[str], str] 28 | The other elements that are allowed to be combined with the base element 29 | """ 30 | super().__init__() 31 | if not valid_element(base_element): 32 | raise ValueError(f"{base_element} is not a valid element") 33 | self.base_element = base_element 34 | if isinstance(other_elements, str): 35 | self._other_elements = [other_elements] 36 | else: 37 | self._other_elements = other_elements 38 | for element in self._other_elements: 39 | if not valid_element(element): 40 | raise ValueError(f"{element} is not a valid element") 41 | 42 | def __repr__(self) -> str: 43 | return f"{self.__class__.__name__}('{self.base_element}', {repr(self._other_elements)})" 44 | 45 | @abstractmethod 46 | def rule_applies(self, element_1: str, element_2: str) -> bool: 47 | """ 48 | If the rule applies for the two given elements 49 | """ 50 | pass # pylint: disable=unnecessary-pass 51 | 52 | 53 | class SimpleElementCombinationRule(ElementBaseRule): 54 | """ 55 | A rule that defines possible combinations of elements. 56 | """ 57 | 58 | def rule_applies(self, element_1: str, element_2: str) -> bool: 59 | if element_1 == self.base_element and element_2 in self._other_elements: 60 | return True 61 | return element_2 == self.base_element and element_1 in self._other_elements 62 | 63 | 64 | class ElementRuleSet(RuleSet): 65 | """ 66 | A dictionary holding elements as keys and either multiple or a single element as values. 67 | All keys and values are checked for valid element types. 68 | """ 69 | 70 | def __init__(self, kwargs: Dict[str, Union[ElementBaseRule, str, List[str]]], 71 | rule_type: type = SimpleElementCombinationRule) -> None: 72 | super().__init__(kwargs) 73 | self._rule_type = rule_type 74 | for k, v in kwargs.items(): 75 | if not isinstance(k, str): 76 | raise TypeError(f"{self.__class__.__name__} expects strings as keys") 77 | if not valid_element(k): 78 | raise TypeError(f"{k} is not a valid element symbol") 79 | if not isinstance(v, ElementBaseRule): 80 | rule = rule_type(k, v) 81 | self.data[k] = rule 82 | assert all(isinstance(v, ElementBaseRule) for v in self.data.values()) 83 | if any(k != v.base_element for k, v in self.data.items()): 84 | raise ValueError("All keys must be the same as the base element of their rule") 85 | 86 | def __repr__(self) -> str: 87 | return f"{self.__class__.__name__}({repr(self.data)}, {self._rule_type.__name__})" 88 | -------------------------------------------------------------------------------- /scine_chemoton/resources/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | -------------------------------------------------------------------------------- /scine_chemoton/resources/formaldehyde.xyz: -------------------------------------------------------------------------------- 1 | 4 2 | 3 | C 1.8830700000 -0.5786580000 0.2269370000 4 | O 1.2782180000 -0.4805640000 1.2738990000 5 | H 2.9899260000 -0.5927900000 0.1987290000 6 | H 1.3520320000 -0.6575860000 -0.7384190000 7 | -------------------------------------------------------------------------------- /scine_chemoton/resources/methanol.xyz: -------------------------------------------------------------------------------- 1 | 6 2 | 3 | C -1.8245440000 0.6617140000 -0.2944760000 4 | O -1.1389390000 -0.5756560000 -0.2393670000 5 | H -1.1452140000 1.5282520000 -0.3112110000 6 | H -2.4062180000 0.6731780000 -1.2208060000 7 | H -0.5828340000 -0.5731880000 0.5567800000 8 | H -2.5244670000 0.7962980000 0.5441790000 9 | -------------------------------------------------------------------------------- /scine_chemoton/steering_wheel/network_expansions/conformers.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | from __future__ import annotations 3 | # -*- coding: utf-8 -*- 4 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 5 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 6 | See LICENSE.txt for details. 7 | """ 8 | 9 | from typing import List, Optional 10 | 11 | import scine_database as db 12 | from scine_database.queries import optimized_labels_enums 13 | 14 | from . import NetworkExpansion, thermochemistry_job_wrapper 15 | from ..datastructures import ProtocolEntry, NetworkExpansionResult 16 | from scine_chemoton.default_settings import default_opt_settings 17 | from scine_chemoton.gears.conformers.brute_force import BruteForceConformers 18 | 19 | 20 | class ConformerCreation(NetworkExpansion): 21 | """ 22 | Network expansion that adds conformers to the given selection result. 23 | """ 24 | 25 | _conformer_gear: Optional[BruteForceConformers] = None # so we can address the gear for results parsing 26 | options: ConformerCreation.Options 27 | 28 | @thermochemistry_job_wrapper 29 | def _relevant_puffin_jobs(self) -> List[str]: 30 | return ['conformers', 'scine_geometry_optimization'] + self._aggregation_necessary_jobs() 31 | 32 | def _set_protocol(self, credentials: db.Credentials) -> None: 33 | self.protocol.append(ProtocolEntry(credentials, self._prepare_scheduler())) 34 | self._conformer_gear = BruteForceConformers() 35 | self._conformer_gear.options.minimization_settings = default_opt_settings() 36 | self.protocol.append(ProtocolEntry(credentials, self._conformer_gear, wait_for_calculation_finish=True)) 37 | # run conformer gear double to avoid race conditions 38 | self._extra_manual_cycles_to_avoid_race_condition( 39 | credentials, aggregate_reactions=False, additional_entries=[ 40 | ProtocolEntry(credentials, self._conformer_gear, fork=False, n_runs=2, wait_for_calculation_finish=True) 41 | ]) 42 | self._extra_manual_cycles_to_avoid_race_condition(credentials, aggregate_reactions=False) 43 | 44 | def _execute(self, n_already_executed_protocol_steps: int) -> NetworkExpansionResult: 45 | result = NetworkExpansionResult() 46 | if self._conformer_gear is None: 47 | raise RuntimeError(f"Error in {self.name}, conformer gear was not saved in class") 48 | valid_compounds = self._conformer_gear.valid_compounds() 49 | self._basic_execute(n_already_executed_protocol_steps) 50 | result.compounds = valid_compounds 51 | 52 | desired_labels = optimized_labels_enums() 53 | for compound_id in valid_compounds: 54 | compound = db.Compound(compound_id, self._compounds) 55 | for sid in compound.get_structures(): 56 | structure = db.Structure(sid, self._structures) 57 | if structure.get_label() not in desired_labels: 58 | continue 59 | if not structure.has_graph("masm_cbor_graph"): 60 | raise RuntimeError(f"{self.name} failed, a optimized structure '{str(sid)}' is missing a graph.") 61 | result.structures.append(sid) 62 | 63 | return result 64 | -------------------------------------------------------------------------------- /scine_chemoton/steering_wheel/result_transfer.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | from multiprocessing.connection import Connection 9 | from time import sleep 10 | from typing import List, Union 11 | 12 | from scine_chemoton.utilities.datastructure_transfer import read_connection, make_picklable, ReadAble 13 | from scine_chemoton.steering_wheel.datastructures import ( 14 | SelectionResult, 15 | NetworkExpansionResult, 16 | ExplorationResult, 17 | ) 18 | 19 | 20 | class StopMultipleSplitCommunicationMethod: 21 | pass 22 | 23 | 24 | class WaitForFurtherResults: 25 | pass 26 | 27 | 28 | def _receive_split_result_from_pipe(pipe: Union[Connection, ReadAble, None]) \ 29 | -> Union[ExplorationResult, StopMultipleSplitCommunicationMethod, None]: 30 | # we first need to know the class which we want to receive, this is the first sent signal 31 | cls = read_connection(pipe, return_first_signal=True) 32 | if isinstance(cls, WaitForFurtherResults): 33 | # pipe tells us to continuously read until we get a result 34 | cls = None 35 | while cls is None: 36 | sleep(0.1) 37 | cls = read_connection(pipe, return_first_signal=True) 38 | if isinstance(cls, WaitForFurtherResults): 39 | cls = None 40 | if isinstance(cls, StopMultipleSplitCommunicationMethod): 41 | # it was just an empty list of results 42 | return None 43 | if cls is None or isinstance(cls, StopMultipleSplitCommunicationMethod): 44 | return cls 45 | if cls not in [SelectionResult, NetworkExpansionResult]: 46 | raise ValueError(f"Failed to receive the class information for receiving a split result; " 47 | f"received {cls} instead.") 48 | return cls.receive_from_pipe(pipe) 49 | 50 | 51 | def receive_multiple_results_from_pipe(pipe: Union[Connection, ReadAble, None]) -> List[ExplorationResult]: 52 | if pipe is None: 53 | return [] 54 | 55 | def _impl() -> List[ExplorationResult]: 56 | results = [] 57 | first_iteration = True 58 | while True: 59 | result = _receive_split_result_from_pipe(pipe) 60 | # we only accept None as a break condition for the first iteration for the case that nothing is in the pipe 61 | # otherwise this is likely a race condition problem and we only stop reading the results 62 | # based on the appropriate signal because we know that something has been sent already 63 | # this avoids to cut result lists apart 64 | if (result is None and first_iteration) or isinstance(result, StopMultipleSplitCommunicationMethod): 65 | break 66 | if result is None: 67 | # not first iteration, but pipe still missing other parts, just wait 68 | continue 69 | first_iteration = False 70 | results.append(result) 71 | return results 72 | 73 | # in connection, there might be a series of result lists, because the worker always sends a complete list 74 | # after each step. 75 | # therefore, we return the last result list 76 | results_to_return = _impl() 77 | while True: 78 | next_results = _impl() 79 | if len(next_results) == 0: 80 | # if there are no more results, we get an empty results list 81 | return results_to_return 82 | results_to_return = next_results 83 | 84 | 85 | def send_multiple_results_in_pipe(results: List[ExplorationResult], pipe: Connection) -> None: 86 | results_to_send = make_picklable(results) 87 | if results_to_send is not None: 88 | for result in results_to_send: 89 | if result is None: 90 | pipe.send(None) 91 | continue 92 | assert isinstance(result, ExplorationResult) 93 | result.send_in_pipe(pipe) 94 | pipe.send(StopMultipleSplitCommunicationMethod()) 95 | -------------------------------------------------------------------------------- /scine_chemoton/steering_wheel/selections/organometallic_complexes.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | from __future__ import annotations 3 | # -*- coding: utf-8 -*- 4 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 5 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 6 | See LICENSE.txt for details. 7 | """ 8 | from typing import List, Optional, Union, Dict 9 | 10 | import scine_database as db 11 | 12 | from . import SafeFirstSelection 13 | from ..datastructures import SelectionResult, LogicCoupling 14 | from scine_chemoton.filters.aggregate_filters import AggregateFilter, CatalystFilter 15 | from scine_chemoton.filters.reactive_site_filters import ReactiveSiteFilter, CentralSiteFilter 16 | from scine_chemoton.filters.further_exploration_filters import \ 17 | FurtherExplorationFilterAndArray 18 | 19 | 20 | class CentralMetalSelection(SafeFirstSelection): 21 | 22 | class Options(SafeFirstSelection.Options): 23 | metal: str 24 | ligand_without_metal_reactive: bool 25 | additional_catalyst_elements: Optional[Dict[str, int]] 26 | 27 | def __init__(self, model: db.Model, metal: str, ligand_without_metal_reactive: bool, 28 | additional_catalyst_elements: Optional[Dict[str, int]], *args, **kwargs): 29 | super().__init__(model, *args, **kwargs) 30 | self.metal = metal 31 | self.ligand_without_metal_reactive = ligand_without_metal_reactive 32 | self.additional_catalyst_elements = additional_catalyst_elements 33 | 34 | options: CentralMetalSelection.Options # required for mypy checks, so it knows which options object to check 35 | 36 | def __init__(self, model: db.Model, # pylint: disable=keyword-arg-before-vararg 37 | central_metal_species: str, 38 | ligand_without_metal_reactive: bool, 39 | additional_catalyst_elements: Optional[Dict[str, int]] = None, 40 | additional_aggregate_filters: Optional[List[AggregateFilter]] = None, 41 | additional_reactive_site_filters: Optional[List[ReactiveSiteFilter]] = None, 42 | logic_coupling: Union[str, LogicCoupling] = LogicCoupling.AND, 43 | *args, **kwargs 44 | ): 45 | super().__init__(model, additional_aggregate_filters, additional_reactive_site_filters, logic_coupling, 46 | central_metal_species, ligand_without_metal_reactive, additional_catalyst_elements, 47 | *args, **kwargs) 48 | self.options = self.Options(model, central_metal_species, ligand_without_metal_reactive, 49 | additional_catalyst_elements, *args, **kwargs) 50 | 51 | def _select(self) -> SelectionResult: 52 | central_site = CentralSiteFilter( 53 | self.options.metal, 54 | ligand_without_central_atom_reactive=self.options.ligand_without_metal_reactive 55 | ) 56 | add_elements = {} if self.options.additional_catalyst_elements is None \ 57 | else self.options.additional_catalyst_elements 58 | return SelectionResult( 59 | aggregate_filter=CatalystFilter({self.options.metal: 1, **add_elements}, 60 | restrict_unimolecular_to_catalyst=True), 61 | reactive_site_filter=central_site, 62 | further_exploration_filter=FurtherExplorationFilterAndArray([central_site]) 63 | ) 64 | -------------------------------------------------------------------------------- /scine_chemoton/tests/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | -------------------------------------------------------------------------------- /scine_chemoton/tests/conftest.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | 9 | import pytest 10 | 11 | 12 | @pytest.fixture(scope='session', autouse=True) 13 | def precondition(): 14 | from scine_database.test_database_setup import get_clean_db 15 | try: 16 | _ = get_clean_db() 17 | except RuntimeError as e: 18 | pytest.exit(f'{str(e)}\nFirst start database before running unittests.') 19 | -------------------------------------------------------------------------------- /scine_chemoton/tests/gears/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | -------------------------------------------------------------------------------- /scine_chemoton/tests/gears/conformers/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | -------------------------------------------------------------------------------- /scine_chemoton/tests/gears/elementary_steps/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | -------------------------------------------------------------------------------- /scine_chemoton/tests/gears/elementary_steps/test_model_forwarding.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | import pytest 9 | 10 | from scine_chemoton.gears.elementary_steps.minimal import MinimalElementarySteps 11 | from scine_chemoton.gears.elementary_steps.trial_generator.bond_based import BondBased 12 | import scine_database as db 13 | 14 | 15 | def test_model_forwarding_only_set_tg(): 16 | model = db.Model("desired", "model", "") 17 | elementary_step_gear = MinimalElementarySteps() 18 | elementary_step_gear.trial_generator = BondBased() 19 | with pytest.warns(UserWarning): 20 | elementary_step_gear.trial_generator.options.model = model 21 | assert elementary_step_gear.options.model == model 22 | assert elementary_step_gear.trial_generator.options.model == model 23 | assert elementary_step_gear.options.model == elementary_step_gear.trial_generator.options.model 24 | 25 | 26 | def test_model_forwarding_only_tg(): 27 | model = db.Model("desired", "model", "") 28 | elementary_step_gear = MinimalElementarySteps() 29 | tg = BondBased() 30 | tg.options.model = model 31 | with pytest.warns(UserWarning): 32 | elementary_step_gear.trial_generator = tg 33 | assert elementary_step_gear.options.model == model 34 | assert elementary_step_gear.trial_generator.options.model == model 35 | assert elementary_step_gear.options.model == elementary_step_gear.trial_generator.options.model 36 | 37 | 38 | def test_model_forwarding_only_set_tg_separate_construction(): 39 | model = db.Model("desired", "model", "") 40 | elementary_step_gear = MinimalElementarySteps() 41 | tg = BondBased() 42 | elementary_step_gear.trial_generator = tg 43 | with pytest.warns(UserWarning): 44 | elementary_step_gear.trial_generator.options.model = model 45 | assert elementary_step_gear.options.model == model 46 | assert elementary_step_gear.trial_generator.options.model == model 47 | assert elementary_step_gear.options.model == elementary_step_gear.trial_generator.options.model 48 | 49 | 50 | def test_model_forwarding_gear_before_updating_tg(): 51 | model = db.Model("desired", "model", "") 52 | elementary_step_gear = MinimalElementarySteps() 53 | elementary_step_gear.options.model = model 54 | tg = BondBased() 55 | elementary_step_gear.trial_generator = tg 56 | assert elementary_step_gear.options.model == model 57 | assert elementary_step_gear.trial_generator.options.model == model 58 | assert elementary_step_gear.options.model == elementary_step_gear.trial_generator.options.model 59 | 60 | 61 | def test_model_forwarding_gear_same_model_on_both(): 62 | model = db.Model("desired", "model", "") 63 | elementary_step_gear = MinimalElementarySteps() 64 | tg = BondBased() 65 | elementary_step_gear.trial_generator = tg 66 | with pytest.warns(UserWarning): 67 | elementary_step_gear.trial_generator.options.model = model 68 | elementary_step_gear.options.model = model 69 | 70 | 71 | def test_model_forwarding_gear_different_model_on_both(): 72 | model = db.Model("desired", "model", "") 73 | elementary_step_gear = MinimalElementarySteps() 74 | tg = BondBased() 75 | elementary_step_gear.trial_generator = tg 76 | with pytest.warns(UserWarning): 77 | elementary_step_gear.trial_generator.options.model = model 78 | assert elementary_step_gear.options.model == model 79 | assert elementary_step_gear.trial_generator.options.model == model 80 | assert elementary_step_gear.options.model == elementary_step_gear.trial_generator.options.model 81 | 82 | else_model = db.Model("something", "else", "") 83 | with pytest.warns(UserWarning): 84 | elementary_step_gear.options.model = else_model 85 | assert elementary_step_gear.options.model == else_model 86 | assert elementary_step_gear.trial_generator.options.model == else_model 87 | assert elementary_step_gear.options.model == elementary_step_gear.trial_generator.options.model 88 | -------------------------------------------------------------------------------- /scine_chemoton/tests/gears/elementary_steps/trial_generator/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | -------------------------------------------------------------------------------- /scine_chemoton/tests/gears/filters/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | -------------------------------------------------------------------------------- /scine_chemoton/tests/gears/kinetic_modeling/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | -------------------------------------------------------------------------------- /scine_chemoton/tests/gears/kinetic_modeling/test_atomization.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | # Standard library imports 9 | import unittest 10 | from json import dumps 11 | 12 | # Third party imports 13 | import scine_database as db 14 | 15 | from ....gears import HoldsCollections 16 | from scine_database import test_database_setup as db_setup 17 | from ....gears.kinetic_modeling.atomization import ZeroEnergyReference, AtomEnergyReference, MultiModelEnergyReferences 18 | 19 | 20 | class TestEnergyReferences(unittest.TestCase, HoldsCollections): 21 | def custom_setup(self, manager: db.Manager) -> None: 22 | self._required_collections = ["manager", "elementary_steps", "structures", "reactions", "compounds", "flasks", 23 | "properties", "calculations"] 24 | self.initialize_collections(manager) 25 | # pylint: disable=attribute-defined-outside-init 26 | self._model_a = db_setup.get_fake_model() 27 | self._model_b = db.Model("Second", "Fake", "Model") 28 | self._model_b.solvation = "MySolventModel" 29 | self._model_b.solvent = "fantasy" 30 | _, self._structure_id = db_setup.insert_single_empty_structure_aggregate(manager, db.Label.MINIMUM_OPTIMIZED) 31 | self._atom_energies = { 32 | 'O': -60.0, # just made up numbers. 33 | 'H': -0.5 34 | } 35 | # pylint: enable=attribute-defined-outside-init 36 | 37 | def tearDown(self) -> None: 38 | self._manager.wipe() 39 | 40 | def test_zero_energy_reference(self): 41 | manager = db_setup.get_clean_db("chemoton_zero_energy_reference") 42 | self.custom_setup(manager) 43 | ref = ZeroEnergyReference(self._model_a) 44 | assert ref.get_reference_energy(self._structure_id) == 0.0 45 | manager.wipe() 46 | 47 | def test_atom_energy_reference(self): 48 | manager = db_setup.get_clean_db("chemoton_atom_energy_reference") 49 | self.custom_setup(manager) 50 | ref = AtomEnergyReference(self._model_a, self._manager, atom_energies=self._atom_energies) 51 | sum_of_atoms = self._atom_energies['O'] + 2 * self._atom_energies['H'] 52 | assert abs(ref.get_reference_energy(self._structure_id) - sum_of_atoms) < 1e-12 53 | manager.wipe() 54 | 55 | def test_atom_energy_calculation_set_up(self): 56 | manager = db_setup.get_clean_db("chemoton_atom_energy_calculation_reference") 57 | self.custom_setup(manager) 58 | ref = AtomEnergyReference(self._model_a, self._manager) 59 | ref.single_atom_multiplicities = { 60 | "H": 2, 61 | "B": 2, 62 | "C": 3, 63 | "N": 4, 64 | "O": 3, 65 | "F": 2 66 | } 67 | ref.set_up_atom_energy_calculations([self._structure_id]) 68 | ref.set_up_atom_energy_calculations([self._structure_id]) # multiple calls should not do anything extra 69 | assert self._calculations.count(dumps({})) == 2 70 | assert self._structures.count(dumps({})) == 3 71 | for calculation in self._calculations.iterate_all_calculations(): 72 | calculation.link(self._calculations) 73 | assert calculation.get_model() == self._model_a 74 | 75 | for structure in self._structures.iterate_all_structures(): 76 | if structure.id() == self._structure_id: 77 | continue 78 | structure.link(self._structures) 79 | atoms = structure.get_atoms() 80 | assert len(atoms) == 1 81 | compound = db.Compound(db.ID(), self._compounds) 82 | compound.create([structure.id()]) 83 | structure.set_aggregate(compound.id()) 84 | 85 | assert self._compounds.count(dumps({})) == 3 86 | 87 | ref_with_other_model = AtomEnergyReference(self._model_b, self._manager) 88 | ref_with_other_model.set_up_atom_energy_calculations([self._structure_id]) 89 | assert self._calculations.count(dumps({})) == 4 90 | assert self._structures.count(dumps({})) == 3 91 | manager.wipe() 92 | 93 | def test_multi_model_energy_references(self): 94 | manager = db_setup.get_clean_db("chemoton_multi_model_energy_reference") 95 | self.custom_setup(manager) 96 | ref_atom = AtomEnergyReference(self._model_a, self._manager, atom_energies=self._atom_energies) 97 | ref_zero = ZeroEnergyReference(self._model_b) 98 | multi_model_reference = MultiModelEnergyReferences([ref_atom, ref_zero]) 99 | assert multi_model_reference.get_energy_reference(self._model_a) == ref_atom 100 | assert multi_model_reference.get_energy_reference(self._model_b) == ref_zero 101 | manager.wipe() 102 | -------------------------------------------------------------------------------- /scine_chemoton/tests/gears/refinement/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | -------------------------------------------------------------------------------- /scine_chemoton/tests/gears/test_common_gear_utilities.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | from scine_database import Model 9 | 10 | from scine_chemoton.gears import Gear 11 | # required to be in the namespace 12 | from scine_chemoton.gears.compound import ( # pylint: disable=unused-import # noqa: F401 13 | BasicAggregateHousekeeping, # pylint: disable=unused-import # noqa: F401 14 | ThermoAggregateHousekeeping # pylint: disable=unused-import # noqa: F401 15 | ) 16 | from scine_chemoton.gears.kinetics import ( # pylint: disable=unused-import # noqa: F401 17 | MinimalConnectivityKinetics, # pylint: disable=unused-import # noqa: F401 18 | BasicBarrierHeightKinetics, # pylint: disable=unused-import # noqa: F401 19 | MaximumFluxKinetics, # pylint: disable=unused-import # noqa: F401 20 | PathfinderKinetics # pylint: disable=unused-import # noqa: F401 21 | ) 22 | from scine_chemoton.gears.reaction import BasicReactionHousekeeping # pylint: disable=unused-import # noqa: F401 23 | from scine_chemoton.gears.network_refinement.reaction_based_refinement import \ 24 | ReactionBasedRefinement # pylint: disable=unused-import # noqa: F401 25 | from scine_chemoton.gears.network_refinement.calculation_based_refinement import \ 26 | CalculationBasedRefinement # pylint: disable=unused-import # noqa: F401 27 | from scine_chemoton.gears.network_refinement.refinement import \ 28 | NetworkRefinement # pylint: disable=unused-import # noqa: F401 29 | from scine_chemoton.gears.rerun_calculations import RerunCalculations # pylint: disable=unused-import # noqa: F401 30 | from scine_chemoton.gears.scheduler import Scheduler # pylint: disable=unused-import # noqa: F401 31 | from scine_chemoton.gears.thermo import BasicThermoDataCompletion # pylint: disable=unused-import # noqa: F401 32 | from scine_chemoton.gears.elementary_steps.minimal import \ 33 | MinimalElementarySteps # pylint: disable=unused-import # noqa: F401 34 | from scine_chemoton.gears.elementary_steps.brute_force import \ 35 | BruteForceElementarySteps # pylint: disable=unused-import # noqa: F401 36 | from scine_chemoton.gears.elementary_steps.minimum_energy_conformer import \ 37 | MinimumEnergyConformerElementarySteps # pylint: disable=unused-import # noqa: F401 38 | from scine_chemoton.gears.elementary_steps.selected_structures import \ 39 | SelectedStructuresElementarySteps # pylint: disable=unused-import # noqa: F401 40 | 41 | 42 | def test_comparisons(): 43 | for name, cls in globals().items(): 44 | if name.startswith('__'): 45 | continue 46 | try: 47 | if issubclass(cls, Gear): 48 | a = cls() 49 | b = cls() 50 | assert a == b 51 | a.options.model = Model("foo", "bar", "") 52 | assert a != b 53 | except TypeError: 54 | pass 55 | 56 | 57 | def test_slots(): 58 | for name, cls in globals().items(): 59 | if name.startswith('__'): 60 | continue 61 | try: 62 | if issubclass(cls, Gear): 63 | assert hasattr(cls, "Options") 64 | assert hasattr(cls.Options, '__slots__') 65 | try: 66 | if isinstance(cls.Options.__slots__, str): 67 | attr = {cls.__slots__: getattr(cls, cls.__slots__, None)} 68 | else: 69 | attr = {k: getattr(cls, k, None) for k in cls.__slots__} 70 | for v in attr.values(): 71 | if issubclass(v, Gear.Options): 72 | assert hasattr(v, '__slots__') 73 | assert v.__slots__ 74 | except AttributeError: 75 | pass 76 | except TypeError: 77 | pass 78 | -------------------------------------------------------------------------------- /scine_chemoton/tests/gears/test_scheduler.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | # Third party imports 9 | import scine_database as db 10 | from scine_database import test_database_setup as db_setup 11 | 12 | # Local application imports 13 | from ...engine import Engine 14 | from ...gears.scheduler import Scheduler 15 | 16 | 17 | def test_counts_and_priorities(): 18 | # Connect to test DB 19 | manager = db_setup.get_clean_db("chemoton_test_scheduling") 20 | 21 | # Initialize some test settings 22 | job_creation = { 23 | "clean_laundry": 2, 24 | "mow_the_lawn": 11, 25 | "build_flux_compensator": 7, 26 | "schroedingers_job": 1, 27 | } 28 | job_counts = { 29 | "clean_laundry": 0, 30 | "mow_the_lawn": 9, 31 | "build_flux_compensator": 5, 32 | } 33 | job_priorities = { 34 | "clean_laundry": 9, 35 | "mow_the_lawn": 5, 36 | "build_flux_compensator": 1, 37 | } 38 | 39 | # Add fake calculations 40 | model = db.Model("FAKE", "FAKE", "F-AKE") 41 | calculations = manager.get_collection("calculations") 42 | for k, v in job_creation.items(): 43 | job = db.Job(k) 44 | for _ in range(v + 2): 45 | new_calc = db.Calculation() 46 | new_calc.link(calculations) 47 | new_calc.create(model, job, []) 48 | new_calc.set_status(db.Status.HOLD) 49 | new_calc.set_priority(10) 50 | 51 | # Setup gear 52 | schedule_gear = Scheduler() 53 | schedule_gear.options.job_counts = job_counts 54 | schedule_gear.options.job_priorities = job_priorities 55 | schedule_engine = Engine(manager.get_credentials(), fork=False) 56 | schedule_engine.set_gear(schedule_gear) 57 | 58 | # Run a single loop 59 | schedule_engine.run(single=True) 60 | 61 | # Checks 62 | actual_counts = { 63 | "clean_laundry": 0, 64 | "mow_the_lawn": 0, 65 | "build_flux_compensator": 0, 66 | "schroedingers_job": 0, 67 | } 68 | for calc in calculations.iterate_all_calculations(): 69 | calc.link(calculations) 70 | order = calc.get_job().order 71 | assert order in actual_counts 72 | if db.Status.NEW == calc.get_status(): 73 | actual_counts[order] += 1 74 | assert calc.get_priority() == job_priorities[order] 75 | 76 | for k, v in job_counts.items(): 77 | assert v == actual_counts[k] 78 | assert 0 == actual_counts["schroedingers_job"] 79 | 80 | # Cleaning 81 | manager.wipe() 82 | -------------------------------------------------------------------------------- /scine_chemoton/tests/gears/test_single_point.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | # Standard library imports 9 | import unittest 10 | from json import dumps 11 | 12 | # Third party imports 13 | import scine_database as db 14 | import scine_utilities as utils 15 | from scine_database import test_database_setup as db_setup 16 | 17 | # Local application tests imports 18 | from ...gears import HoldsCollections 19 | from scine_chemoton.gears.single_point import SinglePoint 20 | from scine_chemoton.engine import Engine 21 | from scine_chemoton.filters.structure_filters import StructureLabelFilter, StructureFilter, ModelFilter 22 | 23 | 24 | class SinglePointTests(unittest.TestCase, HoldsCollections): 25 | 26 | def custom_setup(self, manager: db.Manager) -> None: 27 | self._required_collections = ["manager", "calculations", "structures"] 28 | self.initialize_collections(manager) 29 | 30 | def tearDown(self) -> None: 31 | self._manager.wipe() 32 | 33 | def test_single_point_gear(self): 34 | manager = db_setup.get_clean_db("chemoton_test_single_point_gear") 35 | self.custom_setup(manager) 36 | _, s1_id = db_setup.insert_single_empty_structure_aggregate(manager, db.Label.USER_GUESS) 37 | _, __ = db_setup.insert_single_empty_structure_aggregate(manager, db.Label.MINIMUM_GUESS) 38 | _, __ = db_setup.insert_single_empty_structure_aggregate(manager, db.Label.MINIMUM_OPTIMIZED) 39 | 40 | gear = SinglePoint() 41 | gear.options.model = db_setup.get_fake_model() 42 | gear.structure_filter = StructureLabelFilter([db.Label.COMPLEX_OPTIMIZED]) 43 | engine = Engine(manager.get_credentials(), fork=False) 44 | engine.set_gear(gear) 45 | for _ in range(2): 46 | engine.run(single=True) 47 | 48 | assert self._calculations.count(dumps({})) == 0 49 | 50 | gear.structure_filter = StructureFilter() 51 | gear.options.allowed_labels = [db.Label.USER_GUESS] 52 | engine.run(single=True) 53 | 54 | assert self._calculations.count(dumps({})) == 1 55 | engine.run(single=True) 56 | assert self._calculations.count(dumps({})) == 1 57 | calculation = self._calculations.get_one_calculation(dumps({})) 58 | calculation.link(self._calculations) 59 | assert len(calculation.get_structures()) == 1 60 | assert calculation.get_structures()[0] == s1_id 61 | 62 | gear.options.allowed_labels = None 63 | engine.run(single=True) 64 | 65 | assert self._calculations.count(dumps({})) == 3 66 | 67 | gear.options.job_settings = utils.ValueCollection({"some_settings": "some_value"}) 68 | engine.run(single=True) 69 | 70 | assert self._calculations.count(dumps({})) == 6 71 | assert self._calculations.count(dumps({"settings.some_settings": "some_value"})) == 3 72 | 73 | other_model = db.Model("DFT", "any", "any") 74 | _, s4_id = db_setup.insert_single_empty_structure_aggregate(manager, db.Label.MINIMUM_OPTIMIZED) 75 | s4 = db.Structure(s4_id, self._structures) 76 | gear.structure_filter = ModelFilter(other_model) 77 | engine.run(single=True) 78 | # unchanged 79 | assert self._calculations.count(dumps({})) == 6 80 | assert self._calculations.count(dumps({"settings.some_settings": "some_value"})) == 3 81 | # fitting model 82 | s4.set_model(other_model) 83 | engine.run(single=True) 84 | assert self._calculations.count(dumps({})) == 7 85 | assert self._calculations.count(dumps({"settings.some_settings": "some_value"})) == 4 86 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | 9 | import pathlib 10 | 11 | 12 | def resources_root_path(): 13 | """ 14 | A small getter to abstract the position of this directory. 15 | 16 | Returns 17 | ------- 18 | result : str 19 | The path to the root directory of the test resources. 20 | """ 21 | return pathlib.Path(__file__).parent.absolute() 22 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/allylvinylether.xyz: -------------------------------------------------------------------------------- 1 | 14 2 | Coordinates from ORCA-job optAndFreq 3 | H -1.12502468237586 0.05252140675040 2.45288027180785 4 | H 1.43323878457918 0.99181042177001 0.11370431791398 5 | H 2.21961572790492 -0.59175660696487 0.35392656778384 6 | H 1.38189076456559 -0.26412151059623 -2.05975058596069 7 | H -0.61527108269783 -1.65998830443008 -2.43663355448929 8 | H -0.97301235498447 -1.66819483962543 -0.58703510729077 9 | C -1.09986298075423 1.44661309417496 0.82430246515022 10 | C -0.64888102460873 0.37998925746989 1.51365249762221 11 | O 0.40173102100348 -0.43858378827999 1.23273864504571 12 | C 1.24179135419386 -0.10776658494306 0.13445012026049 13 | C 0.74952683130968 -0.57801585796372 -1.20885354797902 14 | C -0.33308930377332 -1.34195110762917 -1.42176659341774 15 | H -1.95673632915967 2.00595867571980 1.22350591315125 16 | H -0.67591672520261 1.77348574474750 -0.13512140949804 17 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/amide_acetal.json: -------------------------------------------------------------------------------- 1 | { 2 | "masm_decision_list" : "(-48, -42, -37, 3):(-58, -52, -47, 1):(-42, -36, -31, 3):(170, 175, -179, 1):(-53, -46, -42, 3):(-63, -57, -52, 3):(72, 78, 83, 1):(-57, -51, -46, 3)", 3 | "masm_cbor_graph" : "pGFhiaVhYQBhYw9hb4GCAAFhcqNhbIKBE4EXYmxygoEAgQFhc4KBE4EXYXMBpWFhAGFjEGFvgYIAAWFyo2FsgoESgRdibHKCgQCBAWFzgoESgRdhcwGlYWEAYWMRYW+BgwABAmFyo2Fsg4EVgRaBF2JscoKCAAGBAmFzgoIVFoEXYXMDpWFhAGFjEmFvgYQAAQIDYXKjYWyEgQOBBIEFgRBibHKCgwABAoEDYXOCgwMEBYEQYXMFpWFhAGFjE2FvgYQAAQIDYXKjYWyEgQCBAYECgQ9ibHKCgwABAoEDYXOCgwABAoEPYXMFpWFhAGFjFGFvgYQAAQIDYXKjYWyEgQaBB4EIgRdibHKCgwABAoEDYXOCgwYHCIEXYXMFpWFhAGFjFWFvgYQAAQIDYXKjYWyEgQyBDYEOgRFibHKCgwABAoEDYXOCgwwNDoERYXMFpWFhAGFjFmFvgYQAAQIDYXKjYWyEgQmBCoELgRFibHKCgwABAoEDYXOCgwkKC4ERYXMFpWFhAGFjF2FvgYQAAQIDYXKjYWyEgQ+BEIERgRRibHKDgQOBAoIAAWFzg4EUgRGCDxBhcwVhYw9hZ6JhRZeDABMAgwETAIMCEwCDAxIAgwQSAIMFEgCDBhQAgwcUAIMIFACDCRYAgwoWAIMLFgCDDBUAgw0VAIMOFQCDDxMAgw8XAIMQEgCDEBcAgxEVAIMRFgCDERcAgxQXAGFamBgBAQEBAQEBAQEBAQEBAQEICAcGBgYGBgZhdoMCAAA=", 4 | "masm_idx_map" : "[(0, 20), (0, 23), (0, 6), (0, 7), (0, 16), (0, 8), (0, 17), (0, 21), (0, 18), (0, 22), (0, 9), (0, 12), (0, 13), (0, 14), (0, 10), (0, 11), (0, 15), (0, 19), (0, 3), (0, 4), (0, 5), (0, 0), (0, 1), (0, 2)]" 5 | } 6 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/amide_acetal.xyz: -------------------------------------------------------------------------------- 1 | 24 2 | 3 | C -2.1766656102 4.1240500598 1.0760267038 4 | C -3.2759361479 4.9754902895 0.4151428445 5 | H -2.5773145448 3.1571093025 1.3542770388 6 | H -1.8088456390 4.6193181322 1.9688044065 7 | O -4.1550962346 5.3351364358 1.4789232131 8 | H -1.3737181102 3.9853265935 0.3588950544 9 | N -3.8882218150 4.1869563740 -0.6390376998 10 | C -4.8326898962 3.1823887601 -0.1902106023 11 | C -5.2108688678 6.2212185445 1.1588234282 12 | C -4.3678556585 4.8671585548 -1.8256530234 13 | H -4.5069305061 4.1118283894 -2.5999681399 14 | H -4.5699291397 2.8317924789 0.8034597431 15 | H -4.7976161731 2.3432787532 -0.8871552473 16 | H -5.8649126706 3.5586840617 -0.1564889770 17 | H -3.6212620203 5.5814457499 -2.1570992828 18 | H -5.3235076571 5.3890169611 -1.6733432427 19 | O -2.7524747345 6.1256495971 -0.1967128330 20 | C -1.9302639544 6.9469637395 0.6131814405 21 | H -4.8858648634 6.9783307542 0.4406509643 22 | H -5.4989534650 6.7027283385 2.0933589908 23 | H -6.0737079809 5.6840066615 0.7512913845 24 | H -0.9226157180 6.5319179606 0.7056870850 25 | H -2.3626192182 7.0828439320 1.6080352073 26 | H -1.8808810744 7.9069730258 0.1012895235 27 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/arginine.mol: -------------------------------------------------------------------------------- 1 | arginine 2 | PyMOL2.5 3D 0 3 | 4 | 26 25 0 0 0 0 0 0 0 0999 V2000 5 | 0.4399 2.0813 1.4443 N 0 0 0 0 0 0 0 0 0 0 0 0 6 | 1.2688 0.9271 1.7315 C 0 0 0 0 0 0 0 0 0 0 0 0 7 | 2.5203 0.9252 0.8668 C 0 0 0 0 0 0 0 0 0 0 0 0 8 | 3.1009 -0.0592 0.4971 O 0 0 0 0 0 0 0 0 0 0 0 0 9 | 0.9931 2.9289 1.4245 H 0 0 0 0 0 0 0 0 0 0 0 0 10 | 2.9690 2.1582 0.6074 O 0 0 0 0 0 0 0 0 0 0 0 0 11 | -0.2849 2.1796 2.1454 H 0 0 0 0 0 0 0 0 0 0 0 0 12 | 1.6660 0.9259 2.7701 H 0 0 0 0 0 0 0 0 0 0 0 0 13 | 0.4722 -0.3685 1.5295 C 0 0 0 0 0 0 0 0 0 0 0 0 14 | -0.3355 -0.3980 2.2636 H 0 0 0 0 0 0 0 0 0 0 0 0 15 | 1.1369 -1.2143 1.7116 H 0 0 0 0 0 0 0 0 0 0 0 0 16 | -0.1106 -0.4584 0.1228 C 0 0 0 0 0 0 0 0 0 0 0 0 17 | 0.7047 -0.4921 -0.6017 H 0 0 0 0 0 0 0 0 0 0 0 0 18 | -0.7092 0.4302 -0.0790 H 0 0 0 0 0 0 0 0 0 0 0 0 19 | -0.9813 -1.7078 -0.0461 C 0 0 0 0 0 0 0 0 0 0 0 0 20 | -0.3868 -2.6046 0.1506 H 0 0 0 0 0 0 0 0 0 0 0 0 21 | -1.5340 -1.8408 -1.3768 N 0 0 0 0 0 0 0 0 0 0 0 0 22 | -1.7989 -1.6883 0.6804 H 0 0 0 0 0 0 0 0 0 0 0 0 23 | -2.4615 -0.9650 -1.9138 C 0 0 0 0 0 0 0 0 0 0 0 0 24 | -0.8657 -2.1665 -2.0618 H 0 0 0 0 0 0 0 0 0 0 0 0 25 | -2.6886 -0.8070 -3.1537 N 0 0 0 0 0 0 0 0 0 0 0 0 26 | -3.1981 -0.2206 -1.0157 N 0 0 0 0 0 0 0 0 0 0 0 0 27 | -2.0616 -1.3200 -3.7646 H 0 0 0 0 0 0 0 0 0 0 0 0 28 | -3.9762 0.2347 -1.4683 H 0 0 0 0 0 0 0 0 0 0 0 0 29 | -3.4384 -0.6773 -0.1505 H 0 0 0 0 0 0 0 0 0 0 0 0 30 | 3.7743 2.1135 0.0676 H 0 0 0 0 0 0 0 0 0 0 0 0 31 | 1 2 1 0 0 0 0 32 | 1 5 1 0 0 0 0 33 | 1 7 1 0 0 0 0 34 | 2 3 1 0 0 0 0 35 | 2 8 1 0 0 0 0 36 | 2 9 1 0 0 0 0 37 | 3 4 1 0 0 0 0 38 | 3 6 1 0 0 0 0 39 | 6 26 1 0 0 0 0 40 | 9 10 1 0 0 0 0 41 | 9 11 1 0 0 0 0 42 | 9 12 1 0 0 0 0 43 | 12 13 1 0 0 0 0 44 | 12 14 1 0 0 0 0 45 | 12 15 1 0 0 0 0 46 | 15 16 1 0 0 0 0 47 | 15 17 1 0 0 0 0 48 | 15 18 1 0 0 0 0 49 | 17 19 1 0 0 0 0 50 | 17 20 1 0 0 0 0 51 | 19 21 1 0 0 0 0 52 | 19 22 1 0 0 0 0 53 | 21 23 1 0 0 0 0 54 | 22 24 1 0 0 0 0 55 | 22 25 1 0 0 0 0 56 | M END 57 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/arginine.xyz: -------------------------------------------------------------------------------- 1 | 26 2 | 3 | N 0.4398550943 2.0812861634 1.4443336389 4 | C 1.2687999310 0.9271084136 1.7314779759 5 | C 2.5203428673 0.9251684395 0.8668013887 6 | O 3.1008971144 -0.0592491322 0.4970624174 7 | H 0.9931251043 2.9289463140 1.4244603203 8 | O 2.9690247945 2.1582415702 0.6073910488 9 | H -0.2848683091 2.1795620626 2.1453845890 10 | H 1.6659854655 0.9259172913 2.7701059255 11 | C 0.4722441072 -0.3685458500 1.5294722832 12 | H -0.3355435228 -0.3980038522 2.2636404836 13 | H 1.1368716847 -1.2142645228 1.7115598557 14 | C -0.1105644695 -0.4584162794 0.1228344455 15 | H 0.7046776013 -0.4920942102 -0.6017394193 16 | H -0.7092482310 0.4302099668 -0.0790162452 17 | C -0.9812516483 -1.7077855411 -0.0460845866 18 | H -0.3867911572 -2.6046214800 0.1505686618 19 | N -1.5339851550 -1.8407970820 -1.3768175974 20 | H -1.7989207839 -1.6883130076 0.6803820618 21 | C -2.4614515883 -0.9650073257 -1.9138085949 22 | H -0.8656564093 -2.1665077506 -2.0617797887 23 | N -2.6885525748 -0.8070431615 -3.1536843298 24 | N -3.1981187147 -0.2206349077 -1.0157435287 25 | H -2.0615681229 -1.3199791519 -3.7645598141 26 | H -3.9762058819 0.2346526535 -1.4683395089 27 | H -3.4384230576 -0.6773260396 -0.1504681096 28 | H 3.7743258618 2.1134964195 0.0675664269 29 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/arginine_frequencies.dat: -------------------------------------------------------------------------------- 1 | # # # Frequencies of arginine in a.u., readuct/gfn2 2 | 1.556650904044223392e-05 3 | 2.343959808634545397e-05 4 | 2.796370618639142051e-05 5 | 3.761009213353743336e-05 6 | 5.090322591669599886e-05 7 | 8.968814727432688821e-05 8 | 1.085402764387090693e-04 9 | 1.575054907902099903e-04 10 | 1.654963700792740858e-04 11 | 1.973554070464230944e-04 12 | 2.058111320284940931e-04 13 | 2.294072846074957138e-04 14 | 2.550133919282686541e-04 15 | 2.725150454199567790e-04 16 | 3.197381391082888737e-04 17 | 3.382042974963371247e-04 18 | 3.765186961641454303e-04 19 | 3.835030531658776155e-04 20 | 3.959762846377229829e-04 21 | 4.331881483619184404e-04 22 | 4.483364727880281538e-04 23 | 4.663610686520465475e-04 24 | 5.237416811339545624e-04 25 | 5.323442686335699489e-04 26 | 5.628583184321114732e-04 27 | 5.641011328734269002e-04 28 | 5.945131403683243500e-04 29 | 6.219587434970647337e-04 30 | 6.635006297275030263e-04 31 | 6.778968562449000585e-04 32 | 7.087568323715442509e-04 33 | 7.592442865370822120e-04 34 | 7.644754046982004357e-04 35 | 7.729538545902047515e-04 36 | 7.842926874981365638e-04 37 | 7.985694765020631258e-04 38 | 8.170597141894413900e-04 39 | 8.284574874745215776e-04 40 | 8.431679558120698179e-04 41 | 8.541020327689287676e-04 42 | 8.627115093296270319e-04 43 | 8.885539129613612835e-04 44 | 9.043161084060054788e-04 45 | 9.114319154636421573e-04 46 | 9.207829623788998594e-04 47 | 9.359564818349893831e-04 48 | 9.583483050235727316e-04 49 | 9.634734895441990788e-04 50 | 9.865539409748204543e-04 51 | 1.004140397068134819e-03 52 | 1.006922519107451191e-03 53 | 1.064487166554859343e-03 54 | 1.070343175254847169e-03 55 | 1.077998425490151943e-03 56 | 1.080881104397009383e-03 57 | 1.117548129557482690e-03 58 | 1.239606642865604801e-03 59 | 1.299079041076162296e-03 60 | 1.972254201661879577e-03 61 | 2.133033759018819909e-03 62 | 2.144290710395040187e-03 63 | 2.155458552427279555e-03 64 | 2.170609949009947876e-03 65 | 2.173769100484703766e-03 66 | 2.186310734534130037e-03 67 | 2.455633649416632484e-03 68 | 2.472335185729642153e-03 69 | 2.483728454263455128e-03 70 | 2.493997463205409326e-03 71 | 2.499186333123874868e-03 72 | 2.505706081360305117e-03 73 | 2.544531402627756272e-03 74 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/chloride.xyz: -------------------------------------------------------------------------------- 1 | 1 2 | 3 | Cl 0.0 0.0 0.0 -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/cyclohexene.json: -------------------------------------------------------------------------------- 1 | {"masm_cbor_graph": "pWFhhqRhYQBhYwphcqRhbIOBAYELgQ1jbG5rgaJhcIIBAmNzZXGGCgsMDw4NYmxyg4EAgQGBAmFzg4EBgQuBDWFzAqRhYQBhYwthcqRhbIOBAIEKgQxjbG5rgaJhcIIBAmNzZXGGCwoNDg8MYmxyg4EAgQGBAmFzg4EAgQqBDGFzAqRhYQBhYwxhcqRhbISBCIEJgQuBD2NsbmuBomFwggIDY3NlcYYMCwoNDg9ibHKDggABgQKBA2Fzg4IICYELgQ9hcwWkYWEAYWMNYXKkYWyEgQaBB4EKgQ5jbG5rgaJhcIICA2NzZXGGDQoLDA8OYmxyg4IAAYECgQNhc4OCBgeBCoEOYXMFpGFhAGFjDmFypGFshIEEgQWBDYEPY2xua4GiYXCCAgNjc2Vxhg4NCgsMD2JscoOCAAGBAoEDYXODggQFgQ2BD2FzBaRhYQBhYw9hcqRhbISBAoEDgQyBDmNsbmuBomFwggIDY3NlcYYPDAsKDQ5ibHKDggABgQKBA2Fzg4ICA4EMgQ5hcwVhYoGiYWEAYWWCCgthYw9hZ6JhRZCDAAsAgwEKAIMCDwCDAw8AgwQOAIMFDgCDBg0AgwcNAIMIDACDCQwAgwoLAYMKDQCDCwwAgwwPAIMNDgCDDg8AYVqQAQEBAQEBAQEBAQYGBgYGBmF2gwEAAA==", "masm_decision_list": "", "masm_idx_map": "[(0, 0), (0, 1), (0, 2), (0, 3), (0, 4), (0, 5), (0, 6), (0, 7), (0, 8), (0, 9), (0, 10), (0, 11), (0, 12), (0, 13), (0, 14), (0, 15)]"} 2 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/cyclohexene.xyz: -------------------------------------------------------------------------------- 1 | 16 2 | 3 | H -0.1814004444 2.8693994785 0.3058338939 4 | H 2.3178693341 1.7532882518 0.2699007047 5 | H -0.7730032967 -0.9421573859 1.4996589864 6 | H -2.0492912382 -1.5100856138 0.1319390635 7 | H -0.0159709400 -0.7515012094 -1.7200737390 8 | H 0.2715949148 -2.4166772690 -0.7667503640 9 | H 2.4932889111 -0.9102534105 -0.4541899973 10 | H 1.4901626229 -0.9627216333 1.1709388250 11 | H -1.6518996286 0.7862508585 -1.1476026586 12 | H -2.3339923617 1.1940155520 0.5832530982 13 | C 1.3465793983 1.0847273065 0.1734481995 14 | C -0.0342985954 1.6923455358 0.1798790660 15 | C -1.3994012164 0.7740165383 0.0174979088 16 | C 1.4937016759 -0.5639579740 0.0462996637 17 | C 0.1434529108 -1.2586567304 -0.6521428314 18 | C -1.1173920465 -0.8380322952 0.3621101808 19 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/ethene.mol: -------------------------------------------------------------------------------- 1 | ethene 2 | PyMOL2.5 3D 0 3 | 4 | 6 5 0 0 0 0 0 0 0 0999 V2000 5 | -0.0862 0.0396 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 6 | -1.4138 0.0396 -0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 7 | 0.4841 0.9606 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 8 | 0.5597 -0.8266 -0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 9 | -1.9841 0.9606 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 10 | -2.0597 -0.8266 -0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 11 | 1 2 2 0 0 0 0 12 | 1 3 1 0 0 0 0 13 | 1 4 1 0 0 0 0 14 | 2 5 1 0 0 0 0 15 | 2 6 1 0 0 0 0 16 | M END 17 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/furfuryl_alcohol.json: -------------------------------------------------------------------------------- 1 | { 2 | "masm_decision_list" : "(176, -178, -173, 1):(-155, -149, -144, 1)", 3 | "masm_cbor_graph" : "pWFhh6VhYQBhYwZhb4GCAAFhcqRhbIKBCoELY2xua4GiYXCCAAFjc2VxhQYKCAkLYmxygoEAgQFhc4KBCoELYXMBpWFhAGFjB2FvgYIAAWFyo2FsgoEBgQxibHKCgQCBAWFzgoEBgQxhcwGlYWEAYWMIYW+BgwABAmFypGFsg4EAgQmBCmNsbmuBomFwggECY3NlcYUICQsGCmJscoOBAIEBgQJhc4OBAIEJgQphcwKlYWEAYWMJYW+BgwABAmFypGFsg4ECgQiBC2NsbmuBomFwggECY3NlcYUJCAoGC2JscoOBAIEBgQJhc4OBAoEIgQthcwKlYWEAYWMKYW+BgwABAmFypGFsg4EDgQaBCGNsbmuBomFwggECY3NlcYUKBgsJCGJscoOBAIECgQFhc4OBA4EIgQZhcwKlYWEAYWMLYW+BgwABAmFypGFsg4EGgQmBDGNsbmuBomFwggABY3NlcYULBgoICWJscoOBAYECgQBhc4OBCYEMgQZhcwKlYWEAYWMMYW+BhAABAgNhcqNhbISBBIEFgQeBC2JscoOCAAGBA4ECYXODggQFgQuBB2FzBWFihaJhYQBhZYIGCqJhYQBhZYIGC6JhYQBhZYIICaJhYQBhZYIICqJhYQBhZYIJC2FjD2FnomFFjYMACACDAQcAgwIJAIMDCgCDBAwAgwUMAIMGCgCDBgsAgwcMAIMICQCDCAoAgwkLAIMLDABhWo0BAQEBAQEICAYGBgYGYXaDAgAA", 4 | "masm_idx_map" : "[(0, 10), (0, 8), (0, 6), (0, 9), (0, 11), (0, 12), (0, 7), (0, 1), (0, 3), (0, 0), (0, 2), (0, 4), (0, 5)]" 5 | } 6 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/furfuryl_alcohol.xyz: -------------------------------------------------------------------------------- 1 | 13 2 | 3 | C -3.4586700981 0.7426935309 -0.1809181650 4 | C -3.0104416916 2.0035764496 0.0533163225 5 | O -2.4363315196 -0.1350928952 -0.1639157206 6 | C -1.6078781409 1.8921892518 0.2327427859 7 | C -1.3109394996 0.5686355641 0.0916875053 8 | C -0.0115804026 -0.1749862568 0.1674653603 9 | O 1.1011999905 0.6266020013 -0.1397470854 10 | H 0.9953282974 0.9885702480 -1.0286466784 11 | H -4.4371211917 0.3482261348 -0.3687957492 12 | H -3.5941767990 2.8998288406 0.0956067608 13 | H -0.9167652698 2.6826125245 0.4413551052 14 | H -0.0699885113 -1.0527959703 -0.4937678762 15 | H 0.1588155363 -0.5331643333 1.1893868147 16 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/ga_complex.json: -------------------------------------------------------------------------------- 1 | {"masm_decision_list" : "(166, 172, 177, 1):(-66, -60, -55, 1):(-177, -170, -166, 1):(55, 60, 66, 1):(57, 63, 68, 1):(55, 60, 66, 1):(-50, -43, -39, 1):(-41, -34, -30, 1):(111, 117, 122, 1):(-62, -55, -51, 3);", 2 | "masm_cbor_graph" : "pGFhmB2lYWEAYWMNYW+BggABYXKkYWyCgRglgRgmY2xua4GiYXCCAAFjc2VxiA0YJQ8YJw4YJBYYJmJscoKBAYEAYXOCgRgmgRglYXMApWFhAGFjDmFvgYIAAWFypGFsgoEYJIEYJ2NsbmuBomFwggABY3NlcYgOGCQWGCYNGCUPGCdibHKCgQCBAWFzgoEYJIEYJ2FzAKVhYQBhYw9hb4GCAAFhcqRhbIKBGCWBGCdjbG5rgaJhcIIAAWNzZXGIDxglGBoYKRgfGCAYHhgnYmxygoEAgQFhc4KBGCWBGCdhcwClYWEAYWMQYW+BggABYXKkYWyCgRgmgRgoY2xua4GiYXCCAAFjc2VxiBAYJhYYJBQYIxgcGChibHKCgQCBAWFzgoEYJoEYKGFzAKVhYQBhYxFhb4GCAAFhcqNhbIKBBoEYJGJscoKBAIEBYXOCgQaBGCRhcwGlYWEAYWMSYW+BggABYXKjYWyCgQGBGCNibHKCgQCBAWFzgoEBgRgjYXMBpWFhAGFjE2FvgYIAAWFyo2FsgoEAgRgjYmxygoEAgQFhc4KBAIEYI2FzAaVhYQBhYxRhb4GCAAFhcqRhbIKBGCOBGCRjbG5rgaJhcIIAAWNzZXGIFBgjGBwYKBAYJhYYJGJscoKBAIEBYXOCgRgjgRgkYXMBpWFhAGFjFWFvgYIAAWFyo2FsgoECgRgmYmxygoEAgQFhc4KBAoEYJmFzAaVhYQBhYxZhb4GCAAFhcqRhbIKBGCSBGCZjbG5rgaJhcIIAAWNzZXGIFhgkFBgjGBwYKBAYJmJscoKBAYEAYXOCgRgmgRgkYXMBpWFhAGFjF2FvgYIAAWFyo2FsgoEDgRglYmxygoEAgQFhc4KBA4EYJWFzAaVhYQBhYxgYYW+BggABYXKjYWyCgQeBGCdibHKCgQCBAWFzgoEHgRgnYXMBpWFhAGFjGBlhb4GCAAFhcqNhbIKBBIEYKWJscoKBAIEBYXOCgQSBGClhcwGlYWEAYWMYGmFvgYIAAWFypGFsgoEYJYEYKWNsbmuBomFwggABY3NlcYgYGhglDxgnGB4YIBgfGClibHKCgQCBAWFzgoEYJYEYKWFzAaVhYQBhYxgbYW+BggABYXKjYWyCgQWBGChibHKCgQCBAWFzgoEFgRgoYXMBpWFhAGFjGBxhb4GCAAFhcqRhbIKBGCOBGChjbG5rgaJhcIIAAWNzZXGIGBwYIxQYJBYYJhAYKGJscoKBAIEBYXOCgRgjgRgoYXMBpWFhAGFjGB1hb4GCAAFhcqRhbIKBGCiBGCljbG5rgaJhcIIAAWNzZXGIGB0YKBAYJg0YJRgaGClibHKCgQCBAWFzgoEYKIEYKWFzAaVhYQBhYxgeYW+BggABYXKkYWyCgRgggRgnY2xua4GiYXCCAAFjc2VxiBgeGCAYHxgpGBoYJQ8YJ2JscoKBAYEAYXOCgRgngRggYXMBpWFhAGFjGB9hb4GCAAFhcqRhbIKBGCCBGCljbG5rgaJhcIIAAWNzZXGIGB8YIBgeGCcPGCUYGhgpYmxygoEBgQBhc4KBGCmBGCBhcwGlYWEAYWMYIGFvgYMAAQJhcqRhbIOBGB6BGB+BGCJjbG5rgaJhcIIAAWNzZXGIGCAYHhgnDxglGBoYKRgfYmxyg4ECgQCBAWFzg4EYIoEYHoEYH2FzAqVhYQBhYxghYW+BhAABAgNhcqNhbISBCoELgQyBGCJibHKCgwABAoEDYXOCgwoLDIEYImFzBaVhYQBhYxgiYW+BhAABAgNhcqNhbISBCIEJgRgggRghYmxyg4IAAYEDgQJhc4OCCAmBGCGBGCBhcwWlYWEAYWMYI2FvgYQAAQIDYXKkYWyEgRKBE4EUgRgcY2xua4GiYXCCAgNjc2VxiBgjFBgkFhgmEBgoGBxibHKDggABgQOBAmFzg4ISE4EYHIEUYXMFpWFhAGFjGCRhb4GEAAECA2FypGFshIEOgRGBFIEWY2xua4KiYXCCAANjc2VxiBgkDhgnDxglDRgmFqJhcIICA2NzZXGIGCQUGCMYHBgoEBgmFmJscoSBAYECgQOBAGFzhIERgRSBFoEOYXMFpWFhAGFjGCVhb4GEAAECA2FypGFshIENgQ+BF4EYGmNsbmuDomFwggABY3NlcYgYJQ0YJhYYJA4YJw+iYXCCAANjc2VxiBglDRgmEBgoGB0YKRgaomFwggEDY3NlcYgYJQ8YJxgeGCAYHxgpGBpibHKEgQKBAIEDgQFhc4SBF4ENgRgagQ9hcwWlYWEAYWMYJmFvgYQAAQIDYXKkYWyEgQ2BEIEVgRZjbG5rg6JhcIIAAWNzZXGIGCYNGCUYGhgpGB0YKBCiYXCCAANjc2VxiBgmDRglDxgnDhgkFqJhcIIBA2NzZXGIGCYQGCgYHBgjFBgkFmJscoSBAoEDgQGBAGFzhIEVgRaBEIENYXMFpWFhAGFjGCdhb4GEAAECA2FypGFshIEOgQ+BGBiBGB5jbG5rgqJhcIIAAWNzZXGIGCcOGCQWGCYNGCUPomFwggEDY3NlcYgYJw8YJRgaGCkYHxggGB5ibHKEgQKBAIEBgQNhc4SBGBiBDoEPgRgeYXMFpWFhAWFjGChhb4GEAAECA2FypGFshIEQgRgbgRgcgRgdY2xua4KiYXCCAAJjc2VxiBgoEBgmFhgkFBgjGByiYXCCAANjc2VxiBgoEBgmDRglGBoYKRgdYmxyhIEBgQKBAIEDYXOEgRgbgRgcgRCBGB1hcwWlYWEBYWMYKWFvgYQAAQIDYXKkYWyEgRgZgRgagRgdgRgfY2xua4KiYXCCAQJjc2VxiBgpGBoYJQ0YJhAYKBgdomFwggEDY3NlcYgYKRgaGCUPGCcYHhggGB9ibHKEgQCBAoEBgQNhc4SBGBmBGB2BGBqBGB9hcwVhYw9hZ6JhRZgtgwATAIMBEgCDAhUAgwMXAIMEGBkAgwUYGwCDBhEAgwcYGACDCBgiAIMJGCIAgwoYIQCDCxghAIMMGCEAgw0YJQCDDRgmAIMOGCQAgw4YJwCDDxglAIMPGCcAgxAYJgCDEBgoAIMRGCQAgxIYIwCDExgjAIMUGCMAgxQYJACDFRgmAIMWGCQAgxYYJgCDFxglAIMYGBgnAIMYGRgpAIMYGhglAIMYGhgpAIMYGxgoAIMYHBgjAIMYHBgoAIMYHRgoAIMYHRgpAIMYHhggAIMYHhgnAIMYHxggAIMYHxgpAIMYIBgiAIMYIRgiAGFamCoBAQEBAQEBAQEBAQEBCAgICAgICAgICAgICAgICAgICBgfBgYODg4ODg4OYXaDAgAA;pWFhgqVhYQBhYwRhb4GDAAECYXKjYWyDgQKBA4EFYmxygoIAAYECYXOCggIDgQVhcwKlYWEAYWMFYW+BgwABAmFyo2Fsg4EAgQGBBGJscoKCAAGBAmFzgoIAAYEEYXMCYWKBomFhAGFlggQFYWMPYWeiYUWFgwAFAIMBBQCDAgQAgwMEAIMEBQBhWoYBAQEBBgZhdoMCAAA=", 3 | "masm_idx_map" : "[(1, 4), (1, 2), (1, 3), (1, 5), (1, 0), (1, 1), (0, 34), (0, 33), (0, 32), (0, 8), (0, 9), (0, 10), (0, 11), (0, 12), (0, 30), (0, 31), (0, 35), (0, 36), (0, 39), (0, 40), (0, 38), (0, 37), (0, 41), (0, 20), (0, 14), (0, 19), (0, 28), (0, 22), (0, 15), (0, 16), (0, 13), (0, 26), (0, 29), (0, 24), (0, 17), (0, 21), (0, 23), (0, 18), (0, 27), (0, 25), (0, 5), (0, 0), (0, 1), (0, 6), (0, 7), (0, 3), (0, 4), (0, 2)]" 4 | } 5 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/ga_complex.mol: -------------------------------------------------------------------------------- 1 | ga_complex 2 | PyMOL2.5 3D 0 3 | 4 | 48 50 0 0 0 0 0 0 0 0999 V2000 5 | -3.9082 -0.7993 1.5146 C 0 0 0 0 0 0 0 0 0 0 0 0 6 | -3.8393 -1.8783 1.5361 H 0 0 0 0 0 0 0 0 0 0 0 0 7 | -3.9895 -0.2928 2.4668 H 0 0 0 0 0 0 0 0 0 0 0 0 8 | -3.9886 -0.1396 0.3674 C 0 0 0 0 0 0 0 0 0 0 0 0 9 | -4.0949 0.9327 0.3333 H 0 0 0 0 0 0 0 0 0 0 0 0 10 | -3.9457 -0.6538 -0.5801 H 0 0 0 0 0 0 0 0 0 0 0 0 11 | -0.8667 -1.5005 3.1479 C 0 0 0 0 0 0 0 0 0 0 0 0 12 | 0.4075 -2.3358 3.2665 C 0 0 0 0 0 0 0 0 0 0 0 0 13 | -1.0433 -0.7123 1.2657 Ga 0 0 0 0 0 0 0 0 0 0 0 0 14 | -0.8725 -0.7100 3.8992 H 0 0 0 0 0 0 0 0 0 0 0 0 15 | -1.7375 -2.1374 3.3146 H 0 0 0 0 0 0 0 0 0 0 0 0 16 | 1.2889 -1.7029 3.1834 H 0 0 0 0 0 0 0 0 0 0 0 0 17 | 0.4453 -3.0816 2.4729 H 0 0 0 0 0 0 0 0 0 0 0 0 18 | 0.4322 -2.8471 4.2297 H 0 0 0 0 0 0 0 0 0 0 0 0 19 | -1.2186 1.1029 0.9127 O 0 0 0 0 0 0 0 0 0 0 0 0 20 | -1.3633 -1.9462 -0.0281 O 0 0 0 0 0 0 0 0 0 0 0 0 21 | 1.8667 0.7686 1.5243 Si 0 0 0 0 0 0 0 0 0 0 0 0 22 | 1.6803 2.9084 -0.5565 Si 0 0 0 0 0 0 0 0 0 0 0 0 23 | -1.2504 2.0412 -0.3681 Si 0 0 0 0 0 0 0 0 0 0 0 0 24 | 1.9673 -1.2519 -0.5356 Si 0 0 0 0 0 0 0 0 0 0 0 0 25 | 2.1011 0.8895 -2.7047 Si 0 0 0 0 0 0 0 0 0 0 0 0 26 | -0.8741 0.2851 -2.9251 Si 0 0 0 0 0 0 0 0 0 0 0 0 27 | -0.6246 -2.3060 -1.3838 Si 0 0 0 0 0 0 0 0 0 0 0 0 28 | 2.3362 2.0163 0.6284 O 0 0 0 0 0 0 0 0 0 0 0 0 29 | 0.0821 2.9860 -0.4541 O 0 0 0 0 0 0 0 0 0 0 0 0 30 | 0.8519 1.1820 2.7047 O 0 0 0 0 0 0 0 0 0 0 0 0 31 | 1.1552 -0.4068 0.6265 O 0 0 0 0 0 0 0 0 0 0 0 0 32 | 2.1656 2.3425 -1.9894 O 0 0 0 0 0 0 0 0 0 0 0 0 33 | -1.4175 1.2522 -1.7739 O 0 0 0 0 0 0 0 0 0 0 0 0 34 | 2.5647 -0.2249 -1.6214 O 0 0 0 0 0 0 0 0 0 0 0 0 35 | 0.6615 0.6192 -3.3416 O 0 0 0 0 0 0 0 0 0 0 0 0 36 | -0.9924 -1.2846 -2.5946 O 0 0 0 0 0 0 0 0 0 0 0 0 37 | 1.0065 -2.3226 -1.2120 O 0 0 0 0 0 0 0 0 0 0 0 0 38 | -2.5133 3.0376 -0.1856 O 0 0 0 0 0 0 0 0 0 0 0 0 39 | 2.3287 4.3614 -0.3122 O 0 0 0 0 0 0 0 0 0 0 0 0 40 | 3.1058 0.8725 -3.9622 O 0 0 0 0 0 0 0 0 0 0 0 0 41 | -1.8245 0.6319 -4.1831 O 0 0 0 0 0 0 0 0 0 0 0 0 42 | 3.1954 0.0739 2.1487 O 0 0 0 0 0 0 0 0 0 0 0 0 43 | 3.1770 -2.0672 0.1474 O 0 0 0 0 0 0 0 0 0 0 0 0 44 | -1.0750 -3.7917 -1.8254 O 0 0 0 0 0 0 0 0 0 0 0 0 45 | 3.6262 -1.6553 0.8860 H 0 0 0 0 0 0 0 0 0 0 0 0 46 | -0.0101 1.4784 2.3802 H 0 0 0 0 0 0 0 0 0 0 0 0 47 | 3.7311 0.5995 2.7392 H 0 0 0 0 0 0 0 0 0 0 0 0 48 | 2.1944 5.0466 -0.9607 H 0 0 0 0 0 0 0 0 0 0 0 0 49 | -2.6854 3.6791 -0.8704 H 0 0 0 0 0 0 0 0 0 0 0 0 50 | -1.6998 0.1565 -5.0000 H 0 0 0 0 0 0 0 0 0 0 0 0 51 | -0.5744 -4.2280 -2.5095 H 0 0 0 0 0 0 0 0 0 0 0 0 52 | 4.0378 1.0127 -3.8182 H 0 0 0 0 0 0 0 0 0 0 0 0 53 | 1 2 1 0 0 0 0 54 | 1 3 1 0 0 0 0 55 | 1 4 2 0 0 0 0 56 | 4 5 1 0 0 0 0 57 | 4 6 1 0 0 0 0 58 | 7 8 1 0 0 0 0 59 | 7 9 1 0 0 0 0 60 | 7 10 1 0 0 0 0 61 | 7 11 1 0 0 0 0 62 | 8 12 1 0 0 0 0 63 | 8 13 1 0 0 0 0 64 | 8 14 1 0 0 0 0 65 | 9 15 1 0 0 0 0 66 | 9 16 1 0 0 0 0 67 | 15 19 1 0 0 0 0 68 | 16 23 1 0 0 0 0 69 | 17 24 1 0 0 0 0 70 | 17 26 1 0 0 0 0 71 | 17 27 1 0 0 0 0 72 | 17 38 1 0 0 0 0 73 | 18 24 1 0 0 0 0 74 | 18 25 1 0 0 0 0 75 | 18 28 1 0 0 0 0 76 | 18 35 1 0 0 0 0 77 | 19 25 1 0 0 0 0 78 | 19 29 1 0 0 0 0 79 | 19 34 1 0 0 0 0 80 | 20 27 1 0 0 0 0 81 | 20 30 1 0 0 0 0 82 | 20 33 1 0 0 0 0 83 | 20 39 1 0 0 0 0 84 | 21 28 1 0 0 0 0 85 | 21 30 1 0 0 0 0 86 | 21 31 1 0 0 0 0 87 | 21 36 1 0 0 0 0 88 | 22 29 1 0 0 0 0 89 | 22 31 1 0 0 0 0 90 | 22 32 1 0 0 0 0 91 | 22 37 1 0 0 0 0 92 | 23 32 1 0 0 0 0 93 | 23 33 1 0 0 0 0 94 | 23 40 1 0 0 0 0 95 | 26 42 1 0 0 0 0 96 | 34 45 1 0 0 0 0 97 | 35 44 1 0 0 0 0 98 | 36 48 1 0 0 0 0 99 | 37 46 1 0 0 0 0 100 | 38 43 1 0 0 0 0 101 | 39 41 1 0 0 0 0 102 | 40 47 1 0 0 0 0 103 | M END 104 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/ga_complex.xyz: -------------------------------------------------------------------------------- 1 | 48 2 | 3 | C -3.9082441330 -0.7993341684 1.5146279335 4 | H -3.8392770290 -1.8782747984 1.5360809565 5 | H -3.9895236492 -0.2927578390 2.4668190479 6 | C -3.9885509014 -0.1396094710 0.3673723936 7 | H -4.0949296951 0.9327234626 0.3332777917 8 | H -3.9456627369 -0.6538023353 -0.5801411271 9 | C -0.8666814566 -1.5004991293 3.1479024887 10 | C 0.4075059593 -2.3358421326 3.2665231228 11 | Ga -1.0433038473 -0.7122889161 1.2656780481 12 | H -0.8725126982 -0.7099992633 3.8991723061 13 | H -1.7374705076 -2.1374022961 3.3146157265 14 | H 1.2888581753 -1.7029392719 3.1833877563 15 | H 0.4453255534 -3.0816459656 2.4729444981 16 | H 0.4322287440 -2.8471090794 4.2296996117 17 | O -1.2186343670 1.1029212475 0.9127140641 18 | O -1.3633139133 -1.9462240934 -0.0280568600 19 | Si 1.8667230606 0.7685805559 1.5242667198 20 | Si 1.6802597046 2.9083778858 -0.5565498471 21 | Si -1.2503614426 2.0412366390 -0.3680573106 22 | Si 1.9673013687 -1.2519345284 -0.5355976820 23 | Si 2.1011354923 0.8895203471 -2.7047116756 24 | Si -0.8741079569 0.2850840092 -2.9251003265 25 | Si -0.6245500445 -2.3059539795 -1.3838200569 26 | O 2.3362324238 2.0162627697 0.6284065247 27 | O 0.0820887983 2.9859752655 -0.4540521204 28 | O 0.8519317508 1.1820145845 2.7047293186 29 | O 1.1551797390 -0.4068496525 0.6265348792 30 | O 2.1655685902 2.3424530029 -1.9893561602 31 | O -1.4175018072 1.2522373199 -1.7739131451 32 | O 2.5647139549 -0.2248885483 -1.6213858128 33 | O 0.6614937782 0.6191871762 -3.3416137695 34 | O -0.9923740029 -1.2845714092 -2.5945978165 35 | O 1.0064742565 -2.3226249218 -1.2120393515 36 | O -2.5132935047 3.0376105309 -0.1856152415 37 | O 2.3286981583 4.3614025116 -0.3121790886 38 | O 3.1057858467 0.8724890351 -3.9621739388 39 | O -1.8245418072 0.6318928599 -4.1831154823 40 | O 3.1954321861 0.0739093721 2.1486835480 41 | O 3.1769623756 -2.0671603680 0.1473834217 42 | O -1.0750269890 -3.7916870117 -1.8253524303 43 | H 3.6262207031 -1.6552695036 0.8860286474 44 | H -0.0101255924 1.4783996344 2.3802037239 45 | H 3.7311334610 0.5994907618 2.7391636372 46 | H 2.1944169998 5.0465888977 -0.9607433081 47 | H -2.6853640079 3.6790542603 -0.8703531623 48 | H -1.6997545958 0.1565267146 -4.9999885559 49 | H -0.5744144917 -4.2280187607 -2.5095436573 50 | H 4.0378499031 1.0127484798 -3.8181581497 51 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/h4o2.xyz: -------------------------------------------------------------------------------- 1 | 6 2 | 3 | O -0.6889109170 -0.8555828685 0.3496221061 4 | H -0.5125477263 0.4229658008 0.2545200689 5 | H -0.9320052699 -1.2371907503 -0.4952874508 6 | O 0.6889528022 0.9012659457 0.2047918889 7 | H 0.5125908763 -0.3756040296 0.3202764125 8 | H 0.9319202212 1.1394233739 -0.6912205037 9 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/h4o2_frequencies.dat: -------------------------------------------------------------------------------- 1 | # # # Frequencies of H4O2 in a.u., reduct/gfn2 2 | 3 | -0.00170333 4 | 0.00039206 5 | 0.0004908 6 | 0.00049184 7 | 0.00049198 8 | 0.00078062 9 | 0.00084599 10 | 0.00099115 11 | 0.00102624 12 | 0.00143861 13 | 0.00264487 14 | 0.00264791 -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/hydrogen.xyz: -------------------------------------------------------------------------------- 1 | 1 2 | 3 | H -0.5125477263 0.4229658008 0.2545200689 -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/hydrogenperoxide.json: -------------------------------------------------------------------------------- 1 | {"masm_cbor_graph": "pGFhgqRhYQBhYwJhcqNhbIKBAYEDYmxygoEAgQFhc4KBAYEDYXMBpGFhAGFjA2Fyo2FsgoEAgQJibHKCgQCBAWFzgoEAgQJhcwFhYw9hZ6JhRYODAAMAgwECAIMCAwBhWoQBAQgIYXaDAQAA", "masm_decision_list": "", "masm_idx_map": "[(0, 0), (0, 1), (0, 2), (0, 3)]"} 2 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/hydrogenperoxide.xyz: -------------------------------------------------------------------------------- 1 | 4 2 | 3 | H -1.0787698084 0.3984244025 -0.1230381966 4 | H 1.0278584864 0.4472293364 0.1130279017 5 | O 0.6457620477 -0.4295602981 -0.1958322160 6 | O -0.5948507257 -0.4160934408 0.2058425109 7 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/hydroxide.xyz: -------------------------------------------------------------------------------- 1 | 2 2 | 3 | O -0.0793220494 0.1649269988 -0.4624096233 4 | H 0.0793220494 -0.1649269988 0.4624096233 5 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/iodine_atom.xyz: -------------------------------------------------------------------------------- 1 | 1 2 | 3 | I 0.0000000000 0.0000000000 0.0000000000 4 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/methane.xyz: -------------------------------------------------------------------------------- 1 | 5 2 | 3 | C 1.05588 -0.07582 -0.03360 4 | H 2.14808 -0.07582 -0.03360 5 | H 0.69181 0.90163 -0.35754 6 | H 0.69181 -0.28401 0.97487 7 | H 0.69181 -0.84509 -0.71813 8 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/ni_catalyst.json: -------------------------------------------------------------------------------- 1 | { 2 | "masm_decision_list" : "(-57, -51, -46, 1):(48, 53, 59, 1):(45, 50, 56, 1):(45, 50, 56, 1):(45, 51, 56, 1):(45, 51, 56, 1):(46, 51, 57, 1):(45, 51, 56, 1):(47, 52, 58, 1):(46, 51, 57, 1):(49, 55, 60, 1)", 3 | "masm_cbor_graph" : "pGFhjaRhYQBhYxgbYXKjYWyDgRglgRgmgRgnYmxygoEAggECYXOCgRglghgmGCdhcwKkYWEAYWMYHGFyo2FshIEPgRCBEYEYJ2JscoKDAAECgQNhc4KDDxARgRgnYXMFpGFhAGFjGB1hcqNhbISBDIENgQ6BGCdibHKCgwABAoEDYXOCgwwNDoEYJ2FzBaRhYQBhYxgeYXKjYWyEgQmBCoELgRgnYmxygoMAAQKBA2FzgoMJCguBGCdhcwWkYWEAYWMYH2Fyo2FshIEEgQWBBoEYJmJscoKDAAECgQNhc4KDBAUGgRgmYXMFpGFhAGFjGCBhcqNhbISBAYECgQOBGCZibHKCgwABAoEDYXOCgwECA4EYJmFzBaRhYQBhYxghYXKjYWyEgQCBB4EIgRgmYmxygoMAAQKBA2FzgoMABwiBGCZhcwWkYWEAYWMYImFyo2FshIEWgReBGBiBGCVibHKCgwABAoEDYXOCgxYXGBiBGCVhcwWkYWEAYWMYI2Fyo2FshIETgRSBFYEYJWJscoKDAAECgQNhc4KDExQVgRglYXMFpGFhAGFjGCRhcqNhbISBEoEYGYEYGoEYJWJscoKDAAECgQNhc4KDEhgZGBqBGCVhcwWkYWEAYWMYJWFyo2FshIEYG4EYIoEYI4EYJGJscoKDAQIDgQBhc4KDGCIYIxgkgRgbYXMFpGFhAGFjGCZhcqNhbISBGBuBGB+BGCCBGCFibHKCgwECA4EAYXOCgxgfGCAYIYEYG2FzBaRhYQBhYxgnYXKjYWyEgRgbgRgcgRgdgRgeYmxygoMBAgOBAGFzgoMYHBgdGB6BGBthcwVhYw9hZ6JhRZgngwAYIQCDARggAIMCGCAAgwMYIACDBBgfAIMFGB8AgwYYHwCDBxghAIMIGCEAgwkYHgCDChgeAIMLGB4AgwwYHQCDDRgdAIMOGB0Agw8YHACDEBgcAIMRGBwAgxIYJACDExgjAIMUGCMAgxUYIwCDFhgiAIMXGCIAgxgYGCIAgxgZGCQAgxgaGCQAgxgbGCUAgxgbGCYAgxgbGCcAgxgcGCcAgxgdGCcAgxgeGCcAgxgfGCYAgxggGCYAgxghGCYAgxgiGCUAgxgjGCUAgxgkGCUAYVqYKAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBARgcBgYGBgYGBgYGDhkPjxkPj2F2gwEBAA==", 4 | "masm_idx_map" : "[(0, 15), (0, 16), (0, 9), (0, 10), (0, 11), (0, 12), (0, 13), (0, 14), (0, 17), (0, 0), (0, 1), (0, 28), (0, 30), (0, 29), (0, 39), (0, 27), (0, 38), (0, 33), (0, 32), (0, 2), (0, 3), (0, 7), (0, 8), (0, 31), (0, 4), (0, 5), (0, 6), (0, 18), (0, 25), (0, 19), (0, 20), (0, 21), (0, 22), (0, 23), (0, 24), (0, 26), (0, 36), (0, 35), (0, 34), (0, 37)]" 5 | } 6 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/ni_catalyst.xyz: -------------------------------------------------------------------------------- 1 | 40 2 | Coordinates from ORCA-job orca 3 | H -1.26823405650739 2.02920877764745 -1.97736435229603 4 | H -0.38404919254960 3.55648043442977 -1.56389534637121 5 | H 2.29102600302597 2.50187822190107 0.07161703161423 6 | H 1.22556286381742 3.86187760369905 0.59935290373546 7 | H 1.63436157545025 2.52529022074098 1.74393275732249 8 | H -1.34166847942333 3.72339509480619 0.98116612904154 9 | H -2.37837396397920 2.25458638159299 0.75330893247974 10 | H -1.28470313285042 2.35836514533936 2.16844918229726 11 | H 0.50687256673387 2.12541327803938 -2.22375655102581 12 | H 4.32065502039805 -0.92772900275459 1.11397791530637 13 | H 1.99811206466278 -3.27630665502248 0.60020830509943 14 | C -0.32772508536210 2.44765155982684 -1.56972724485332 15 | C 1.40949680979876 2.76993515729786 0.68649306761607 16 | C -1.39191763148707 2.62023651505748 1.09693501493158 17 | P -0.05903918441837 1.77119407404079 0.13312490382867 18 | Ni 0.04811509472949 -0.35405377195646 0.10077377836647 19 | P 2.14013008428289 -0.92930285736348 -0.07648782168610 20 | C 3.29944253790897 -0.54369474218145 1.31622785408919 21 | C 2.41765801537141 -2.75004326423609 -0.27999749385013 22 | H 3.49389018282469 -3.00226889466402 -0.38495064071495 23 | H 1.86760347459008 -3.09766464512018 -1.17683920287111 24 | H 3.34253348330441 0.55209086594548 1.46822611324192 25 | H 2.91300796827561 -1.00574844204384 2.24583899007268 26 | C 3.07179585306363 -0.26174721095914 -1.53291079890421 27 | H 4.10441118701132 -0.66566979974139 -1.57585429150068 28 | H 3.11513825299617 0.84369776979313 -1.47062587675921 29 | H 2.53378442833092 -0.53584869836274 -2.46183933194321 30 | H -1.84278408442106 -3.40387376389425 0.37790923666537 31 | H -3.46734590701231 -3.05044549285280 -0.31067611706028 32 | H -2.90842864394250 -0.11898196651990 -2.19583198638741 33 | H -4.33340405890909 -0.39635929351177 -1.14118571295437 34 | H -3.37086372383593 1.10448710953092 -0.97441039562029 35 | H -4.14192381133060 -1.06508120458052 1.71397553394895 36 | H -2.59210435566137 -1.30371261305863 2.58774823797967 37 | H -3.12176271162244 0.34672113352274 2.14685588206444 38 | H -2.00164033251998 -2.96775284196964 -1.34866195393250 39 | C -2.39427313982181 -2.75314905866484 -0.33231322555840 40 | C -3.29887585538315 0.01161636470286 -1.16398672801713 41 | C -3.09218036688907 -0.70584130254961 1.79711351188258 42 | Si -2.17532074864989 -0.88836918590649 0.11530079072225 43 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/proline_acid.xyz: -------------------------------------------------------------------------------- 1 | 17 2 | dftb3 optimized 3 | C -3.5445628128 2.0215753918 -0.1440104929 4 | C -2.2489114608 2.8380823260 -0.2686179383 5 | C -1.4761384134 2.2007266416 -1.4567789740 6 | N -2.0914225555 0.8632818733 -1.6939956397 7 | C -3.5152962667 1.0256740969 -1.3226979537 8 | H -4.4342050957 2.6548875421 -0.1738824793 9 | H -1.6487009507 2.7882727424 0.6431280142 10 | H -2.4467842893 3.8950953117 -0.4584739029 11 | H -1.6392109266 2.8163058167 -2.3633046084 12 | H -1.6705004291 0.1967754313 -1.0356801525 13 | H -3.9476244848 0.0506427829 -1.0758186844 14 | H -4.0716174662 1.4285660115 -2.1815441649 15 | H -3.5720956576 1.4862249815 0.8091741985 16 | C 0.0384610247 2.0706603608 -1.2552557030 17 | O 0.6862520676 2.7270360738 -0.4628021311 18 | O 0.6251346889 1.1475137453 -2.0714418190 19 | H -0.0409569721 0.7037088706 -2.6208075683 20 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/proline_acid_propanal_product.json: -------------------------------------------------------------------------------- 1 | { 2 | "masm_decision_list" : "(-7, -1, 4):(-69, -63, -58):(45, 51, 56):(167, 173, 178):(-65, -58, -54):(53, 59, 64)", 3 | "masm_cbor_graph" : "pGFhi6RhYQBhYxBhcqNhbIKBDYESYmxygoEAgQFhc4KBDYESYXMBpGFhAGFjEWFyo2FsgoEAgRgaYmxygoEAgQFhc4KBAIEYGmFzAaRhYQBhYxJhcqNhbIOBD4EQgRdibHKDgQKBAYEAYXODgReBEIEPYXMCpGFhAGFjE2FypGFsg4EWgReBGBpjbG5rgaJhcIIAAWNzZXGFExYUFRdibHKDgQCBAYECYXODgRaBF4EYGmFzA6RhYQBhYxRhcqRhbISBBYEGgRWBFmNsbmuBomFwggIDY3NlcYUUFRcTFmJscoOCAAGBAoEDYXODggUGgRWBFmFzBaRhYQBhYxVhcqRhbISBA4EEgRSBF2NsbmuBomFwggIDY3NlcYUVFBYTF2JscoOCAAGBAoEDYXODggMEgRSBF2FzBaRhYQBhYxZhcqRhbISBAYECgROBFGNsbmuBomFwggIDY3NlcYUWExcVFGJscoOCAAGBA4ECYXODggECgRSBE2FzBaRhYQBhYxdhcqRhbISBB4ESgROBFWNsbmuBomFwggIDY3NlcYUXExYUFWJscoSBAIEDgQGBAmFzhIEHgRWBEoETYXMFpGFhAGFjGBhhcqNhbISBCIEJgQqBGBlibHKCgwABAoEDYXOCgwgJCoEYGWFzBaRhYQBhYxgZYXKjYWyEgQuBDIEYGIEYGmJscoOCAAGBAoEDYXODggsMgRgYgRgaYXMFpGFhAWFjGBphcqNhbISBDoERgROBGBlibHKEgQCBA4ECgQFhc4SBDoEYGYETgRFhcwVhYw9hZ6JhRZgbgwARAIMBFgCDAhYAgwMVAIMEFQCDBRQAgwYUAIMHFwCDCBgYAIMJGBgAgwoYGACDCxgZAIMMGBkAgw0QAIMOGBoAgw8SAIMQEgCDERgaAIMSFwCDExYAgxMXAIMTGBoAgxQVAIMUFgCDFRcAgxgYGBkAgxgZGBoAYVqYGwEBAQEBAQEBAQEBAQEBAQgICAYHBgYGBgYGBmF2gwEBAA==", 4 | "masm_idx_map" : "[(0, 20), (0, 21), (0, 23), (0, 19), (0, 22), (0, 5), (0, 3), (0, 4), (0, 7), (0, 13), (0, 1), (0, 2), (0, 6), (0, 18), (0, 15), (0, 16), (0, 0), (0, 26), (0, 25), (0, 24), (0, 17), (0, 14), (0, 11), (0, 12), (0, 8), (0, 9), (0, 10)]" 5 | } 6 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/proline_acid_propanal_product.xyz: -------------------------------------------------------------------------------- 1 | 27 2 | 3 | C -1.6324883515 -1.6392612468 -1.2146109857 4 | C -2.1567298648 -0.2219571050 -0.9784273562 5 | C -1.3042471720 0.3269336757 0.1921456464 6 | N -0.1271412649 -0.5933918629 0.2966247921 7 | C -0.1593795296 -1.5628179606 -0.8188483797 8 | H -1.7702127462 -1.9695276900 -2.2463757670 9 | H -3.2252174754 -0.1979759386 -0.7521807203 10 | H -2.0040557642 0.3931072002 -1.8702061481 11 | H -0.9782431011 1.3603158203 -0.0157350662 12 | H -0.9703417710 -1.1092002682 1.9849582571 13 | H 0.2499088820 -2.5358480605 -0.5018159314 14 | H 0.4551797776 -1.2238973199 -1.6743724118 15 | H -2.1608650326 -2.3515444613 -0.5730264508 16 | C -2.0944377990 0.3405953998 1.5302322699 17 | O -3.0090919136 1.1068732558 1.7648343384 18 | O -1.6830603602 -0.6004963099 2.4214909449 19 | H 0.6621394052 0.3077813655 2.4769414374 20 | C 1.1867296016 0.0612016537 0.5843582723 21 | C 1.7196952592 0.9746212929 -0.5412291642 22 | C 3.0533625792 1.6079171745 -0.1681044329 23 | O 1.0363089382 0.8342638548 1.7607714860 24 | H 1.9228219696 -0.7663695646 0.7669455098 25 | H 1.8288052923 0.3901122374 -1.4607126386 26 | H 0.9883217670 1.7612512937 -0.7485897955 27 | H 2.9575620215 2.1768678397 0.7528097799 28 | H 3.8197059981 0.8495081537 -0.0159740601 29 | H 3.3949706544 2.2809375705 -0.9519034259 30 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/proline_propanal_adduct.json: -------------------------------------------------------------------------------- 1 | { 2 | "masm_decision_list" : "(170, 175, -179):(-63, -56, -52):(53, 58, 64):(-30, -24, -19)", 3 | "masm_cbor_graph" : "pGFhiaRhYQBhYw9hcqNhbIKBDoEXYmxygoEAgQFhc4KBDoEXYXMBpGFhAGFjEGFypGFsg4EVgRaBF2NsbmuBomFwggABY3NlcYUQFRIRFmJscoKCAAGBAmFzgoIVFoEXYXMDpGFhAGFjEWFypGFshIECgQOBEoEWY2xua4GiYXCCAgNjc2VxhRESFRAWYmxyg4IAAYECgQNhc4OCAgOBEoEWYXMFpGFhAGFjEmFypGFshIEAgQGBEYEVY2xua4GiYXCCAgNjc2VxhRIRFhAVYmxyg4IAAYECgQNhc4OCAAGBEYEVYXMFpGFhAGFjE2Fyo2FshIEIgQmBCoEUYmxygoMAAQKBA2FzgoMICQqBFGFzBaRhYQBhYxRhcqNhbISBC4EMgROBF2JscoOCAAGBAoEDYXODggsMgROBF2FzBaRhYQBhYxVhcqRhbISBBoEHgRCBEmNsbmuBomFwggIDY3NlcYUVEBYREmJscoOCAAGBA4ECYXODggYHgRKBEGFzBaRhYQBhYxZhcqRhbISBBIEFgRCBEWNsbmuBomFwggIDY3NlcYUWEBUSEWJscoOCAAGBA4ECYXODggQFgRGBEGFzBaRhYQBhYxdhcqNhbISBDYEPgRCBFGJscoSBAIEDgQKBAWFzhIENgRSBEIEPYXMFYWMPYWeiYUWYGIMAEgCDARIAgwIRAIMDEQCDBBYAgwUWAIMGFQCDBxUAgwgTAIMJEwCDChMAgwsUAIMMFACDDRcAgw4PAIMPFwCDEBUAgxAWAIMQFwCDERIAgxEWAIMSFQCDExQAgxQXAGFamBgBAQEBAQEBAQEBAQEBAQEIBwYGBgYGBgZhdoMBAQA=", 4 | "masm_idx_map" : "[(0, 19), (0, 20), (0, 23), (0, 15), (0, 16), (0, 22), (0, 17), (0, 18), (0, 21), (0, 8), (0, 9), (0, 10), (0, 11), (0, 12), (0, 13), (0, 14), (0, 4), (0, 5), (0, 2), (0, 3), (0, 0), (0, 1), (0, 6), (0, 7)]" 5 | } 6 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/proline_propanal_adduct.xyz: -------------------------------------------------------------------------------- 1 | 24 2 | 3 | C -5.8293345791 -2.0120117452 0.3240528736 4 | C -5.4247278937 -0.8213381790 -0.5374698060 5 | C -4.4205384916 0.1339776422 0.1368213286 6 | O -4.7516839158 1.4737234628 -0.1424171687 7 | N -3.0633108500 -0.1090466496 -0.3088153478 8 | C -2.0887421742 0.7907349271 0.2983628044 9 | C -0.7300704991 0.1828898474 -0.0606462283 10 | C -1.0396472856 -1.2945660973 -0.3595967098 11 | C -2.5318018472 -1.4376261360 -0.0507043689 12 | H -4.9755815936 -2.6391507098 0.5650481670 13 | H -6.5614270584 -2.6181339974 -0.2050480392 14 | H -6.2771110378 -1.6686162855 1.2544905883 15 | H -6.3198182315 -0.2333393683 -0.7560170549 16 | H -5.0043062854 -1.1589554256 -1.4863321854 17 | H -4.5099735609 0.0575603351 1.2401985199 18 | H -4.6157717037 1.6112529846 -1.0888742578 19 | H -2.2238683448 0.8252799650 1.3937646806 20 | H -2.2189490530 1.8014816264 -0.0887675191 21 | H -0.0247704104 0.2960975797 0.7611121603 22 | H -0.3116210702 0.6735548449 -0.9378692623 23 | H -0.4429636414 -1.9753757978 0.2448856740 24 | H -0.8551619404 -1.5166173499 -1.4097056538 25 | H -2.6791693207 -1.7262360707 1.0047925532 26 | H -3.0149331114 -2.1757712629 -0.6896217880 27 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/proline_propanal_complex.json: -------------------------------------------------------------------------------- 1 | { 2 | "masm_decision_list" : "(7, 12, 18, 1):(53, 58, 64, 1);(-1, 5, 10, 1):(0, 5, 11, 1)", 3 | "masm_cbor_graph" : "pGFhg6RhYQBhYwdhcqNhbIOBBYEGgQlibHKDgQCBAoEBYXODgQWBCYEGYXMCpGFhAGFjCGFyo2FshIECgQOBBIEJYmxygoMAAQKBA2FzgoMCAwSBCWFzBaRhYQBhYwlhcqNhbISBAIEBgQeBCGJscoOCAAGBA4ECYXODggABgQiBB2FzBWFjD2FnomFFiYMACQCDAQkAgwIIAIMDCACDBAgAgwUHAIMGBwCDBwkAgwgJAGFaigEBAQEBAQgGBgZhdoMBAQA=;pGFhh6RhYQBhYwphcqNhbIKBCIELYmxygoEAgQFhc4KBCIELYXMBpGFhAGFjC2Fyo2Fsg4EJgQqBEGJscoOBAoEBgQBhc4OBEIEKgQlhcwKkYWEAYWMMYXKkYWyDgQeBD4EQY2xua4GiYXCCAQJjc2VxhQwPDg0QYmxyg4EAgQGBAmFzg4EHgQ+BEGFzA6RhYQBhYw1hcqRhbISBA4EEgQ6BEGNsbmuBomFwggIDY3NlcYUNDg8MEGJscoOCAAGBAoEDYXODggMEgQ6BEGFzBaRhYQBhYw5hcqRhbISBAYECgQ2BD2NsbmuBomFwggIDY3NlcYUODRAMD2JscoOCAAGBAoEDYXODggECgQ2BD2FzBaRhYQBhYw9hcqRhbISBBYEGgQyBDmNsbmuBomFwggIDY3NlcYUPDBANDmJscoOCAAGBA4ECYXODggUGgQ6BDGFzBaRhYQBhYxBhcqRhbISBAIELgQyBDWNsbmuBomFwggIDY3NlcYUQDA8ODWJscoSBAIEDgQGBAmFzhIEAgQ2BC4EMYXMFYWMPYWeiYUWRgwAQAIMBDgCDAg4AgwMNAIMEDQCDBQ8AgwYPAIMHDACDCAoAgwkLAIMKCwCDCxAAgwwPAIMMEACDDQ4Agw0QAIMODwBhWpEBAQEBAQEBAQEICAYHBgYGBmF2gwEBAA==", 4 | "masm_idx_map" : "[(1, 14), (1, 13), (1, 16), (1, 12), (1, 15), (1, 1), (1, 3), (1, 4), (1, 0), (1, 7), (1, 5), (1, 6), (1, 2), (1, 11), (1, 9), (1, 10), (1, 8), (0, 7), (0, 9), (0, 8), (0, 6), (0, 5), (0, 0), (0, 1), (0, 2), (0, 3), (0, 4)]" 5 | } 6 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/proline_propanal_complex.xyz: -------------------------------------------------------------------------------- 1 | 27 2 | dftb3 optimized 3 | C -1.7528656449 -1.6343850932 -1.4625929304 4 | C -2.5551297064 -0.5219909283 -0.7776578264 5 | C -1.6261440807 0.0620189203 0.3200326663 6 | N -0.3582813155 -0.7391404532 0.2896865312 7 | C -0.2973894778 -1.3883750788 -1.0365483817 8 | H -1.8715139528 -1.6256813565 -2.5485230796 9 | H -3.4739266894 -0.9027748471 -0.3236626704 10 | H -2.8435022495 0.2567899347 -1.4884444952 11 | H -1.3807911182 1.1172150881 0.0907998821 12 | H -0.4140929805 -1.4664089786 1.0109512372 13 | H 0.2994260128 -2.3051204030 -0.9745285646 14 | H 0.2066986424 -0.7185526005 -1.7537587880 15 | H -2.0859376809 -2.6157422592 -1.1131007538 16 | C -2.2392470475 0.0050028944 1.7392037438 17 | O -3.3031256213 -0.5401320260 1.9840648620 18 | O -1.4967472648 0.5901409171 2.7058270947 19 | H -0.6945317206 1.0429437181 2.3503576521 20 | C 1.5174674665 1.0260388197 1.0123424269 21 | C 2.1852024651 1.3197896847 -0.3193423693 22 | C 3.6914451367 1.0850050946 -0.2779469168 23 | O 0.6761353448 1.7492520135 1.5126056046 24 | H 1.8939008713 0.1145577916 1.5632184759 25 | H 1.7374599511 0.6661444895 -1.0782281045 26 | H 1.9604482921 2.3460418173 -0.6195625964 27 | H 4.1690110240 1.7425397191 0.4451294450 28 | H 3.9195755240 0.0577696316 0.0009070148 29 | H 4.1364558201 1.2770534900 -1.2512291594 30 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/propanal.xyz: -------------------------------------------------------------------------------- 1 | 10 2 | dftb3 optimized 3 | C -0.0049753230 0.0056825497 1.0323108007 4 | C 0.0006423272 -1.2901746550 1.8365495365 5 | C -0.5797616718 -2.4717597899 1.0748009419 6 | O -0.4176856804 0.1162502803 -0.0918612112 7 | H 0.4252428055 0.8994999776 1.5887735686 8 | H 1.0324566405 -1.4972460612 2.1449496826 9 | H -0.5544162107 -1.1184683957 2.7666219215 10 | H -1.6109204922 -2.2758935128 0.7922537821 11 | H -0.0151981785 -2.6547497701 0.1641614146 12 | H -0.5557242167 -3.3748006229 1.6806695626 13 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/propionic_acid_conf_guesses/propionic-0.xyz: -------------------------------------------------------------------------------- 1 | 11 2 | 3 | C 1.4521521266 -0.1050015960 0.2957497510 4 | C 0.1200439139 0.5327736011 -0.4268696316 5 | C -1.1142426781 -0.5377321423 -0.2911984936 6 | O -1.4043703054 -1.4286210395 -1.2687930707 7 | O -1.9734304631 -0.5472832899 0.9348283025 8 | H 1.1364442556 -0.4232468120 1.4007384545 9 | H 2.3723653060 0.6165190254 0.3472623784 10 | H 1.7017219266 -1.1083797736 -0.2919866158 11 | H 0.2731670988 0.8326227476 -1.5438167528 12 | H -0.1585291390 1.4995103838 0.1743266929 13 | H -1.3309863263 -0.4772753602 1.7060113279 14 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/propionic_acid_conf_guesses/propionic-1.xyz: -------------------------------------------------------------------------------- 1 | 11 2 | 3 | C 1.5488714893 -0.0387804270 0.3798470629 4 | C 0.2390147518 -0.2463703888 -0.5954088876 5 | C -1.1696046434 0.0702836799 0.1872879083 6 | O -1.2238541413 0.9249504529 1.2432563214 7 | O -2.4595227168 -0.5613411033 -0.2062351931 8 | H 1.4084434525 -0.4097283530 1.4831613486 9 | H 2.5207430926 -0.5377093534 -0.1006353528 10 | H 1.7878665394 1.1168533639 0.4298341075 11 | H 0.1677928960 -1.3045917659 -1.0842285641 12 | H 0.3527443416 0.5340961462 -1.4743879271 13 | H -2.9589132303 -0.8808376399 0.6247379453 14 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/propionic_acid_conf_guesses/propionic-10.xyz: -------------------------------------------------------------------------------- 1 | 11 2 | 3 | C 1.4419260893 -0.2524386747 -0.2399846612 4 | C 0.1245316856 0.2764719799 0.6349747360 5 | C -1.2500312728 -0.3980555936 -0.0078395815 6 | O -1.2144118625 -1.6508912135 -0.5429255094 7 | O -2.5251185287 0.3916911771 0.0159415650 8 | H 1.5178189422 -1.4359412988 -0.2599899207 9 | H 2.4421090092 0.1768123420 0.1910964580 10 | H 1.2463425883 0.1565675846 -1.3428433669 11 | H 0.0211945487 1.4435932698 0.5668531980 12 | H 0.1906410510 0.0017231184 1.7734400718 13 | H -2.5266520692 0.7536224853 0.9715438799 14 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/propionic_acid_conf_guesses/propionic-11.xyz: -------------------------------------------------------------------------------- 1 | 11 2 | 3 | C 1.2854754197 -0.4069719572 -0.0404441545 4 | C 0.1610668230 0.7797503467 0.2314058183 5 | C -1.3582019092 0.3517968449 -0.2309285224 6 | O -2.2791109265 1.2726467040 -0.6183207104 7 | O -1.8045967687 -1.0518149559 -0.2528923640 8 | H 0.9913016076 -1.3702304253 0.5606724729 9 | H 2.3225439319 -0.0181174450 0.3620199890 10 | H 1.3980802407 -0.6355868178 -1.1921164493 11 | H 0.4630882534 1.8024908421 -0.2649190227 12 | H 0.1431780925 0.9696188558 1.4020853665 13 | H -1.1265039011 -1.6617004818 -0.6675162069 14 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/propionic_acid_conf_guesses/propionic-2.xyz: -------------------------------------------------------------------------------- 1 | 11 2 | 3 | C 1.3105263083 -0.1486812613 0.1403791283 4 | C 0.0372513243 0.7983289749 -0.3083699717 5 | C -1.3380066095 0.0662322087 0.2116659052 6 | O -2.4699678398 0.7757633099 0.4753445748 7 | O -1.4788175093 -1.4106084917 0.4410068506 8 | H 1.1004366360 -0.4672996487 1.2694811298 9 | H 2.2986656687 0.5006698152 0.1275826764 10 | H 1.3879873028 -1.1166019952 -0.5411254442 11 | H -0.0465785061 0.9302587646 -1.4891965291 12 | H 0.0626771793 1.8814514697 0.1351656224 13 | H -1.0583047590 -1.8770656644 -0.3436925227 14 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/propionic_acid_conf_guesses/propionic-3.xyz: -------------------------------------------------------------------------------- 1 | 11 2 | 3 | C 1.5087322394 0.2261127864 -0.0798943392 4 | C 0.0919697062 -0.4800048196 0.3890220387 5 | C -1.1756397812 0.5088096024 0.0514719802 6 | O -1.1175115216 1.8696310270 0.0300117757 7 | O -2.5355351245 -0.0393865000 -0.2711350544 8 | H 1.8174662018 -0.3068101560 -1.1008599374 9 | H 1.4103363424 1.3710330417 -0.3432659315 10 | H 2.3448395599 0.1019268350 0.7303491927 11 | H 0.0589085304 -0.7592478757 1.5278296033 12 | H -0.0839301295 -1.4986277971 -0.2110523484 13 | H -2.4065892828 -0.7945121589 -0.9210325113 14 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/propionic_acid_conf_guesses/propionic-4.xyz: -------------------------------------------------------------------------------- 1 | 11 2 | 3 | C 1.4644470057 -0.3931352516 0.2275682684 4 | C 0.3084172273 0.6021818876 -0.4482447337 5 | C -1.1720078046 0.2477401898 0.1861855106 6 | O -1.5602833857 0.9230866456 1.2906304850 7 | O -2.0289266515 -0.7897700650 -0.4775702287 8 | H 2.5256624712 0.1014559555 0.2238626510 9 | H 1.4392301780 -1.4346564494 -0.3547947627 10 | H 1.0568599261 -0.6340218462 1.3083555788 11 | H 0.2546251204 0.4630929077 -1.6363068254 12 | H 0.5905974541 1.7403165808 -0.2264376013 13 | H -2.3920601788 -1.3824645213 0.2494319221 14 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/propionic_acid_conf_guesses/propionic-5.xyz: -------------------------------------------------------------------------------- 1 | 11 2 | 3 | C 1.4137237194 0.5438275385 0.0597334869 4 | C 0.3398917041 -0.6972536507 -0.1246740677 5 | C -1.1734920081 -0.1959070976 0.3784057698 6 | O -1.3276284211 0.7475993348 1.3410687674 7 | O -2.3976506785 -0.7986592322 -0.2450032697 8 | H 2.5133876889 0.1393551074 0.0132663407 9 | H 1.2597774920 1.2376604800 -0.8992311070 10 | H 1.2250748483 1.2113763715 1.0022837612 11 | H 0.6239053499 -1.6701620622 0.4701128936 12 | H 0.2790972543 -1.0274926421 -1.2678610819 13 | H -3.0362565515 -1.0131052646 0.5225580811 14 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/propionic_acid_conf_guesses/propionic-6.xyz: -------------------------------------------------------------------------------- 1 | 11 2 | 3 | C 1.4326450264 0.3162556319 -0.0983762903 4 | C 0.2524719230 -0.6835290785 0.4285445208 5 | C -1.1930822883 -0.2161416298 -0.2695858659 6 | O -2.1621135524 -1.1330098974 -0.5412381723 7 | O -1.4595705656 1.2231020876 -0.6081777571 8 | H 1.0438072359 1.4335879363 0.0006480521 9 | H 1.5518233034 0.1349039767 -1.2712633491 10 | H 2.4625547485 0.1480333478 0.4321333267 11 | H 0.1016149412 -0.7029731713 1.6004013612 12 | H 0.5001691613 -1.8006317403 0.0955212768 13 | H -1.8324298497 1.2794529889 -1.5465351872 14 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/propionic_acid_conf_guesses/propionic-7.xyz: -------------------------------------------------------------------------------- 1 | 11 2 | 3 | C 1.3213365328 -0.3947957973 -0.1956019534 4 | C 0.3082225728 0.8649952291 0.1207742302 5 | C -1.2386144877 0.2855143599 -0.0985838100 6 | O -2.2793493040 1.0787528725 -0.4578357849 7 | O -1.5967187963 -1.1597427299 0.0806610511 8 | H 2.4035350401 -0.0181299183 -0.4730142154 9 | H 0.9537929685 -1.0797378039 -1.0706936144 10 | H 1.3433157168 -1.0818134714 0.7753528119 11 | H 0.4701569128 1.8069828552 -0.5418071106 12 | H 0.3811206156 1.1660754002 1.2560058409 13 | H -2.4682000629 -1.2185041161 0.6113009445 14 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/propionic_acid_conf_guesses/propionic-8.xyz: -------------------------------------------------------------------------------- 1 | 11 2 | 3 | C 1.4536172618 0.1957564840 0.2555807963 4 | C 0.2092900258 -0.4935286906 -0.5498265199 5 | C -1.2684602182 -0.2485514158 0.1164528515 6 | O -1.8196872946 -1.0847794045 1.0162621766 7 | O -2.0463807308 0.9381661074 -0.3209910790 8 | H 1.1818879782 1.1681226206 0.8594326184 9 | H 1.9132334133 -0.5817727388 1.0142782007 10 | H 2.3066596734 0.4393500858 -0.5545791178 11 | H 0.3896682568 -1.6657134251 -0.5591944937 12 | H 0.1950989884 -0.0509336751 -1.6338712095 13 | H -3.0148781772 0.6833963658 -0.4975485077 14 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/propionic_acid_conf_guesses/propionic-9.xyz: -------------------------------------------------------------------------------- 1 | 11 2 | 3 | C 1.3639468130 0.1806851942 0.4324260971 4 | C 0.1038322608 -0.7005820581 -0.2440672943 5 | C -1.0558015411 0.4151791072 -0.5937283372 6 | O -1.0726560707 1.0611712320 -1.7889099606 7 | O -2.1060249484 0.7486989962 0.3957059387 8 | H 1.6760671615 -0.2221627553 1.4888830814 9 | H 1.0529451682 1.3318629683 0.4486476966 10 | H 2.2581023230 0.0679240246 -0.3284407128 11 | H -0.3349305792 -1.4910648160 0.4909904553 12 | H 0.4831448586 -1.2547512462 -1.2042042781 13 | H -2.4675870302 -0.0823597819 0.8230081843 14 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/propionic_acid_conf_optimized/propionic-0.xyz: -------------------------------------------------------------------------------- 1 | 11 2 | Coordinates from ORCA-job orca 3 | C 1.25768425020984 -0.03534263092812 0.47289081430729 4 | C 0.11193593131587 0.39054027095985 -0.44449328740831 5 | C -1.18273416812286 -0.41002300861309 -0.35895298787414 6 | O -1.99874920396428 -0.45287658893892 -1.24793753971633 7 | O -1.41585858248218 -1.07612391543809 0.81313122487207 8 | H 1.01609537614781 0.10018557240262 1.54089475078816 9 | H 2.14923981368160 0.57755806630307 0.28374107674413 10 | H 1.53980485828578 -1.08584761686782 0.31184572758896 11 | H 0.41698175417977 0.35731588469302 -1.49952406160331 12 | H -0.16604604177026 1.43967606414368 -0.24649271904842 13 | H -0.65401827188109 -0.95117635331619 1.41114934404990 14 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/propionic_acid_conf_optimized/propionic-1.xyz: -------------------------------------------------------------------------------- 1 | 11 2 | Coordinates from ORCA-job orca 3 | C 1.48091748399130 0.05885246071822 0.30105282830455 4 | C 0.21449102812959 -0.35286993780671 -0.43815481404482 5 | C -1.04719771652836 -0.05554855414420 0.33724123423359 6 | O -1.11071310255105 0.46477201708676 1.43200453420920 7 | O -2.15841333817860 -0.44988373002306 -0.35312916559236 8 | H 1.56547112392498 -0.46725238581687 1.26020442779703 9 | H 2.36940700368777 -0.17310617304791 -0.30196337746279 10 | H 1.47850912363275 1.13501408260858 0.51695724970346 11 | H 0.21135007433126 -1.42947631349604 -0.67312412238638 12 | H 0.12948996970715 0.15487219122389 -1.41234000931162 13 | H -2.91972981874679 -0.21854904570265 0.21847998385014 14 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/propionic_acid_conf_optimized/propionic-10.xyz: -------------------------------------------------------------------------------- 1 | 11 2 | Coordinates from ORCA-job orca 3 | C 1.34075261426957 -0.25689955512654 -0.16325667000518 4 | C 0.05932547848131 0.27207036624758 0.46814548468376 5 | C -1.19318671749330 -0.39546516397807 -0.08116790384514 6 | O -1.20777552177824 -1.25960884253871 -0.92330543550382 7 | O -2.37321561058033 0.05332945662758 0.45402050264714 8 | H 1.43931668315688 -1.33741481354025 0.00367243415644 9 | H 2.21874200929981 0.24521272912135 0.26408931911577 10 | H 1.33699191015492 -0.09219613915328 -1.24866739728561 11 | H -0.03738663002275 1.36090683046463 0.30959666883391 12 | H 0.07022425319403 0.12604021359384 1.56307629760096 13 | H -2.18543828758191 0.74718009478188 1.11406356860177 14 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/propionic_acid_conf_optimized/propionic-11.xyz: -------------------------------------------------------------------------------- 1 | 11 2 | Coordinates from ORCA-job orca 3 | C 1.17901686315853 -0.38310887175325 -0.07676426490950 4 | C 0.11098892928148 0.67264930848226 0.21404915858305 5 | C -1.29376830827578 0.39187875972380 -0.30643715185189 6 | O -2.09480023928977 1.25581294558210 -0.57107676981684 7 | O -1.64381330828948 -0.92465604703189 -0.43754672799382 8 | H 0.98036110932237 -1.33903656125090 0.43642125099818 9 | H 2.15972438033693 -0.04440252263355 0.28351506312003 10 | H 1.26979468620204 -0.58355208047191 -1.15351642680244 11 | H 0.39685958637592 1.64754840744416 -0.20175619450915 12 | H 0.01199467231528 0.82375335936014 1.30230583965341 13 | H -0.88003750783752 -1.48500518695095 -0.20014755997103 14 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/propionic_acid_conf_optimized/propionic-2.xyz: -------------------------------------------------------------------------------- 1 | 11 2 | Coordinates from ORCA-job orca 3 | C 1.18898595944369 -0.17457637899992 0.11311045551910 4 | C -0.02936284417228 0.69099874664433 -0.21114773908524 5 | C -1.40123912990632 0.11104929108095 0.11390068758966 6 | O -2.38692622677957 0.78802809784066 0.28252485400412 7 | O -1.49083620379824 -1.25258782010725 0.18132644532882 8 | H 1.21223987827843 -0.46464047706011 1.17301535874696 9 | H 2.11611480496923 0.37525241817015 -0.09995667413488 10 | H 1.23180286533044 -1.09042737287353 -0.49905922177563 11 | H -0.04840563572469 0.93657143130346 -1.28597868702873 12 | H 0.02022902262616 1.65326314493185 0.31502183465011 13 | H -0.60673329456684 -1.64048359923058 0.03548410598571 14 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/propionic_acid_conf_optimized/propionic-3.xyz: -------------------------------------------------------------------------------- 1 | 11 2 | Coordinates from ORCA-job orca 3 | C 1.41691386703550 0.23270527045143 0.02504964874437 4 | C 0.03736849136233 -0.39750688419056 0.16902901641220 5 | C -1.08229953687151 0.50365600914488 -0.33143761982369 6 | O -0.93202599240497 1.60817040310052 -0.79363847200592 7 | O -2.34390704335529 -0.02406492465646 -0.22671188930066 8 | H 1.62873589855125 0.46755205668254 -1.02567402927745 9 | H 1.47542029382806 1.17181355169232 0.58893160000515 10 | H 2.19488847424270 -0.44815134454270 0.39591750202153 11 | H -0.17415027460980 -0.64694558173507 1.22356028380080 12 | H -0.01868282439427 -1.35061598122928 -0.38473608022672 13 | H -2.28921461288400 -0.91768858951764 0.16115450805038 14 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/propionic_acid_conf_optimized/propionic-4.xyz: -------------------------------------------------------------------------------- 1 | 11 2 | Coordinates from ORCA-job orca 3 | C 1.37752140719071 -0.35698161743375 0.21825175187962 4 | C 0.26977073583055 0.54364386678712 -0.34939441800140 5 | C -1.07370592529947 0.16483503871967 0.22512246951384 6 | O -1.56912289894717 0.62408405426689 1.23407664049161 7 | O -1.68006729042831 -0.81618648173493 -0.50837423615004 8 | H 2.35437099125894 -0.05498316132917 -0.18242941130544 9 | H 1.20932876183926 -1.40922361429407 -0.05017578489901 10 | H 1.41862840659842 -0.28044551365868 1.31369427355576 11 | H 0.23743714516330 0.46042975632426 -1.44509034859361 12 | H 0.45557968124912 1.59106860915039 -0.07785564821537 13 | H -2.51317965225535 -1.02241490329773 -0.03514502417598 14 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/propionic_acid_conf_optimized/propionic-5.xyz: -------------------------------------------------------------------------------- 1 | 11 2 | Coordinates from ORCA-job orca 3 | C 1.32697408647824 0.48171258473277 0.06941837779032 4 | C 0.27685084894140 -0.60570351155329 -0.11247602830442 5 | C -1.10551457336815 -0.17184365761756 0.31380007990365 6 | O -1.40919620645637 0.91431248980738 0.76283383541926 7 | O -2.01843203981297 -1.17238721029644 0.13444096732505 8 | H 2.31328048148920 0.12000693338257 -0.25101546571637 9 | H 1.07789390743837 1.37375296909295 -0.51973369701205 10 | H 1.39559645547756 0.79184905174321 1.11989528860637 11 | H 0.52770810736089 -1.51400741555584 0.45918224723927 12 | H 0.20966694386391 -0.93583331536663 -1.16161920221525 13 | H -2.87499761371208 -0.80462003556912 0.43593317136417 14 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/propionic_acid_conf_optimized/propionic-6.xyz: -------------------------------------------------------------------------------- 1 | 11 2 | Coordinates from ORCA-job orca 3 | C 1.41977989624674 0.20402786725125 -0.17547482813432 4 | C 0.17499912917139 -0.49936708820927 0.38746937725539 5 | C -1.04087546319782 -0.23516157224938 -0.46712447026592 6 | O -1.52853039434719 -1.00228193887771 -1.27206503981731 7 | O -1.54023678853014 1.01988453508963 -0.25665660624274 8 | H 1.28137270568703 1.29346216822169 -0.19654630478727 9 | H 1.63275283939075 -0.13816292058973 -1.19745304420585 10 | H 2.29605078180673 -0.01965329300674 0.44776731509107 11 | H -0.02332945252638 -0.14537111300416 1.40993163440678 12 | H 0.32363815945426 -1.58634514963180 0.41416367864672 13 | H -2.29773132945536 1.10801895690622 -0.87193979624656 14 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/propionic_acid_conf_optimized/propionic-7.xyz: -------------------------------------------------------------------------------- 1 | 11 2 | Coordinates from ORCA-job orca 3 | C 1.25349346704586 -0.34192342869615 -0.29752222623678 4 | C 0.22788105767999 0.70242217581641 0.17082631100933 5 | C -1.18191778000944 0.21580131756396 -0.05918103982832 6 | O -1.88480722262911 0.49129394902524 -1.01015045084334 7 | O -1.59030085592757 -0.63338395257616 0.93129136151718 8 | H 2.27463915842538 0.03417392540495 -0.14685211466350 9 | H 1.12574047894094 -0.56267697490690 -1.36618686338632 10 | H 1.14741535720923 -1.27888134488121 0.26506771677116 11 | H 0.34591225383339 1.63571845059090 -0.39348782766299 12 | H 0.36916197720908 0.91400861092516 1.24035103856150 13 | H -2.48862018327776 -0.92695584826621 0.67240248466210 14 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/propionic_acid_conf_optimized/propionic-8.xyz: -------------------------------------------------------------------------------- 1 | 11 2 | Coordinates from ORCA-job orca 3 | C 1.26926471155224 0.21733998778141 0.22053633882332 4 | C 0.20619450745453 -0.49534741242358 -0.63042933090526 5 | C -1.15645940465519 -0.38030908041505 0.00785915171687 6 | O -1.65991695064674 -1.18869665462949 0.76099660119045 7 | O -1.77387327475130 0.79265484560136 -0.32646661485743 8 | H 1.05363795387377 1.29136970424220 0.30275208684380 9 | H 1.30631807640828 -0.20736366878718 1.23273858328277 10 | H 2.26158202467483 0.10144735195917 -0.23619157496304 11 | H 0.43865829161509 -1.56496141282453 -0.71278057715025 12 | H 0.17581081179020 -0.05983865991167 -1.63883193556016 13 | H -2.62116757041573 0.79321731310737 0.16581298747894 14 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/propionic_acid_conf_optimized/propionic-9.xyz: -------------------------------------------------------------------------------- 1 | 11 2 | Coordinates from ORCA-job orca 3 | C 1.02710782875488 0.06807125906902 0.64047457402441 4 | C 0.08598535985120 -0.64205401110458 -0.33334293373713 5 | C -1.11392103628685 0.15005559208049 -0.83991432941390 6 | O -1.67652258838223 -0.08440715280876 -1.88233949114245 7 | O -1.57153353258000 1.15187046103902 -0.02814081349425 8 | H 1.87960325633566 -0.57780626276257 0.89035593668266 9 | H 0.53855182583720 0.31113936364637 1.59906751379528 10 | H 1.42902654166485 0.99727287503998 0.21303204950314 11 | H -0.32452290532700 -1.55452367314261 0.13091161845102 12 | H 0.62470630437883 -0.97861909180088 -1.22909917985748 13 | H -0.99744263874654 1.21360150574453 0.75930592558869 14 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/substrate.json: -------------------------------------------------------------------------------- 1 | { 2 | "masm_decision_list" : "(174, 180, -175, 1):(-65, -59, -54, 1)", 3 | "masm_cbor_graph" : "pWFhjKRhYQBhYwphcqNhbIKBFIEVYmxygoEBgQBhc4KBFYEUYXMBpGFhAGFjC2FypGFsg4ECgQyBDmNsbmuBomFwggECY3NlcYYLDA0PEA5ibHKDgQCBAYECYXODgQKBDIEOYXMCpGFhAGFjDGFypGFsg4EBgQuBDWNsbmuBomFwggECY3NlcYYMCw4QDw1ibHKDgQCBAYECYXODgQGBC4ENYXMCpGFhAGFjDWFypGFsg4EDgQyBD2NsbmuBomFwggECY3NlcYYNDAsOEA9ibHKDgQCBAYECYXODgQOBDIEPYXMCpGFhAGFjDmFypGFsg4EAgQuBEGNsbmuBomFwggECY3NlcYYOCwwNDxBibHKDgQCBAYECYXODgQCBC4EQYXMCpGFhAGFjD2FypGFsg4ENgRCBEWNsbmuComFwggABY3NlcYYPDQwLDhCiYXCCAQJjc2Vxhg8QExQSEWJscoOBAIECgQFhc4OBDYERgRBhcwKkYWEAYWMQYXKkYWyDgQ6BD4ETY2xua4KiYXCCAAFjc2VxhhAOCwwND6JhcIIBAmNzZXGGEA8REhQTYmxyg4EAgQKBAWFzg4EOgROBD2FzAqRhYQBhYxFhcqRhbIOBBIEPgRJjbG5rgaJhcIIBAmNzZXGGEQ8QExQSYmxyg4EAgQKBAWFzg4EEgRKBD2FzAqRhYQBhYxJhcqRhbIOBBoERgRRjbG5rgaJhcIIBAmNzZXGGEhEPEBMUYmxyg4EAgQGBAmFzg4EGgRGBFGFzAqRhYQBhYxNhcqRhbIOBBYEQgRRjbG5rgaJhcIIBAmNzZXGGExAPERIUYmxyg4EAgQGBAmFzg4EFgRCBFGFzAqRhYQBhYxRhcqRhbIOBCoESgRNjbG5rgaJhcIIBAmNzZXGGFBIRDxATYmxyg4EBgQKBAGFzg4ESgROBCmFzAqRhYQBhYxVhcqNhbISBB4EIgQmBCmJscoKDAAECgQNhc4KDBwgJgQphcwVhYouiYWEAYWWCCwyiYWEAYWWCCw6iYWEAYWWCDA2iYWEAYWWCDQ+iYWEAYWWCDhCiYWEAYWWCDxCiYWEAYWWCDxGiYWEAYWWCEBOiYWEAYWWCERKiYWEAYWWCEhSiYWEAYWWCExRhYw9hZ6JhRZeDAA4AgwEMAIMCCwCDAw0AgwQRAIMFEwCDBhIAgwcVAIMIFQCDCRUAgwoUAIMKFQCDCwwAgwsOAIMMDQCDDQ8Agw4QAIMPEACDDxEAgxATAIMREgCDEhQAgxMUAGFalgEBAQEBAQEBAQEIBgYGBgYGBgYGBgZhdoMBAQA=", 4 | "masm_idx_map" : "[(0, 7), (0, 8), (0, 9), (0, 4), (0, 2), (0, 1), (0, 3), (0, 5), (0, 0), (0, 6), (0, 10), (0, 21), (0, 12), (0, 13), (0, 15), (0, 19), (0, 20), (0, 11), (0, 16), (0, 18), (0, 14), (0, 17)]" 5 | } 6 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/substrate.xyz: -------------------------------------------------------------------------------- 1 | 22 2 | Coordinates from ORCA-job orca 3 | H 1.01651619423815 4.52610000989887 1.59805537975501 4 | H -0.77992655634178 4.36143630970122 1.48702169025971 5 | H 0.19046882695673 3.11283097725089 2.36224069627079 6 | H -0.82526760834789 0.04566077090765 -2.79265615560337 7 | H -5.40273870695444 -0.90215001460314 0.95114769722401 8 | H -4.89878566874220 -2.03244610498187 -1.23590183251988 9 | H -2.87378945627422 -1.37056248437407 -2.54697362666818 10 | H -1.86402584960341 2.28012892609168 1.59022447345176 11 | H -3.89259518156419 0.87454266884219 1.82940478128393 12 | H 0.68639938237720 1.83377926550083 -1.89646012195524 13 | O 0.39958193357515 3.11751154524771 0.26928066579716 14 | C 0.18385082697028 3.80618678241778 1.49214716325413 15 | C -4.22538711588030 -1.24749909776881 -0.85847912512264 16 | C -3.10060019082534 -0.88105465694818 -1.58668963108175 17 | C -2.21885203006386 0.13247929080451 -1.11073961540981 18 | C -1.62676901803818 1.80006372454483 0.63104441302435 19 | C -0.49834992770632 2.16441037343715 -0.10220278889829 20 | C -4.50935674540477 -0.60814585123296 0.37856572407924 21 | C -2.50473505456496 0.78338114529114 0.14592779536385 22 | C -0.21366199414497 1.51985732430606 -1.34706747122877 23 | C -3.66926323534768 0.38323634229521 0.86907688370619 24 | C -1.05192982431298 0.53480275347131 -1.83226599488221 25 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/substructures/ph.json: -------------------------------------------------------------------------------- 1 | [5, 6, 7, 8, 9, 10] -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/substructures/ph.xyz: -------------------------------------------------------------------------------- 1 | 11 2 | 3 | H 2.08390598 -5.02152387 6.55384416 4 | H -0.33869468 -4.33353173 7.01346512 5 | H 2.88147854 -5.25689553 4.25992768 6 | H -1.15220847 -4.56862676 2.79442631 7 | H -1.91113585 -4.16327554 5.17221873 8 | C 1.41196985 -4.85757744 5.71587622 9 | C 1.84559482 -4.98923916 4.44138418 10 | C -0.00320713 -4.51107096 5.99392759 11 | C 0.88481259 -4.83088806 3.30483045 12 | C -0.41373503 -4.60279435 3.58580963 13 | C -0.87356748 -4.41848589 4.98033244 14 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/test.rtdb.pickle.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qcscine/chemoton/19719b640fb77bd24cabd998043f77064d611c6e/scine_chemoton/tests/resources/test.rtdb.pickle.obj -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/water.json: -------------------------------------------------------------------------------- 1 | {"masm_cbor_graph": "pGFhgaRhYQBhYwJhcqNhbIKBAIEBYmxygYIAAWFzgYIAAWFzAWFjD2FnomFFgoMAAgCDAQIAYVqDAQEIYXaDAQAA", "masm_decision_list": "", "masm_idx_map": "[(0, 0), (0, 1), (0, 2)]"} 2 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/water.xyz: -------------------------------------------------------------------------------- 1 | 3 2 | 3 | H -0.8270665506 0.1962225201 -0.0000000089 4 | H 0.8294485777 0.1945368138 -0.0000000089 5 | O -0.0023820272 -0.3907593339 -0.0000000089 6 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/water_rc.xyz: -------------------------------------------------------------------------------- 1 | 6 2 | 3 | H -1.0900000000 0.8282575650 0.0008419959 4 | H -1.0900000000 -0.8282575650 -0.0008419959 5 | O -1.6761420299 0.0029759633 0.0005994967 6 | H 1.0900000000 0.8240356678 0.0835255720 7 | H 1.0900000000 -0.8240356678 -0.0835255720 8 | O 1.6761420299 0.0030215482 -0.0002932585 9 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/zwitter_ion.json: -------------------------------------------------------------------------------- 1 | { 2 | "masm_decision_list" : "(-46, -40, -35):(16, 21, 27):(43, 49, 54):(167, 172, 178):(-63, -57, -52)", 3 | "masm_cbor_graph" : "pGFhiqRhYQBhYxFhcqNhbIKBDoEYGmJscoKBAIEBYXOCgQ6BGBphcwGkYWEAYWMSYXKjYWyDgQ+BEIEWYmxygoECggABYXOCgRaCDxBhcwKkYWEAYWMTYXKkYWyEgQSBBYEUgRVjbG5rgaJhcIICA2NzZXGFExQWGBkVYmxyg4IAAYECgQNhc4OCBAWBFIEVYXMFpGFhAGFjFGFypGFshIECgQOBE4EWY2xua4GiYXCCAgNjc2VxhRQTFRgZFmJscoOCAAGBAoEDYXODggIDgROBFmFzBaRhYQBhYxVhcqRhbISBAIEBgROBGBljbG5rgaJhcIICA2NzZXGFFRMUFhgZYmxyg4IAAYECgQNhc4OCAAGBE4EYGWFzBaRhYQBhYxZhcqRhbISBBoESgRSBGBljbG5rgaJhcIICA2NzZXGFFhQTFRgZYmxyhIEAgQKBAYEDYXOEgQaBFIESgRgZYXMFpGFhAGFjF2Fyo2FshIEIgQmBCoEYGGJscoKDAAECgQNhc4KDCAkKgRgYYXMFpGFhAGFjGBhhcqNhbISBC4EMgReBGBpibHKDggABgQKBA2Fzg4ILDIEXgRgaYXMFpGFhAGFjGBlhcqRhbISBB4EVgRaBGBpjbG5rgaJhcIIBAmNzZXGFGBkVExQWYmxyhIEAgQGBAoEDYXOEgQeBFYEWgRgaYXMFpGFhAWFjGBphcqNhbISBDYERgRgYgRgZYmxyhIEAgQKBA4EBYXOEgQ2BGBiBGBmBEWFzBWFjD2FnomFFmBuDABUAgwEVAIMCFACDAxQAgwQTAIMFEwCDBhYAgwcYGQCDCBcAgwkXAIMKFwCDCxgYAIMMGBgAgw0YGgCDDhEAgw8SAIMQEgCDERgaAIMSFgCDExQAgxMVAIMUFgCDFRgZAIMWGBkAgxcYGACDGBgYGgCDGBkYGgBhWpgbAQEBAQEBAQEBAQEBAQEBCAgIBgYGBgYGBgcGYXaDAQEA", 4 | "masm_idx_map" : "[(0, 19), (0, 20), (0, 22), (0, 25), (0, 21), (0, 4), (0, 2), (0, 3), (0, 6), (0, 7), (0, 0), (0, 1), (0, 5), (0, 18), (0, 15), (0, 16), (0, 14), (0, 26), (0, 24), (0, 23), (0, 17), (0, 13), (0, 11), (0, 12), (0, 8), (0, 9), (0, 10)]" 5 | } 6 | -------------------------------------------------------------------------------- /scine_chemoton/tests/resources/zwitter_ion.xyz: -------------------------------------------------------------------------------- 1 | 27 2 | 3 | C -1.5653172983 -0.9031915634 1.6312458645 4 | C -2.3476243908 0.1953949448 0.9067800220 5 | C -1.4300038893 0.6810335980 -0.2179556514 6 | N -0.1623501308 -0.1132886505 -0.0686814425 7 | C -0.1227674132 -0.5066664689 1.3557760100 8 | H -1.7799187042 -1.8838110486 1.2036058856 9 | H -2.5236722703 1.0403046256 1.5774224259 10 | H -3.3060542221 -0.1523221244 0.5286993582 11 | H -1.8350293669 0.5134333415 -1.2182891085 12 | H -0.2675377675 -0.9616943110 -0.6408125007 13 | H 0.1494458345 0.3752355061 1.9391957122 14 | H 0.5946437467 -1.3070593374 1.5245139537 15 | H -1.7857714350 -0.9311196374 2.6945600793 16 | C -1.1387711738 2.2632398529 -0.1162260187 17 | O -1.3086464236 2.7897521767 0.9774358626 18 | O -0.7661850096 2.7745939700 -1.1912653896 19 | H 0.2490609699 1.6902505118 -1.9310432476 20 | C 1.0843691236 0.5694792271 -0.6098501483 21 | C 2.2928891977 -0.3662853769 -0.5105607032 22 | C 2.0808997123 -1.6949367945 -1.2328337045 23 | O 0.8560641696 0.8997528948 -1.9219000911 24 | H 1.2327140961 1.4572859092 0.0247705521 25 | H 3.1152173361 0.1685781243 -0.9872820490 26 | H 2.5578563847 -0.5226595234 0.5344790777 27 | H 1.3935371902 -2.3481872702 -0.6987998609 28 | H 1.7030363819 -1.5105556794 -2.2355450828 29 | H 3.0299153518 -2.2165568969 -1.3174398048 30 | -------------------------------------------------------------------------------- /scine_chemoton/tests/steering_wheel/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | -------------------------------------------------------------------------------- /scine_chemoton/tests/steering_wheel/test_basic_enhancements.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | # Standard library imports 9 | import unittest 10 | 11 | # Third party imports 12 | import scine_utilities as utils 13 | from scine_database import test_database_setup as db_setup 14 | import scine_database as db 15 | 16 | # Local application imports 17 | from scine_chemoton.gears.compound import BasicAggregateHousekeeping 18 | from scine_chemoton.gears.thermo import BasicThermoDataCompletion 19 | from scine_chemoton.steering_wheel.datastructures import Status, GearOptions, ProtocolEntry 20 | from scine_chemoton.steering_wheel.network_expansions import GiveWholeDatabaseWithModelResult 21 | from scine_chemoton.steering_wheel.network_expansions.basics import SimpleOptimization, ThermochemistryGeneration 22 | 23 | 24 | class BasicEnhancementsTests(unittest.TestCase): 25 | 26 | def setUp(self) -> None: 27 | self.manager = db_setup.get_clean_db(f"chemoton_{self.__class__.__name__}") 28 | self.model = db_setup.get_fake_model() 29 | self.credentials = self.manager.get_credentials() 30 | 31 | def tearDown(self) -> None: 32 | self.manager.wipe() 33 | 34 | def test_standard_inits(self): 35 | for cls in [GiveWholeDatabaseWithModelResult, SimpleOptimization, ThermochemistryGeneration]: 36 | inst = cls(self.model) 37 | assert inst.options.model == self.model 38 | assert inst.status == Status.WAITING 39 | assert not inst.protocol 40 | inst.dry_setup_protocol(self.credentials) 41 | assert inst.protocol 42 | 43 | def test_gear_options(self): 44 | dummy_opt = SimpleOptimization(self.model) 45 | dummy_opt.dry_setup_protocol(self.credentials) 46 | assert dummy_opt.protocol 47 | gears = [p.gear for p in dummy_opt.protocol if isinstance(p, ProtocolEntry)] 48 | for gear in gears: 49 | if isinstance(gear, BasicAggregateHousekeeping): 50 | gear.options.bond_order_job = db.Job("test_job") 51 | options = GearOptions([(g, None) for g in gears], self.model) 52 | options[("ChemotonBasicAggregateHousekeepingGear", None)][0].bond_order_settings = \ 53 | utils.ValueCollection({'only_distance_connectivity': True}) 54 | opt = SimpleOptimization(self.model, include_thermochemistry=True, gear_options=options) 55 | opt.dry_setup_protocol(self.credentials) 56 | assert opt.protocol 57 | assert any(isinstance(p.gear, BasicAggregateHousekeeping) for p in opt.protocol if isinstance(p, ProtocolEntry)) 58 | for p in opt.protocol: 59 | if isinstance(p, ProtocolEntry) and isinstance(p.gear, BasicAggregateHousekeeping): 60 | assert p.gear.options.bond_order_job 61 | assert p.gear.options.bond_order_job == db.Job("test_job") 62 | assert p.gear.options.bond_order_settings 63 | assert p.gear.options.bond_order_settings['only_distance_connectivity'] 64 | assert any(isinstance(p.gear, BasicThermoDataCompletion) for p in opt.protocol if isinstance(p, ProtocolEntry)) 65 | -------------------------------------------------------------------------------- /scine_chemoton/tests/steering_wheel/test_organometallic_complexes_selection.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | # Standard library imports 9 | from json import load 10 | import os 11 | import unittest 12 | 13 | # Third party imports 14 | import scine_database as db 15 | from scine_database import test_database_setup as db_setup 16 | 17 | # Local application tests imports 18 | from ..resources import resources_root_path 19 | 20 | # Local application imports 21 | from scine_chemoton.steering_wheel.selections.organometallic_complexes import CentralMetalSelection 22 | from scine_chemoton.utilities import connect_to_db 23 | from scine_chemoton.filters.aggregate_filters import CatalystFilter 24 | from scine_chemoton.filters.reactive_site_filters import CentralSiteFilter 25 | 26 | 27 | class OrganometallicComplexesSelectionTests(unittest.TestCase): 28 | 29 | def setUp(self) -> None: 30 | manager = db_setup.get_clean_db(f"chemoton_{self.__class__.__name__}") 31 | self.credentials = manager.get_credentials() 32 | self.manager = connect_to_db(self.credentials) 33 | self.structures = self.manager.get_collection("structures") 34 | self.compounds = self.manager.get_collection("compounds") 35 | rr = resources_root_path() 36 | self.model = db_setup.get_fake_model() 37 | 38 | self.cat_name = "grubbs" 39 | self.other_name = "proline_acid_propanal_product" 40 | 41 | self.example_structures = {} 42 | self.example_compounds = {} 43 | for name in [self.cat_name, self.other_name]: 44 | 45 | path = os.path.join(rr, f"{name}.xyz") 46 | 47 | structure = db.Structure(db.ID(), self.structures) 48 | structure.create(path, 0, 1, self.model, db.Label.MINIMUM_OPTIMIZED) 49 | 50 | compound = db.Compound(db.ID(), self.compounds) 51 | compound.create([structure.id()]) 52 | structure.set_aggregate(compound.id()) 53 | 54 | graph = load(open(os.path.join(rr, f"{name}.json"), "r")) 55 | structure.set_graph("masm_cbor_graph", graph["masm_cbor_graph"]) 56 | structure.set_graph("masm_idx_map", graph["masm_idx_map"]) 57 | structure.set_graph("masm_decision_list", graph["masm_decision_list"]) 58 | 59 | self.example_structures[name] = structure 60 | self.example_compounds[name] = compound 61 | 62 | def tearDown(self) -> None: 63 | self.manager.wipe() 64 | 65 | def test_result_access_fails(self): 66 | sele = CentralMetalSelection(self.model, "Ru", ligand_without_metal_reactive=False) 67 | with self.assertRaises(PermissionError) as context: 68 | _ = sele.get_step_result() 69 | self.assertTrue('may not access the step_result member' in str(context.exception)) 70 | 71 | def test_ligand_ligand(self): 72 | sele = CentralMetalSelection(self.model, "Ru", ligand_without_metal_reactive=False) 73 | result = sele(self.credentials) 74 | assert len(result.structures) == 0 75 | assert isinstance(result.aggregate_filter, CatalystFilter) 76 | result.aggregate_filter.initialize_collections(self.manager) 77 | for k, v in self.example_compounds.items(): 78 | assert result.aggregate_filter.filter(v) == (k == self.cat_name) 79 | assert isinstance(result.reactive_site_filter, CentralSiteFilter) 80 | -------------------------------------------------------------------------------- /scine_chemoton/tests/test_cli_reactive_complex_assembly.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | # Standard library imports 9 | import os 10 | import numpy as np 11 | from pathlib import Path 12 | 13 | import scine_utilities as utils 14 | from scine_chemoton import _read_file_to_molecule, _get_arguments, _create_reactive_complexes 15 | 16 | # Local application tests imports 17 | from .resources import resources_root_path 18 | 19 | 20 | def test_read_file_to_molecule(): 21 | rr = resources_root_path() 22 | water_path = os.path.join(rr, "water.xyz") 23 | water = _read_file_to_molecule(Path(water_path)) 24 | assert isinstance(water, utils.AtomCollection) 25 | assert water.size() == 3 26 | 27 | ethene_path = os.path.join(rr, "ethene.mol") 28 | ethene = _read_file_to_molecule(Path(ethene_path)) 29 | assert isinstance(ethene, utils.AtomCollection) 30 | assert ethene.size() == 6 31 | 32 | 33 | def test_parsing_arguments(): 34 | rr = resources_root_path() 35 | water_path = os.path.join(rr, "water.xyz") 36 | arguments = _get_arguments(["-m1", water_path, "-m2", water_path, 37 | "-l", "0", "1", 38 | "-r", "0", "1", 39 | "-ma"]) 40 | assert arguments.molecule1 == Path(water_path) 41 | assert arguments.molecule2 == Path(water_path) 42 | assert arguments.lhs == [0, 1] 43 | assert arguments.rhs == [0, 1] 44 | assert arguments.n_rotamers == 2 45 | assert arguments.multiple_attack_points 46 | assert not arguments.verbose 47 | 48 | 49 | def test_creating_reactive_complexes(): 50 | rr = resources_root_path() 51 | water_path = os.path.join(rr, "water.xyz") 52 | water = _read_file_to_molecule(Path(water_path)) 53 | _create_reactive_complexes(water, water, [0, 1], [0, 1], n_rotamers=1, 54 | multiple_attack_points=False, verbose=False) 55 | rc_path = os.path.join(os.getcwd(), "rc.0.xyz") 56 | assert os.path.exists("rc.0.xyz") 57 | 58 | rr = resources_root_path() 59 | ref_water_rc_path = os.path.join(rr, "water_rc.xyz") 60 | ref_water_rc = utils.io.read(ref_water_rc_path)[0] 61 | water_rc = utils.io.read(rc_path)[0] 62 | 63 | assert ref_water_rc.elements == water_rc.elements 64 | assert np.allclose(ref_water_rc.positions, water_rc.positions, rtol=0, atol=1e-10) 65 | # clean up 66 | os.remove(rc_path) 67 | -------------------------------------------------------------------------------- /scine_chemoton/tests/test_default_settings.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | from scine_utilities import ValueCollection 9 | 10 | from scine_chemoton import default_settings 11 | 12 | 13 | def test_execution_without_argument(): 14 | for f in default_settings.__dict__.values(): 15 | if callable(f): 16 | vc = f() 17 | assert isinstance(vc, ValueCollection) 18 | -------------------------------------------------------------------------------- /scine_chemoton/tests/utilities/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | -------------------------------------------------------------------------------- /scine_chemoton/tests/utilities/db_object_wrappers/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | -------------------------------------------------------------------------------- /scine_chemoton/tests/utilities/db_object_wrappers/test_wrapper_factory_singleton.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | import unittest 9 | 10 | import scine_database as db 11 | 12 | from scine_database import test_database_setup as db_setup 13 | 14 | from ....gears import HoldsCollections 15 | from ....utilities.db_object_wrappers.wrapper_caches import MultiModelCacheFactory 16 | from ....utilities.model_combinations import ModelCombination 17 | from ....utilities.db_object_wrappers.aggregate_cache import AggregateCache 18 | from ....utilities.db_object_wrappers.reaction_cache import ReactionCache 19 | from ....utilities.db_object_wrappers.aggregate_wrapper import Aggregate 20 | from ....utilities.db_object_wrappers.reaction_wrapper import Reaction 21 | 22 | 23 | class TestWrapperFactorySingleton(unittest.TestCase, HoldsCollections): 24 | def custom_setup(self, manager: db.Manager) -> None: 25 | self._required_collections = ["manager", "reactions", "compounds", "flasks"] 26 | self.initialize_collections(manager) 27 | 28 | def tearDown(self) -> None: 29 | self._manager.wipe() 30 | 31 | def set_up_database(self): 32 | n_compounds = 10 33 | n_flasks = 6 34 | n_reactions = 16 35 | max_r_per_c = 10 36 | max_n_products_per_r = 3 37 | max_n_educts_per_r = 2 38 | max_s_per_c = 3 39 | max_steps_per_r = 1 40 | barrier_limits = (0.1, 100.0) 41 | n_inserts = 3 42 | manager = db_setup.get_random_db( 43 | n_compounds, 44 | n_flasks, 45 | n_reactions, 46 | max_r_per_c, 47 | "chemoton_test_wrapper_factory_singleton", 48 | max_n_products_per_r, 49 | max_n_educts_per_r, 50 | max_s_per_c, 51 | max_steps_per_r, 52 | barrier_limits, 53 | n_inserts, 54 | ) 55 | self.custom_setup(manager) 56 | MultiModelCacheFactory().clear() 57 | 58 | def test_wrapper_singleton(self): 59 | self.set_up_database() 60 | combi = ModelCombination(db_setup.get_fake_model()) 61 | # Check if the factory is able to provide functioning caches. 62 | for only_electronic in [True, False]: 63 | aggregate_cache = MultiModelCacheFactory().get_aggregates_cache(only_electronic, combi, self._manager) 64 | assert isinstance(aggregate_cache, AggregateCache) 65 | for compound in self._compounds.iterate_all_compounds(): 66 | aggregate = aggregate_cache.get_or_produce(compound.id()) 67 | assert isinstance(aggregate, Aggregate) 68 | assert aggregate.get_db_id() == compound.id() 69 | 70 | reaction_cache = MultiModelCacheFactory().get_reaction_cache(only_electronic, combi, self._manager) 71 | assert isinstance(reaction_cache, ReactionCache) 72 | for db_reaction in self._reactions.iterate_all_reactions(): 73 | reaction = reaction_cache.get_or_produce(db_reaction.id()) 74 | assert isinstance(reaction, Reaction) 75 | assert reaction.get_db_id() == db_reaction.id() 76 | 77 | # Check if there is only one instance of the factory and this instance returns the same objects if the 78 | # same settings are requested. 79 | assert MultiModelCacheFactory() == MultiModelCacheFactory() 80 | instance_1 = MultiModelCacheFactory().get_aggregates_cache(True, combi, self._manager) 81 | instance_2 = MultiModelCacheFactory().get_aggregates_cache(True, combi, self._manager) 82 | assert instance_1 == instance_2 83 | # Check for different settings. 84 | combi_2 = ModelCombination(db.Model("some", "other", "model")) 85 | instance_2 = MultiModelCacheFactory().get_aggregates_cache(True, combi_2, self._manager) 86 | assert instance_1 != instance_2 87 | 88 | instance_2 = MultiModelCacheFactory().get_aggregates_cache(False, combi, self._manager) 89 | assert instance_1 != instance_2 90 | -------------------------------------------------------------------------------- /scine_chemoton/tests/utilities/reactive_complexes/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | -------------------------------------------------------------------------------- /scine_chemoton/tests/utilities/reactive_complexes/test_lebedev_sphere.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | # Standard library imports 9 | import numpy as np 10 | 11 | # Local application imports 12 | from ....utilities.reactive_complexes.lebedev_sphere import LebedevSphere 13 | 14 | 15 | def test_distance(): 16 | lebedev = LebedevSphere() 17 | for point in lebedev.points: 18 | assert abs(np.linalg.norm(point) - 1.0) < 1e-6 19 | 20 | 21 | def test_neighbors(): 22 | lebedev = LebedevSphere() 23 | for i, neighbors in enumerate(lebedev.nearest_neighbors): 24 | for j in neighbors: 25 | assert i in lebedev.nearest_neighbors[j] 26 | -------------------------------------------------------------------------------- /scine_chemoton/tests/utilities/reactive_complexes/test_masm_pruning.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | from ....utilities.masm import mol_to_cbor, get_atom_pairs 9 | import scine_molassembler as masm 10 | 11 | from functools import partial 12 | 13 | 14 | def test_masm_pruning(): 15 | propane = masm.io.experimental.from_smiles("CCC") 16 | propane.canonicalize() 17 | 18 | class MockStructure(object): 19 | graph: dict = {} 20 | 21 | def __init__(self, graph: dict) -> None: 22 | self.graph = graph 23 | 24 | def get_graph(self, key: str) -> str: 25 | return self.graph[key] 26 | 27 | graph = {"masm_cbor_graph": mol_to_cbor(propane), "masm_idx_map": str([(0, i) for i in range(propane.graph.V)])} 28 | pair_fn = partial(get_atom_pairs, MockStructure(graph)) 29 | 30 | assert len(pair_fn((1, 1), "All")) == 3 31 | assert len(pair_fn((1, 2), "All")) == 8 32 | assert len(pair_fn((1, 3), "All")) == 10 33 | assert len(pair_fn((1, 4), "All")) == 11 34 | -------------------------------------------------------------------------------- /scine_chemoton/tests/utilities/reactive_complexes/test_unit_circle.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | # Standard library imports 9 | import numpy as np 10 | 11 | # Local application imports 12 | from ....utilities.reactive_complexes.unit_circle import UnitCircle 13 | 14 | 15 | def test_distance(): 16 | unit_circle = UnitCircle() 17 | for point in unit_circle.points: 18 | assert abs(np.linalg.norm(point) - 1.0) < 1e-6 19 | 20 | 21 | def test_neighbors(): 22 | unit_circle = UnitCircle() 23 | for i, neighbors in enumerate(unit_circle.nearest_neighbors): 24 | for j in neighbors: 25 | assert i in unit_circle.nearest_neighbors[j] 26 | -------------------------------------------------------------------------------- /scine_chemoton/tests/utilities/test_get_molecular_formulas.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | import os 9 | import json 10 | 11 | import unittest 12 | from scine_chemoton.gears import HoldsCollections 13 | 14 | import scine_database as db 15 | from scine_database import test_database_setup as db_setup 16 | 17 | # local imports 18 | from ..resources import resources_root_path 19 | from ...utilities.get_molecular_formula import ( 20 | get_molecular_formula_of_structure, 21 | get_molecular_formula_of_compound, 22 | get_molecular_formula_of_flask, 23 | get_molecular_formula_of_aggregate 24 | ) 25 | 26 | 27 | class GetMolecularFormulaTest(unittest.TestCase, HoldsCollections): 28 | 29 | def custom_setup(self, manager: db.Manager) -> None: 30 | self._required_collections = ["manager", "elementary_steps", "structures", "reactions", "compounds", "flasks", 31 | "properties"] 32 | self.initialize_collections(manager) 33 | 34 | def tearDown(self) -> None: 35 | self._manager.wipe() 36 | 37 | def test_get_molecular_formula_of_structure(self): 38 | manager = db_setup.get_clean_db("chemoton_test_get_molecular_formula_of_structure") 39 | self.custom_setup(manager) 40 | # Add structure to database 41 | structure = db.Structure() 42 | structure.link(self._structures) 43 | rr = resources_root_path() 44 | structure.create(os.path.join(rr, "proline_acid_propanal_product.xyz"), 0, 1) 45 | 46 | assert get_molecular_formula_of_structure(structure.id(), self._structures) == "C8H15NO3(c:0, m:1)" 47 | structure.set_charge(-99) 48 | assert get_molecular_formula_of_structure(structure.id(), self._structures) == "C8H15NO3(c:-99, m:1)" 49 | structure.set_multiplicity(99) 50 | assert get_molecular_formula_of_structure(structure.id(), self._structures) == "C8H15NO3(c:-99, m:99)" 51 | 52 | def test_get_molecular_formula_of_compound(self): 53 | manager = db_setup.get_clean_db("chemoton_test_get_molecular_formula_of_compound") 54 | self.custom_setup(manager) 55 | compound_id, _ = db_setup.insert_single_empty_structure_aggregate(manager, db.Label.MINIMUM_OPTIMIZED) 56 | 57 | assert get_molecular_formula_of_compound(compound_id, self._compounds, self._structures) == "H2O(c:0, m:1)" 58 | 59 | def test_get_molecular_formula_of_flask(self): 60 | manager = db_setup.get_clean_db("chemoton_test_get_molecular_formula_of_flask_and_aggregates") 61 | self.custom_setup(manager) 62 | 63 | flask = db.Flask() 64 | flask.link(self._flasks) 65 | flask.create([], [], exploration_disabled=True) 66 | # Structure of flask 67 | flask_structure = db.Structure() 68 | flask_structure.link(self._structures) 69 | flask_structure.create(os.path.join(resources_root_path(), "h4o2.xyz"), 0, 1) 70 | flask_structure.set_label(db.Label.COMPLEX_OPTIMIZED) 71 | flask_structure.set_aggregate(flask.get_id()) 72 | graph = json.load(open(os.path.join(resources_root_path(), "water" + ".json"), "r")) 73 | flask_structure.set_graph("masm_cbor_graph", ";".join([graph['masm_cbor_graph']] * 2)) 74 | flask.add_structure(flask_structure.get_id()) 75 | 76 | water, _ = db_setup.insert_single_empty_structure_aggregate(manager, db.Label.MINIMUM_OPTIMIZED) 77 | 78 | ref_flask_string = "H4O2(c:0, m:1) [H2O | H2O]" 79 | assert get_molecular_formula_of_flask(flask.id(), self._flasks, self._structures) == ref_flask_string 80 | 81 | assert get_molecular_formula_of_aggregate(water, db.CompoundOrFlask.COMPOUND, 82 | self._compounds, self._flasks, self._structures) == "H2O(c:0, m:1)" 83 | assert get_molecular_formula_of_aggregate(flask.id(), db.CompoundOrFlask.FLASK, 84 | self._compounds, self._flasks, self._structures) == ref_flask_string 85 | -------------------------------------------------------------------------------- /scine_chemoton/tests/utilities/test_insert_initial_structure.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | 9 | # Standard library imports 10 | import os 11 | import warnings 12 | 13 | # Third party imports 14 | import scine_database as db 15 | import scine_utilities as utils 16 | from scine_database import test_database_setup as db_setup 17 | 18 | # Local application tests imports 19 | from ..resources import resources_root_path 20 | 21 | # Local application imports 22 | from ...utilities.insert_initial_structure import insert_initial_structure 23 | 24 | 25 | def test_insert_initial_structure(): 26 | 27 | # Connect to test DB 28 | manager = db_setup.get_clean_db("chemoton_test_insert_initial_structure") 29 | 30 | # Add structure data 31 | rr = resources_root_path() 32 | 33 | # Fake model 34 | model = db.Model("FAKE", "FAKE", "F-AKE") 35 | # Insert structure from file with default settings 36 | water_path = os.path.join(rr, "water.xyz") 37 | struct, calc = insert_initial_structure(manager, water_path, 0, 1, model) 38 | 39 | assert struct.get_charge() == 0 40 | assert struct.get_multiplicity() == 1 41 | assert struct.get_label().name == "USER_GUESS" 42 | assert struct.get_atoms().size() == 3 43 | assert calc.get_job().order == "scine_geometry_optimization" 44 | assert calc.get_model().method_family == model.method_family 45 | assert calc.get_status() == db.Status.NEW 46 | assert calc.get_priority() == 1 47 | assert calc.get_structures()[0].string() == struct.get_id().string() 48 | assert not calc.get_settings() 49 | 50 | # Insert structure from atom collection with non-default settings 51 | arginine = utils.io.read(os.path.join(rr, "arginine.xyz"))[0] 52 | fake_settings = utils.ValueCollection({"fake_setting": "fake_value"}) 53 | with warnings.catch_warnings(record=True) as warning: 54 | # Cause all warnings to always be triggered. 55 | warnings.simplefilter("always") 56 | struct, calc = insert_initial_structure( 57 | manager, arginine, 1, 2, model, db.Label.IRRELEVANT, db.Job("fake_job"), fake_settings 58 | ) 59 | assert len(warning) == 1 60 | assert "user_guess" in str(warning[-1].message) 61 | 62 | assert struct.get_charge() == 1 63 | assert struct.get_multiplicity() == 2 64 | assert struct.get_label().name == "IRRELEVANT" 65 | assert struct.get_atoms().size() == 26 66 | assert calc.get_job().order == "fake_job" 67 | assert calc.get_model().method_family == model.method_family 68 | assert calc.get_status() == db.Status.NEW 69 | assert calc.get_priority() == 1 70 | assert calc.get_structures()[0].string() == struct.get_id().string() 71 | assert dict(calc.get_settings()) == dict(fake_settings) 72 | 73 | # Cleaning 74 | manager.wipe() 75 | -------------------------------------------------------------------------------- /scine_chemoton/tests/utilities/test_masm.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | from ...utilities.masm import distinct_atoms, distinguish_components 9 | 10 | import scine_molassembler as masm 11 | 12 | 13 | def test_distinct_components(): 14 | propane = masm.io.experimental.from_smiles("CCC") 15 | assert len(distinct_atoms(propane, h_only=True)) == 5 16 | assert len(distinct_atoms(propane, h_only=False)) == 4 17 | 18 | cyclopropane = masm.io.experimental.from_smiles("C1CC1") 19 | assert len(distinct_atoms(cyclopropane, h_only=True)) == 4 20 | assert len(distinct_atoms(cyclopropane, h_only=False)) == 2 21 | 22 | 23 | def test_distinguish_components(): 24 | components = [0, 1, 0, 0, 1, 1, 2] 25 | split = distinguish_components(components, lambda i: i % 2) 26 | assert len(split) == len(components) 27 | assert len(set(split)) == max(split) + 1 28 | assert len(set(split)) == 5 29 | assert split[0] == split[2] 30 | assert split[0] != split[3] 31 | assert split[1] == split[5] 32 | assert split[4] != split[5] 33 | -------------------------------------------------------------------------------- /scine_chemoton/tests/utilities/test_pickle.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | import os 9 | import ast 10 | import _ast 11 | import importlib 12 | from collections import UserList 13 | from inspect import isabstract, getmembers 14 | from typing import List, Tuple 15 | 16 | import scine_chemoton 17 | from scine_chemoton.gears import Gear 18 | from scine_chemoton.utilities.datastructure_transfer import db_safe_deepcopy, make_picklable 19 | 20 | 21 | class GearContainer(UserList): 22 | """ 23 | Automatically gather a list of all non-abstract gears from scine_chemoton. 24 | """ 25 | 26 | def __init__(self) -> None: 27 | super().__init__() 28 | class_to_search = Gear 29 | 30 | for path, class_name in self._get_all_classes_names_from_chemoton(): 31 | module = importlib.import_module(path) 32 | loaded_class = getattr(module, class_name) 33 | 34 | if issubclass(loaded_class, class_to_search) and not isabstract(loaded_class): 35 | self.data.append(loaded_class) 36 | 37 | def _get_all_classes_names_from_chemoton(self) -> List[Tuple[str, str]]: 38 | """ 39 | Search for all classes in scine_chemoton module. 40 | Returns a list of Tuples of module path and class name. 41 | """ 42 | classes = [] 43 | for path in self._get_files_names_from_chemoton(): 44 | with open(path) as mf: 45 | tree = ast.parse(mf.read()) 46 | 47 | # parse module path 48 | module_path = path.split("scine_chemoton")[-1] 49 | module_path = module_path.replace(".py", "") 50 | module_path = module_path.replace("/__init__", "") 51 | module_path = "scine_chemoton" + module_path.replace("/", ".") 52 | 53 | # parse classes names 54 | module_classes = [_ for _ in tree.body if isinstance(_, _ast.ClassDef)] 55 | classes.extend([(module_path, c.name) for c in module_classes]) 56 | return classes 57 | 58 | @staticmethod 59 | def _get_files_names_from_chemoton() -> List[str]: 60 | """ 61 | Return all .py files in scine_chemoton module. 62 | """ 63 | location = None 64 | try: 65 | location = scine_chemoton.__file__ # can also be None 66 | except AttributeError: 67 | pass 68 | if location is None: 69 | members = getmembers(scine_chemoton) 70 | for m in members: 71 | if "__file__" in m and m[1] is not None: 72 | location = m[1] 73 | break 74 | if "__path__" in m and m[1] is not None: 75 | for possible_location in m[1]: 76 | if os.path.exists(possible_location): 77 | location = possible_location 78 | break 79 | if location is None: 80 | here = os.path.abspath(os.path.dirname(__file__)) 81 | location = os.path.join(here, "..", "..", "scine_chemoton", "__init__.py") 82 | if os.path.exists(location): 83 | raise RuntimeError("The location of your installed SCINE Chemoton could not be determined") 84 | path = os.path.dirname(location) 85 | 86 | py_files = [] 87 | 88 | for root, _, files in os.walk(path): 89 | for f in files: 90 | if f[-3:] == ".py": 91 | py_files.append(os.path.join(root, f)) 92 | 93 | return py_files 94 | 95 | 96 | def test_all_gears_pickleable(): 97 | gears = GearContainer() 98 | for gear in gears: 99 | gear_inst = gear() 100 | assert gear_inst is not None 101 | assert isinstance(gear_inst, gear) 102 | 103 | gear = make_picklable(gear) 104 | assert gear_inst is not None 105 | assert isinstance(gear_inst, gear) 106 | 107 | gear_inst = db_safe_deepcopy(gear_inst) 108 | assert gear_inst is not None 109 | assert isinstance(gear_inst, gear) 110 | -------------------------------------------------------------------------------- /scine_chemoton/tests/utilities/test_place_holder_model.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | from copy import copy 9 | from tempfile import NamedTemporaryFile 10 | import pickle 11 | 12 | 13 | from scine_chemoton.utilities.place_holder_model import ( 14 | PlaceHolderModelType, 15 | construct_place_holder_model, 16 | _place_hold_arguments 17 | ) 18 | 19 | import scine_database as db 20 | import pytest 21 | 22 | 23 | def test_forbidden_init(): 24 | with pytest.raises(PermissionError): 25 | PlaceHolderModelType() 26 | 27 | 28 | def test_invalid_type_for_base(): 29 | model = db.Model(*_place_hold_arguments()) 30 | assert isinstance(model, db.Model) 31 | assert not isinstance(model, PlaceHolderModelType) 32 | model.method_family = 'DFT' 33 | assert isinstance(model, db.Model) 34 | assert not isinstance(model, PlaceHolderModelType) 35 | 36 | 37 | def test_type_alteration(): 38 | place_holder = construct_place_holder_model() 39 | assert isinstance(place_holder, db.Model) 40 | assert isinstance(place_holder, PlaceHolderModelType) 41 | # if we now change fields, it is no longer a place-holder 42 | place_holder.method_family = 'DFT' 43 | assert isinstance(place_holder, db.Model) 44 | assert not isinstance(place_holder, PlaceHolderModelType) 45 | 46 | 47 | def test_copy(): 48 | place_holder = construct_place_holder_model() 49 | place_holder_copy = copy(place_holder) 50 | assert place_holder == place_holder_copy 51 | assert place_holder is not place_holder_copy 52 | assert isinstance(place_holder_copy, db.Model) 53 | assert isinstance(place_holder_copy, PlaceHolderModelType) 54 | 55 | # if we now change fields, it is no longer a place-holder 56 | place_holder.method_family = 'DFT' 57 | assert isinstance(place_holder, db.Model) 58 | assert not isinstance(place_holder, PlaceHolderModelType) 59 | place_holder_copy = copy(place_holder) 60 | assert place_holder == place_holder_copy 61 | assert place_holder is not place_holder_copy 62 | assert isinstance(place_holder_copy, db.Model) 63 | assert not isinstance(place_holder_copy, PlaceHolderModelType) 64 | 65 | 66 | def test_pickle(): 67 | place_holder = construct_place_holder_model() 68 | with NamedTemporaryFile("w+b", suffix=".pkl") as f: 69 | pickle.dump(place_holder, f) 70 | f.seek(0) 71 | read_place_holder = pickle.load(f) 72 | assert place_holder == read_place_holder 73 | assert place_holder is not read_place_holder 74 | assert isinstance(read_place_holder, db.Model) 75 | assert isinstance(read_place_holder, PlaceHolderModelType) 76 | place_holder.method_family = 'DFT' 77 | assert isinstance(place_holder, db.Model) 78 | assert not isinstance(place_holder, PlaceHolderModelType) 79 | read_place_holder.method_family = 'DFT' 80 | assert isinstance(read_place_holder, db.Model) 81 | assert not isinstance(read_place_holder, PlaceHolderModelType) 82 | with NamedTemporaryFile("w+b", suffix=".pkl") as f: 83 | pickle.dump(place_holder, f) 84 | f.seek(0) 85 | read_place_holder = pickle.load(f) 86 | assert place_holder == read_place_holder 87 | assert place_holder is not read_place_holder 88 | assert isinstance(read_place_holder, db.Model) 89 | assert not isinstance(read_place_holder, PlaceHolderModelType) 90 | -------------------------------------------------------------------------------- /scine_chemoton/utilities/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | from time import sleep 8 | from typing import Callable, Tuple 9 | 10 | import scine_database as db 11 | 12 | 13 | def connect_to_db(credentials: db.Credentials) -> db.Manager: 14 | manager = db.Manager() 15 | manager.set_credentials(credentials) 16 | manager.connect() 17 | sleep(1.0) 18 | if not manager.has_collection("calculations"): 19 | raise RuntimeError(f"Database {credentials.database_name} is missing collections.") 20 | return manager 21 | 22 | 23 | def yes_or_no_question(question: str, callable_input: Callable = input) -> bool: 24 | inp = callable_input(f"{question}? (y/n) ") 25 | while True: 26 | if inp.strip().lower() in ["y", "yes"]: 27 | return True 28 | if inp.strip().lower() in ["n", "no"]: 29 | return False 30 | inp = callable_input("Did not recognize answer, please answer 'yes' or 'no': ") 31 | 32 | 33 | def integer_question(question: str, limits: Tuple[int, int], callable_input: Callable = input) -> int: 34 | inp = callable_input(f"{question}? ") 35 | while True: 36 | try: 37 | val = int(inp.strip()) 38 | if limits[0] <= val <= limits[1]: 39 | return val 40 | inp = callable_input(f"Please enter an integer between {limits[0]} and {limits[1]}: ") 41 | except ValueError: 42 | inp = callable_input("Did not recognize answer, please give an integer: ") 43 | -------------------------------------------------------------------------------- /scine_chemoton/utilities/calculation_creation_helpers.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | import scine_database as db 9 | from typing import Optional, List 10 | 11 | 12 | def finalize_calculation( 13 | calculation: db.Calculation, 14 | structure_collection: db.Collection, 15 | structure_ids: Optional[List[db.ID]] = None 16 | ): 17 | if structure_ids is None: 18 | structure_ids = calculation.get_structures() 19 | for s_id in structure_ids: 20 | structure = db.Structure(s_id, structure_collection) 21 | structure.add_calculation(calculation.job.order, calculation.id()) 22 | calculation.set_status(db.Status.HOLD) 23 | -------------------------------------------------------------------------------- /scine_chemoton/utilities/comparisons.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | 9 | def attribute_comparison(a: object, b: object) -> bool: 10 | """ 11 | Compare two objects by their attributes. This is useful for comparing objects that are not the identical objects 12 | but have the same attributes and are of the same type. 13 | :param a: The first object. 14 | :param b: The second object. 15 | :return: True if the objects have the same attributes, False otherwise. 16 | """ 17 | if not isinstance(a, type(b)): 18 | return False 19 | for attr in dir(a): 20 | if attr.startswith("__"): 21 | continue 22 | if callable(getattr(a, attr)): 23 | continue 24 | if getattr(a, attr) != getattr(b, attr): 25 | return False 26 | return True 27 | -------------------------------------------------------------------------------- /scine_chemoton/utilities/db_object_wrappers/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | -------------------------------------------------------------------------------- /scine_chemoton/utilities/db_object_wrappers/aggregate_cache.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | from typing import Dict 9 | 10 | import scine_database as db 11 | 12 | from .aggregate_wrapper import Aggregate 13 | 14 | 15 | class AggregateCache: 16 | """ 17 | A cache for aggregate objects. 18 | 19 | Parameters 20 | ---------- 21 | manager 22 | The database manager. 23 | electronic_model 24 | The electronic structure model from which the electronic energy is taken. 25 | hessian_model 26 | The electronic structure model with which the geometrical hessian was calculated. 27 | only_electronic 28 | If true, only the electronic energies are used to determine the thermodynamics. 29 | """ 30 | 31 | def __init__(self, manager: db.Manager, electronic_model: db.Model, hessian_model: db.Model, 32 | only_electronic: bool = False) -> None: 33 | self._manager = manager 34 | self._electronic_model = electronic_model 35 | self._hessian_model = hessian_model 36 | self._only_electronic = only_electronic 37 | self._aggregates: Dict[int, Aggregate] = {} 38 | 39 | def get_or_produce(self, aggregate_id: db.ID) -> Aggregate: 40 | """ 41 | Get an instance of the aggregate wrapper corresponding the reaction ID. The instance may be newly constructed or 42 | retrieved from the cache. 43 | 44 | Parameters 45 | ---------- 46 | aggregate_id : db.ID 47 | The aggregate database ID. 48 | 49 | Returns 50 | ------- 51 | Aggregate 52 | The aggregate wrapper instance. 53 | """ 54 | int_id = int(aggregate_id.string(), 16) 55 | if int_id not in self._aggregates: 56 | self._aggregates[int_id] = Aggregate(aggregate_id, self._manager, self._electronic_model, 57 | self._hessian_model, self._only_electronic) 58 | return self._aggregates[int_id] 59 | 60 | def get_electronic_model(self): 61 | return self._electronic_model 62 | -------------------------------------------------------------------------------- /scine_chemoton/utilities/db_object_wrappers/reaction_cache.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | from typing import Optional, Dict 9 | 10 | import scine_database as db 11 | 12 | from .aggregate_cache import AggregateCache 13 | from .reaction_wrapper import Reaction 14 | 15 | 16 | class ReactionCache: 17 | """ 18 | A cache for reaction objects. 19 | 20 | Parameters 21 | ---------- 22 | manager 23 | The database manager. 24 | electronic_model 25 | The electronic structure model from which the electronic energy is taken. 26 | hessian_model 27 | The electronic structure model with which the geometrical hessian was calculated. 28 | aggregate_cache : Optional[AggregateCache] 29 | An optional aggregate cache with which the aggregates taking part in the reaction are constructed. 30 | only_electronic 31 | If true, only the electronic energies are used to determine the thermodynamics. 32 | """ 33 | 34 | def __init__(self, manager: db.Manager, electronic_model: db.Model, hessian_model: db.Model, 35 | aggregate_cache: Optional[AggregateCache] = None, 36 | only_electronic: bool = False) -> None: 37 | self._manager = manager 38 | self._electronic_model = electronic_model 39 | self._hessian_model = hessian_model 40 | self._only_electronic = only_electronic 41 | self._reactions: Dict[int, Reaction] = {} 42 | if aggregate_cache is None: 43 | aggregate_cache = AggregateCache(manager, electronic_model, hessian_model, only_electronic) 44 | self._aggregate_cache = aggregate_cache 45 | 46 | def get_or_produce(self, reaction_id: db.ID) -> Reaction: 47 | """ 48 | Get an instance of the reaction wrapper corresponding the reaction ID. The instance may be newly constructed or 49 | retrieved from the cache. 50 | 51 | Parameters 52 | ---------- 53 | reaction_id : db.ID 54 | The reaction database ID. 55 | 56 | Returns 57 | ------- 58 | Reaction 59 | The reaction wrapper instance. 60 | """ 61 | int_id = int(reaction_id.string(), 16) 62 | if int_id not in self._reactions: 63 | self._reactions[int_id] = Reaction(reaction_id, self._manager, self._electronic_model, self._hessian_model, 64 | self._aggregate_cache, self._only_electronic) 65 | return self._reactions[int_id] 66 | -------------------------------------------------------------------------------- /scine_chemoton/utilities/insert_initial_structure.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | from typing import Union, Optional 9 | import warnings 10 | 11 | import scine_database as db 12 | from scine_database.insert_concentration import insert_concentration_for_structure 13 | import scine_utilities as utils 14 | 15 | 16 | def insert_initial_structure( 17 | database: db.Manager, 18 | molecule_path: Union[str, utils.AtomCollection], 19 | charge: int, 20 | multiplicity: int, 21 | model: db.Model, 22 | label: db.Label = db.Label.USER_GUESS, 23 | job: db.Job = db.Job("scine_geometry_optimization"), 24 | settings: utils.ValueCollection = utils.ValueCollection({}), 25 | start_concentration: Optional[float] = None 26 | ): 27 | """ 28 | Insert a structure to the database and set up a calculation working on it. 29 | 30 | Parameters 31 | ---------- 32 | database : db.Manager 33 | Database to use. 34 | molecule_path : Union[str, utils.AtomCollection] 35 | Atom collection or path to the xyz file with the structure to be inserted. 36 | charge : int 37 | Charge of the structure. 38 | multiplicity : int 39 | Multiplicity of the structure. 40 | model : db.Model 41 | Model to be used for the calculation. 42 | label : db.Label, optional 43 | Label of the inserted structure, by default db.Label.MINIMUM_GUESS. 44 | job : db.Job, optional 45 | Job to be performed on the initial structure, by default db.Job('scine_geometry_optimization'). 46 | settings : utils.ValueCollection, optional 47 | Job settings, by default none. 48 | start_concentration : float 49 | The start concentratoin of the compound that will be generated from this structure. 50 | 51 | Returns 52 | ------- 53 | db.Structure, db.Calculation 54 | The inserted structure and the calculation generated for it 55 | """ 56 | structures = database.get_collection("structures") 57 | calculations = database.get_collection("calculations") 58 | 59 | structure = db.Structure() 60 | structure.link(structures) 61 | structure.create(molecule_path, charge, multiplicity) 62 | if label != db.Label.USER_GUESS: 63 | warnings.warn( 64 | "WARNING: You specified a label for your structure input that is not 'user_guess'. This may " 65 | "hinder the exploration of this structure." 66 | ) 67 | structure.set_label(label) 68 | 69 | if start_concentration is not None: 70 | insert_concentration_for_structure(database, start_concentration, model, structure.id()) 71 | 72 | if label == db.Label.USER_OPTIMIZED: 73 | structure.set_model(model) 74 | return structure, None 75 | 76 | calculation = db.Calculation() 77 | calculation.link(calculations) 78 | calculation.create(model, job, [structure.id()]) 79 | calculation.set_priority(1) 80 | 81 | if settings: 82 | calculation.set_settings(settings) 83 | 84 | calculation.set_status(db.Status.NEW) 85 | return structure, calculation 86 | -------------------------------------------------------------------------------- /scine_chemoton/utilities/model_combinations.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | from typing import Optional 9 | 10 | import scine_database as db 11 | 12 | 13 | class ModelCombination: 14 | """ 15 | This class combines two electronic structure models to a model combination. One of the models is supposed to be 16 | used to calculate structures, hessians, and gradients, while the second model is used to calculate the electronic 17 | energy. 18 | 19 | Parameters 20 | ---------- 21 | electronic_model : db.Model 22 | The model for the electronic energies. 23 | hessian_model : Optional[db.Model] 24 | The model for the structures, hessians, and gradients. If None is provided, the electronic_model is used. 25 | """ 26 | 27 | def __init__(self, electronic_model: db.Model, hessian_model: Optional[db.Model] = None) -> None: 28 | self.electronic_model: db.Model = electronic_model 29 | if hessian_model is None: 30 | hessian_model = electronic_model 31 | self.hessian_model: db.Model = hessian_model 32 | assert self.hessian_model 33 | assert isinstance(self.electronic_model, db.Model) 34 | assert isinstance(self.hessian_model, db.Model) 35 | 36 | def __eq__(self, other): 37 | """ 38 | Equal operator. Electronic energy and Hessian model must be the identical. 39 | """ 40 | if not isinstance(other, ModelCombination): 41 | return False 42 | return self.electronic_model == other.electronic_model and self.hessian_model == other.hessian_model 43 | -------------------------------------------------------------------------------- /scine_chemoton/utilities/options.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | from scine_chemoton.utilities.comparisons import attribute_comparison 9 | 10 | 11 | class BaseOptions: 12 | 13 | __slots__ = () 14 | 15 | def __eq__(self, other) -> bool: 16 | return attribute_comparison(self, other) 17 | 18 | def unset_collections(self) -> None: 19 | """ 20 | Duplicate name to HoldCollections method to be triggered in pickling process, so infinite _parent loops 21 | are avoided. 22 | """ 23 | if hasattr(self, "_parent"): 24 | setattr(self, "_parent", None) 25 | -------------------------------------------------------------------------------- /scine_chemoton/utilities/place_holder_model.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | from typing import List, Optional 9 | from typing_extensions import Self 10 | 11 | from wrapt import ObjectProxy 12 | import scine_database as db 13 | 14 | 15 | def _place_hold_arguments() -> List[str]: 16 | return ["place", "holder", "model"] 17 | 18 | 19 | class ModelNotSetError(Exception): 20 | pass 21 | 22 | 23 | class PlaceHolderModelType(db.Model): 24 | """ 25 | The type to check if a model is still a place-holder electronic structure model. 26 | Do not use to construct a place-holder model! 27 | """ 28 | 29 | def __init__(self, *args, know_what_i_am_doing: bool = False, **kwargs) -> None: 30 | super().__init__(*_place_hold_arguments()) 31 | if not know_what_i_am_doing: 32 | raise PermissionError("Do not construct a place-holder model directly, " 33 | "use 'construct_place_holder_model()' instead.") 34 | 35 | 36 | class _PlaceHolderModelProxy(ObjectProxy): 37 | """ 38 | Facilitates the class change 39 | """ 40 | 41 | _ref_place_holder = db.Model(*_place_hold_arguments()) 42 | __wrapped__: PlaceHolderModelType 43 | 44 | def __init__(self, *args, pre_existing_model: Optional[db.Model] = None, **kwargs) -> None: 45 | if pre_existing_model is not None: 46 | super().__init__(pre_existing_model) 47 | else: 48 | super().__init__(PlaceHolderModelType(know_what_i_am_doing=True)) 49 | 50 | @classmethod 51 | def from_existing_model(cls, model: db.Model) -> Self: 52 | return cls(pre_existing_model=model) 53 | 54 | @property # type: ignore 55 | def __class__(self): 56 | if self == self._ref_place_holder: 57 | return PlaceHolderModelType 58 | return db.Model 59 | 60 | def __getstate__(self): 61 | return self.__wrapped__.__getstate__() 62 | 63 | def __setstate__(self, state): 64 | self.__wrapped__.__setstate__(state) 65 | 66 | def __copy__(self): 67 | instance = _PlaceHolderModelProxy.__new__(_PlaceHolderModelProxy) 68 | instance.__wrapped__ = self.__wrapped__.__copy__() 69 | return instance 70 | 71 | def __deepcopy__(self, memo): 72 | instance = _PlaceHolderModelProxy.__new__(_PlaceHolderModelProxy) 73 | instance.__wrapped__ = self.__wrapped__.__deepcopy__(memo) 74 | return instance 75 | 76 | def __reduce__(self): 77 | return _PlaceHolderModelProxy.from_existing_model, (self.__wrapped__,) 78 | 79 | def __reduce_ex__(self, protocol): 80 | return _PlaceHolderModelProxy.from_existing_model, (self.__wrapped__,) 81 | 82 | 83 | def construct_place_holder_model(): 84 | """ 85 | Construct a place-holder model 86 | 87 | Examples 88 | -------- 89 | >>> place_holder = construct_place_holder_model() 90 | >>> assert isinstance(place_holder, db.Model) 91 | >>> assert isinstance(place_holder, PlaceHolderModelType) 92 | >>> # if we now change fields, it is no longer a place-holder 93 | >>> place_holder.method_family = 'DFT' 94 | >>> assert isinstance(place_holder, db.Model) 95 | >>> assert not isinstance(place_holder, PlaceHolderModelType) 96 | """ 97 | # this method hides the actually used Proxy 98 | # so that people do not use the proxy in the type check 99 | # because isinstance(place_holder, _PlaceHolderModelProxy) would always evaluate to True 100 | return _PlaceHolderModelProxy() 101 | -------------------------------------------------------------------------------- /scine_chemoton/utilities/reactive_complexes/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | # Standard library imports 9 | from abc import ABC 10 | from typing import Any, Dict 11 | from warnings import warn 12 | 13 | 14 | class ReactiveComplexes: 15 | """ 16 | The base class for all reactive complex generators. 17 | """ 18 | 19 | def __init__(self) -> None: 20 | self.options = self.Options() 21 | 22 | class Options(ABC): 23 | """ 24 | Options attribute to be implemented by child classes 25 | """ 26 | 27 | def set_options(self, option_dict: Dict[str, Any]) -> None: 28 | """ 29 | Sets the options for the ReactiveComplexes from a dictionary. 30 | Generates a warning if an option is unknown. 31 | 32 | Parameters 33 | ---------- 34 | option_dict : Dict[str, Any] 35 | Dictionary with options to be used for generating reactive 36 | complexes. 37 | """ 38 | 39 | for option_name, value in option_dict.items(): 40 | if not hasattr(self.options, option_name): 41 | warn( 42 | "Option '{}' is unknown and will be ignored.".format(option_name), 43 | stacklevel=2, 44 | ) 45 | continue 46 | setattr(self.options, option_name, value) 47 | -------------------------------------------------------------------------------- /scine_chemoton/utilities/warnings.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | __copyright__ = """ This code is licensed under the 3-clause BSD license. 4 | Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group. 5 | See LICENSE.txt for details. 6 | """ 7 | 8 | 9 | class ModelChangedWarning(UserWarning): 10 | pass 11 | 12 | 13 | class SettingsChangedWarning(UserWarning): 14 | pass 15 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [pycodestyle] 2 | max_line_length = 120 3 | 4 | [flake8] 5 | max_line_length = 120 6 | 7 | [mypy] 8 | ignore_missing_imports = True 9 | 10 | [pylint.MASTER] 11 | # allow to load these 12 | extension-pkg-whitelist=setproctitle 13 | 14 | [pylint.FORMAT] 15 | max-line-length=120 16 | 17 | [pylint.TYPECHECK] 18 | # types cannot be inferred leading to false negatives 19 | ignored-modules=scine_utilities,scine_database,scine_molassembler,scine_readuct,scine_sparrow,scine_swoose,scine_kinetx 20 | 21 | # regex of default ignored + arg args kwargs 22 | ignored-argument-names=_.*|^ignored_|^unused_|arg|args|kwargs 23 | 24 | # general disable: 25 | # C: Conventions like naming variables 26 | # R: Code complexity like too many variables in function 27 | # W0511: show TODO 28 | # W0212: access to 'private' method, but can be useful for tests 29 | # W1514: open file without encoding 30 | # W0622: redefine builtin name such as 'id' or 'filter' 31 | # W0105: pointless string statement, e.g. """ highlighted comment """ 32 | # W1510: running subprocess, without return code check 33 | disable=C,R,W0511,W0212,W1514,W0622,W0105,W1510 34 | 35 | # multiprocessing generates some members, which can cause problems, add more here if needed 36 | generated-members=Lock 37 | 38 | # ignore file completely 39 | ignore=_version.py 40 | 41 | # accept BaseException 42 | overgeneral-exceptions=builtins.Exception 43 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from os import path 2 | from setuptools import setup, find_packages 3 | import sys 4 | 5 | 6 | # NOTE: This file must remain Python 2 compatible for the foreseeable future, 7 | # to ensure that we error out properly for people with outdated setuptools 8 | # and/or pip. 9 | min_version = (3, 6) 10 | if sys.version_info < min_version: 11 | error = """ 12 | Chemoton does not support Python {0}.{1}. 13 | Python {2}.{3} and above is required. Check your Python version like so: 14 | 15 | python3 --version 16 | 17 | This may be due to an out-of-date pip. Make sure you have pip >= 9.0.1. 18 | Upgrade pip like so: 19 | 20 | pip install --upgrade pip 21 | """.format( 22 | *(sys.version_info[:2] + min_version) 23 | ) 24 | sys.exit(error) 25 | 26 | here = path.abspath(path.dirname(__file__)) 27 | 28 | with open(path.join(here, "README.rst"), encoding="utf-8") as readme_file: 29 | readme = readme_file.read() 30 | 31 | with open(path.join(here, "requirements.txt")) as requirements_file: 32 | # Parse requirements.txt, ignoring any commented-out lines. 33 | requirements = [line for line in requirements_file.read().splitlines() if not line.startswith("#")] 34 | 35 | with open(path.join(here, 'scine_chemoton', '_version.py')) as f: 36 | exec(f.read()) 37 | 38 | 39 | setup( 40 | name="scine_chemoton", 41 | version=__version__, 42 | description="Software driving the automated exploration of chemical reaction networks", 43 | long_description=readme, 44 | author="ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group", 45 | author_email="scine@phys.chem.ethz.ch", 46 | url="https://www.scine.ethz.ch", 47 | python_requires=">={}".format(".".join(str(n) for n in min_version)), 48 | packages=find_packages(include=["scine_chemoton", "scine_chemoton.*"], 49 | exclude=["scine_chemoton.tests*"]), 50 | entry_points={ 51 | "console_scripts": [ 52 | 'scine_chemoton_create_reactive_complex = scine_chemoton.__init__:create_reactive_complex_cli', 53 | # 'command = some.module:some_function', 54 | ], 55 | }, 56 | include_package_data=True, 57 | package_data={ 58 | "scine_chemoton": [ 59 | # When adding files here, remember to update MANIFEST.in as well, 60 | # or else they will not be included in the distribution on PyPI! 61 | # 'path/to/data_file', 62 | "resources/*xyz" 63 | ] 64 | }, 65 | install_requires=requirements, 66 | license="BSD (3-clause)", 67 | classifiers=[ 68 | "Programming Language :: Python", 69 | "Programming Language :: C++", 70 | "Development Status :: 5 - Production/Stable", 71 | "Intended Audience :: Science/Research", 72 | "License :: OSI Approved :: BSD License", 73 | "Natural Language :: English", 74 | "Topic :: Scientific/Engineering :: Chemistry", 75 | ], 76 | zip_safe=False, 77 | test_suite="pytest", 78 | tests_require=["pytest"], 79 | ) 80 | --------------------------------------------------------------------------------