Skip to content

Fix pydantic v2/qcportal v0.70 errors (j-wags' version) - #398

Merged
j-wags merged 11 commits into
mainfrom
qcp70_fix_jw
Sep 24, 2026
Merged

j-wags merged 11 commits into
mainfrom
qcp70_fix_jw

Conversation

@j-wags

@j-wags j-wags commented Aug 25, 2026 •

Copy link
Copy Markdown
Member

Description

Carries forward changes from #396 and updates other interfaces for new QCPortal/QCElemental

Closes #395

Status

  • Ready to go

bennybp and others added 4 commits August 19, 2026 15:42
#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>
@codecov

codecov Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.57%. Comparing base (eb7c869) to head (3d6b17a).

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@j-wags
j-wags marked this pull request as ready for review August 26, 2026 00:15
j-wags and others added 4 commits August 26, 2026 06:48
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>

@jaclark5 jaclark5 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copilot stopped work on behalf of jaclark5 due to an error September 8, 2026 22:09
Copilot AI requested a review from jaclark5 September 8, 2026 22:09

@jaclark5 jaclark5 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(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

@j-wags

j-wags commented Sep 15, 2026

Copy link
Copy Markdown
Member Author

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!

@jaclark5

Copy link
Copy Markdown
Contributor

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

@j-wags

j-wags commented Sep 16, 2026

Copy link
Copy Markdown
Member Author

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 driver="properties" calculations, where the qcfractalcompute worker tries to apply a serializer that can handle numpy arrays but doesn't expect dicts containing numpy arrays, and will be fixed by MolSSI/QCElemental#415

@j-wags

j-wags commented Sep 17, 2026

Copy link
Copy Markdown
Member Author

CI now pulls QCElemental 0.51.2 and all tests pass :-)

@jaclark5 jaclark5 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[not blocking] update qcelemental pins to 0.50.2

Other than this, looks great!

Comment thread devtools/conda-envs/basic.yaml Resolved
Comment thread devtools/conda-envs/psi4.yaml Resolved
j-wags and others added 2 commits September 22, 2026 07:55
Co-authored-by: Jennifer A Clark <jennifer.a.clark13@gmail.com>
@j-wags
j-wags merged commit 9b59556 into main Sep 24, 2026
9 checks passed
@j-wags j-wags mentioned this pull request Sep 25, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update for QCFractal 0.70

3 participants