diff --git a/devtools/conda-envs/examples.yaml b/devtools/conda-envs/examples.yaml index a06b6f66e..b30766b09 100644 --- a/devtools/conda-envs/examples.yaml +++ b/devtools/conda-envs/examples.yaml @@ -31,6 +31,7 @@ dependencies: - toml - bson - msgpack-python + - pydantic =2 - qcelemental - qcportal >=0.50 - qcengine diff --git a/devtools/conda-envs/test_env.yaml b/devtools/conda-envs/test_env.yaml index 11cc9bc56..a02d92031 100644 --- a/devtools/conda-envs/test_env.yaml +++ b/devtools/conda-envs/test_env.yaml @@ -35,7 +35,7 @@ dependencies: - toml - bson - msgpack-python - - pydantic + - pydantic =2 - qcelemental - qcportal >=0.50 - qcengine diff --git a/devtools/conda-envs/test_env_no_openeye.yaml b/devtools/conda-envs/test_env_no_openeye.yaml index d49dddb39..8d3528ef5 100644 --- a/devtools/conda-envs/test_env_no_openeye.yaml +++ b/devtools/conda-envs/test_env_no_openeye.yaml @@ -32,7 +32,7 @@ dependencies: - toml - bson - msgpack-python - - pydantic + - pydantic =2 - qcelemental - qcportal >=0.50 - qcengine diff --git a/examples/QCArchive_interface/QCarchive_interface.ipynb b/examples/QCArchive_interface/QCarchive_interface.ipynb index 28b61dee1..59f54260e 100644 --- a/examples/QCArchive_interface/QCarchive_interface.ipynb +++ b/examples/QCArchive_interface/QCarchive_interface.ipynb @@ -562,7 +562,7 @@ } ], "source": [ - "entry.dict()" + "entry.model_dump()" ] }, { @@ -590,7 +590,7 @@ "molecule_from_entry = Molecule.from_qcschema(entry)\n", "\n", "# we could have also used the dictionary representation of the object\n", - "molecule_from_dict = Molecule.from_qcschema(entry.dict())\n", + "molecule_from_dict = Molecule.from_qcschema(entry.model_dump())\n", "\n", "assert molecule_from_entry == molecule_from_dict\n", "\n", diff --git a/openff/toolkit/_tests/test_molecule.py b/openff/toolkit/_tests/test_molecule.py index db6c9ca50..ecf6f7b00 100644 --- a/openff/toolkit/_tests/test_molecule.py +++ b/openff/toolkit/_tests/test_molecule.py @@ -3296,7 +3296,7 @@ def test_qcschema_molecule_record_round_trip_from_to_from(self): "Molecule roundtrip to/from_qcschema failed", ) - mol_dict = off_qcschema.dict() + mol_dict = off_qcschema.model_dump() del mol_dict["extras"]["canonical_isomeric_explicit_hydrogen_mapped_smiles"] del mol_dict["identifiers"]["canonical_isomeric_explicit_hydrogen_mapped_smiles"] with pytest.raises(MissingCMILESError): diff --git a/openff/toolkit/topology/molecule.py b/openff/toolkit/topology/molecule.py index 285e228e3..aa16cd819 100644 --- a/openff/toolkit/topology/molecule.py +++ b/openff/toolkit/topology/molecule.py @@ -4705,7 +4705,7 @@ def from_qcschema( # Process input as dict; convert if necessary if not isinstance(qca_object, dict): try: - qca_object = qca_object.dict() + qca_object = qca_object.model_dump() except AttributeError: raise AttributeError( f"The input object (type {type(qca_object)=} "