From 6602daf31dcac07053157ec58cc6de22ea15be14 Mon Sep 17 00:00:00 2001 From: Matt Thompson Date: Mon, 22 Apr 2024 12:35:28 -0500 Subject: [PATCH] Use Sage 2.2.0 RC1 as default (#307) * Use Sage 2.2.0 RC1 as default * Use released 2.2.0 * fix date check --------- Co-authored-by: Jeff Wagner --- devtools/conda-envs/docs-env.yaml | 3 +-- devtools/conda-envs/no_openeye.yaml | 1 + devtools/conda-envs/test-env.yaml | 1 + docs/getting-started/quick-start.md | 8 ++++---- docs/releasehistory.md | 4 ++++ docs/users/bespoke-workflows.md | 8 ++++---- openff/bespokefit/_tests/cli/executor/test_submit.py | 12 +++++++----- openff/bespokefit/_tests/cli/test_combine.py | 4 ++-- .../executor/services/coordinator/test_workers.py | 2 +- .../_tests/executor/services/optimizer/test_app.py | 2 +- .../executor/services/optimizer/test_worker.py | 4 ++-- openff/bespokefit/data/schemas/debug.json | 2 +- openff/bespokefit/data/schemas/default.json | 4 ++-- openff/bespokefit/workflows/bespoke.py | 2 +- 14 files changed, 32 insertions(+), 25 deletions(-) diff --git a/devtools/conda-envs/docs-env.yaml b/devtools/conda-envs/docs-env.yaml index 72587114..c491e4c5 100644 --- a/devtools/conda-envs/docs-env.yaml +++ b/devtools/conda-envs/docs-env.yaml @@ -20,14 +20,13 @@ dependencies: - openff-utilities - openff-toolkit-base =0.15 - openff-interchange # only needed because openff-toolkit-base - - openff-forcefields + - openff-forcefields >=2024.04.0 - openff-qcsubmit >=0.50 - openmm >=7.6.0 # Optional - forcebalance - openff-fragmenter-base - - openeye-toolkits ### Bespoke dependencies diff --git a/devtools/conda-envs/no_openeye.yaml b/devtools/conda-envs/no_openeye.yaml index d6f9f3b9..bc732756 100644 --- a/devtools/conda-envs/no_openeye.yaml +++ b/devtools/conda-envs/no_openeye.yaml @@ -23,6 +23,7 @@ dependencies: - openff-utilities - openff-toolkit-base =0.15 - openff-interchange # only needed because openff-toolkit-base + - openff-forcefields >=2024.04.0 - openff-qcsubmit >=0.50 - openmm >=7.6.0 diff --git a/devtools/conda-envs/test-env.yaml b/devtools/conda-envs/test-env.yaml index 523620b1..06b01987 100644 --- a/devtools/conda-envs/test-env.yaml +++ b/devtools/conda-envs/test-env.yaml @@ -23,6 +23,7 @@ dependencies: - openff-utilities - openff-toolkit-base =0.15 - openff-interchange # only needed because openff-toolkit-base + - openff-forcefields >=2024.04.0 - openff-units - openff-qcsubmit >=0.50 - openmm >=7.6.0 diff --git a/docs/getting-started/quick-start.md b/docs/getting-started/quick-start.md index b1560150..f2a5fb2f 100644 --- a/docs/getting-started/quick-start.md +++ b/docs/getting-started/quick-start.md @@ -77,7 +77,7 @@ Sometimes bespoke commands will raise `RuntimeError: The gateway could not be re by rerunning the command a few times. ::: -Here we have specified that we wish to start the fit from the general OpenFF 2.0.0 (Sage) force field, augmenting +Here we have specified that we wish to start the fit from the general OpenFF 2.2.0 (Sage) force field, augmenting it with bespoke parameters generated according to the [default built-in workflow using GFN2-xTB reference data](workflow_chapter). @@ -197,7 +197,7 @@ from openff.qcsubmit.common_structures import QCSpec factory = BespokeWorkflowFactory( # Define the starting force field that will be augmented with bespoke # parameters. - initial_force_field="openff-2.0.0.offxml", + initial_force_field="openff-2.2.0.offxml", # Change the level of theory that the reference QC data is generated at default_qc_specs=[ QCSpec( @@ -216,7 +216,7 @@ Similar to the previous steps, here we override the default ["default" QC specification](default_qc_method) to use GFN2-xTB. If we had Psi4 installed, we could remove the `default_qc_specs` argument and the factory would instead use our mainline [fitting QC method](default_qc_method). -The default factory will produce [workflows](workflow_chapter) that augment the OpenFF 2.0.0 force field +The default factory will produce [workflows](workflow_chapter) that augment the OpenFF 2.2.0 force field with bespoke torsion parameters for all non-terminal *rotatable* bonds in the molecule that have been trained to quantum chemical torsion scan data generated for said molecule. @@ -287,7 +287,7 @@ from openff.bespokefit.schema.targets import TorsionProfileTargetSchema factory = BespokeWorkflowFactory( # Define the starting force field that will be augmented with bespoke # parameters. - initial_force_field="openff-2.0.0.offxml", + initial_force_field="openff-2.2.0.offxml", # Select the underlying optimization engine. optimizer=ForceBalanceSchema( max_iterations=50, penalty_type="L1" diff --git a/docs/releasehistory.md b/docs/releasehistory.md index 93d19700..11bbe5e6 100644 --- a/docs/releasehistory.md +++ b/docs/releasehistory.md @@ -24,6 +24,9 @@ Releases follow the ``major.minor.micro`` scheme recommended by * [#325] - Document issue where `xtb` doesn't respect the `--qc-compute-n-cores` argument and provide workaround. by [@mattwthompson] * [#330] - Corrects a reference to Rosemary, which is not released, in the theory section. by [@mattwthompson] +### Behavior changes +* [#307] - OpenFF 2.2.0 RC1 ("Sage 2.2 RC1") is used as the initial force filed by default (if no other initial force field is specified). by [@mattwthompson] + ### Bug fixes * [#320] - Fixes a formatting issue ([#319]) when printing SMILES to summary table. by [@j-wags] @@ -154,6 +157,7 @@ The first major release of bespokefit intended for public use. [#279]: https://github.com/openforcefield/openff-bespokefit/pull/279 [#280]: https://github.com/openforcefield/openff-bespokefit/pull/280 [#286]: https://github.com/openforcefield/openff-bespokefit/pull/286 +[#307]: https://github.com/openforcefield/openff-bespokefit/pull/307 [#320]: https://github.com/openforcefield/openff-bespokefit/pull/320 [#321]: https://github.com/openforcefield/openff-bespokefit/pull/321 [#325]: https://github.com/openforcefield/openff-bespokefit/pull/325 diff --git a/docs/users/bespoke-workflows.md b/docs/users/bespoke-workflows.md index 6cb85c10..5c443a69 100644 --- a/docs/users/bespoke-workflows.md +++ b/docs/users/bespoke-workflows.md @@ -12,9 +12,9 @@ bespoke fit (represented by the [`BespokeOptimizationSchema`] object), and are u ## The default workflow -The default workflow is suitable for augmenting a general [SMIRNOFF] force field (currently the[OpenFF 2.0.0] force +The default workflow is suitable for augmenting a general [SMIRNOFF] force field (currently the [OpenFF 2.2.0] force field) with a new bespoke torsion term for each non-terminal rotatable bond in the input molecule, trained to reproduce -a bespoke one-dimensional quantum chemical torsion scan performed around that bond. +a bespoke one-dimensional quantum chemical torsion scan performed around that bond. [SMIRNOFF]: https://openforcefield.github.io/standards/standards/smirnoff/ @@ -127,7 +127,7 @@ Parameter generation also needs an initial force field to use as a starting poin should be the filename of a force field in [offxml format]: ```python -factory.initial_force_field = "openff-2.0.0.offxml" +factory.initial_force_field = "openff-2.2.0.offxml" ``` [`smirk_settings`]: openff.bespokefit.workflows.bespoke.BespokeWorkflowFactory.smirk_settings @@ -167,7 +167,7 @@ factory.parameter_hyperparameters = [ProperTorsionHyperparameters()] [`Fragmenter`]: openff.fragmenter.fragment.Fragmenter [ForceBalance]: https://github.com/leeping/forcebalance [`ForceBalanceSchema`]: openff.bespokefit.schema.optimizers.ForceBalanceSchema -[OpenFF 2.0.0]: https://openforcefield.org/force-fields/force-fields/#sage +[OpenFF 2.2.0]: https://openforcefield.org/force-fields/force-fields/#sage [`BaseOptimizerSchema`]: openff.bespokefit.schema.optimizers.BaseOptimizerSchema [offxml format]: https://openforcefield.github.io/standards/standards/smirnoff/ [`optimizer`]: openff.bespokefit.workflows.bespoke.BespokeWorkflowFactory.optimizer diff --git a/openff/bespokefit/_tests/cli/executor/test_submit.py b/openff/bespokefit/_tests/cli/executor/test_submit.py index 490bc020..bf37735a 100644 --- a/openff/bespokefit/_tests/cli/executor/test_submit.py +++ b/openff/bespokefit/_tests/cli/executor/test_submit.py @@ -79,7 +79,7 @@ def test_to_input_schema_mutual_exclusive_args( input_schema = _to_input_schema( console, Molecule.from_smiles("CC"), - force_field_path="openff-2.0.0.offxml", + force_field_path="openff-2.2.0.offxml", target_torsion_smirks=tuple(), default_qc_spec=None, workflow_name=workflow_name, @@ -107,8 +107,10 @@ def test_to_input_schema(force_field_path): assert isinstance(input_schema, BespokeOptimizationSchema) assert input_schema.id == "bespoke_task_0" + # Default to Sage 2.2 if no force field is provided, + # but 2019 if Parsley is provided assert ( - "2021-08-16" if force_field_path is None else "2019-10-10" + "2024-04-18" if force_field_path is None else "2019-10-10" ) in input_schema.initial_force_field @@ -206,7 +208,7 @@ def test_submit_multi_molecule(tmpdir): console, input_file_path=[], molecule_smiles=["[Cu+2].[O-]S(=O)(=O)[O-]"], - force_field_path="openff-2.0.0.offxml", + force_field_path="openff-2.2.0.offxml", target_torsion_smirks=tuple(), default_qc_spec=None, workflow_name="debug", @@ -231,7 +233,7 @@ def test_submit_invalid_schema(tmpdir): input_file_path, ], molecule_smiles=[], - force_field_path="openff-2.0.0.offxml", + force_field_path="openff-2.2.0.offxml", target_torsion_smirks=tuple(), default_qc_spec=None, workflow_name=None, @@ -276,7 +278,7 @@ def test_submit(tmpdir, file, smiles): rich.get_console(), input_file_path=file, molecule_smiles=smiles, - force_field_path="openff-2.0.0.offxml", + force_field_path="openff-2.2.0.offxml", target_torsion_smirks=tuple(), default_qc_spec=None, workflow_name="debug", diff --git a/openff/bespokefit/_tests/cli/test_combine.py b/openff/bespokefit/_tests/cli/test_combine.py index 400f9d8c..d2e90ea4 100644 --- a/openff/bespokefit/_tests/cli/test_combine.py +++ b/openff/bespokefit/_tests/cli/test_combine.py @@ -28,7 +28,7 @@ def test_combine_local_and_tasks(tmpdir, runner, bespoke_optimization_results): """ # make some local files to work with - for ff_name in ["openff-1.0.0.offxml", "openff-2.0.0.offxml"]: + for ff_name in ["openff-1.0.0.offxml", "openff-2.2.0.offxml"]: ForceField(ff_name).to_file(ff_name) settings = current_settings() @@ -59,7 +59,7 @@ def test_combine_local_and_tasks(tmpdir, runner, bespoke_optimization_results): "--output", "my_ff.offxml", "--ff", - "openff-2.0.0.offxml", + "openff-2.2.0.offxml", "--ff", "openff-1.0.0.offxml", "--id", diff --git a/openff/bespokefit/_tests/executor/services/coordinator/test_workers.py b/openff/bespokefit/_tests/executor/services/coordinator/test_workers.py index 84f33f91..efc51927 100644 --- a/openff/bespokefit/_tests/executor/services/coordinator/test_workers.py +++ b/openff/bespokefit/_tests/executor/services/coordinator/test_workers.py @@ -42,7 +42,7 @@ async def test_process_task(redis_connection, monkeypatch): create_task( input_schema=BespokeOptimizationSchema( smiles="CC", - initial_force_field="openff-2.0.0.offxml", + initial_force_field="openff-2.2.0.offxml", initial_force_field_hash="test_hash", target_torsion_smirks=[], stages=[ diff --git a/openff/bespokefit/_tests/executor/services/optimizer/test_app.py b/openff/bespokefit/_tests/executor/services/optimizer/test_app.py index b664b3d4..6b3052c0 100644 --- a/openff/bespokefit/_tests/executor/services/optimizer/test_app.py +++ b/openff/bespokefit/_tests/executor/services/optimizer/test_app.py @@ -49,7 +49,7 @@ def test_post_optimize(optimizer_client, redis_connection, monkeypatch): input_schema = BespokeOptimizationSchema( smiles="CC", - initial_force_field="openff-2.0.0.offxml", + initial_force_field="openff-2.2.0.offxml", initial_force_field_hash="test_hash", target_torsion_smirks=[], stages=[ diff --git a/openff/bespokefit/_tests/executor/services/optimizer/test_worker.py b/openff/bespokefit/_tests/executor/services/optimizer/test_worker.py index 308ac833..9bd4f904 100644 --- a/openff/bespokefit/_tests/executor/services/optimizer/test_worker.py +++ b/openff/bespokefit/_tests/executor/services/optimizer/test_worker.py @@ -25,7 +25,7 @@ def test_optimize(monkeypatch, redis_connection): input_schema = BespokeOptimizationSchema( id="test", smiles="CC", - initial_force_field="openff-2.0.0.offxml", + initial_force_field="openff-2.2.0.offxml", initial_force_field_hash="test_hash", target_torsion_smirks=[], stages=[ @@ -50,7 +50,7 @@ def test_optimize(monkeypatch, redis_connection): OptimizationStageResults( provenance={}, status="success", - refit_force_field=ForceField("openff-2.0.0.offxml").to_string(), + refit_force_field=ForceField("openff-2.2.0.offxml").to_string(), ) ], ) diff --git a/openff/bespokefit/data/schemas/debug.json b/openff/bespokefit/data/schemas/debug.json index cfc98f08..064ace7c 100644 --- a/openff/bespokefit/data/schemas/debug.json +++ b/openff/bespokefit/data/schemas/debug.json @@ -1,5 +1,5 @@ { - "initial_force_field": "openff-2.0.0.offxml", + "initial_force_field": "openff-2.2.0.offxml", "optimizer": { "type": "ForceBalance", "max_iterations": 1, diff --git a/openff/bespokefit/data/schemas/default.json b/openff/bespokefit/data/schemas/default.json index b738fa85..f66f652d 100644 --- a/openff/bespokefit/data/schemas/default.json +++ b/openff/bespokefit/data/schemas/default.json @@ -1,5 +1,5 @@ { - "initial_force_field": "openff_unconstrained-2.0.0.offxml", + "initial_force_field": "openff_unconstrained-2.2.0.offxml", "optimizer": { "type": "ForceBalance", "max_iterations": 10, @@ -100,4 +100,4 @@ "keywords": {} } ] -} \ No newline at end of file +} diff --git a/openff/bespokefit/workflows/bespoke.py b/openff/bespokefit/workflows/bespoke.py index 85f9d835..bda323ab 100644 --- a/openff/bespokefit/workflows/bespoke.py +++ b/openff/bespokefit/workflows/bespoke.py @@ -75,7 +75,7 @@ class BespokeWorkflowFactory(ClassBase): """ initial_force_field: str = Field( - "openff_unconstrained-2.0.0.offxml", + "openff_unconstrained-2.2.0.offxml", description="The name of the unconstrained force field to use as a starting " "point for optimization. The force field must be installed with conda/mamba.", )