Repository navigation
Fix pydantic v2/qcportal v0.70 errors (j-wags' version) - #398
Conversation
#395) QCPortal 0.70's Specification/NewEntry classes are native pydantic v2, so passing qcsubmit's internal pydantic-v1 objects (Molecule, protocols, attributes, constraints) into them directly no longer validates or serializes correctly. Convert with .dict() before crossing the boundary, and use qcelemental's convert_v(1) when reading a server-fetched molecule back into qcsubmit's own strict v1 Molecule model. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
for more information, see https://pre-commit.ci
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
The molecule read-path fix in results.py relies on qcelemental's Molecule.convert_v(), which was only introduced with the pydantic-v2 dual v1/v2 schema rewrite landing in qcelemental 0.50.0 (the prior floor, 0.25.1, predates it entirely). qcportal is left unpinned: the .dict()-based write-path fixes in datasets.py validate fine against both pydantic-v1 (pre-0.70) and pydantic-v2 (0.70+) qcportal Specification/NewEntry classes, and convert_v() doesn't depend on qcportal's version either, so nothing here has been verified to actually require qcportal>=0.70 -- only tested against the 0.70 installed in this dev env. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…mit into qcp70_fix_jw
There was a problem hiding this comment.
(removing approval) It looks mostly good, except that QCElemental through psi4 produces numpy arrays that fail to serialize in QCSubmit's JSON serializer. This needs to be resolved.
It seems this could be resolved by either making an altered BaseModel class in _pydantic.py or JSONSerializer in serializers.py
|
Thanks for removing approval - I always feel bad when I have to do that, but it's my fault for requesting review with failing CI. Sorry about that! |
NP, I should have checked that before approving |
|
I dug into this, and I think @bennybp beat me to the punch - The last remaining CI error is due to a serialization issue with |
|
CI now pulls QCElemental 0.51.2 and all tests pass :-) |
jaclark5
left a comment
There was a problem hiding this comment.
[not blocking] update qcelemental pins to 0.50.2
Other than this, looks great!
Co-authored-by: Jennifer A Clark <jennifer.a.clark13@gmail.com>
Description
Carries forward changes from #396 and updates other interfaces for new QCPortal/QCElemental
Closes #395
Status