Skip to content

Add support for QCSchema v2 and test on Python 3.14 - #2238

Merged
mattwthompson merged 10 commits into
mainfrom
test-py314
Sep 28, 2026
Merged

mattwthompson merged 10 commits into
mainfrom
test-py314

Conversation

@mattwthompson

@mattwthompson mattwthompson commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

Closes #2130

@codecov

codecov Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.08%. Comparing base (f4566b8) to head (5794ab4).

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

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

This comment was marked as resolved.

@mattwthompson
mattwthompson marked this pull request as ready for review September 18, 2026 19:13
@j-wags j-wags assigned j-wags and unassigned mattwthompson Sep 22, 2026
@j-wags j-wags changed the title Test on Python 3.14 Add support for QCSchema v2 and test on Python 3.14 Sep 25, 2026
Comment thread openff/toolkit/topology/molecule.py Outdated
return qcel.models.Molecule.from_data(schema_dict, validate=True)
try:
return qcel.models.v2.Molecule.from_data(schema_dict, validate=True)
except AttributeError: # other errors to capture here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This could be tightened up with something hasattr(qcel.models, "v2") instead.

@j-wags j-wags left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These changes break qcsubmit by changing the return type of to_qcschema [1]. So we have some options:

  • Release this and downpin QCSubmit's toolkit version range
  • Modify to_qcschema in this PR to add a kwarg returning v1 or v2 qcelemental molecules, and default to v1.
    • Or add the kwarg but have it default to v2, and update qcsubmit to request v1
    • Add a deprecation warning?
  • Coordinate this release with an update of QCSubmit to expect v2 models (I think this may be impossible as qcportal doesn't yet accept v2 models)

This all assumes that these changes are required for testing python 3.14. I haven't wrapped my head around that yet.

[1] In a dev environment from qcsubmit main and this branch of the Toolkit:

pytest -v openff/qcsubmit/_tests/test_submissions.py -k "test_basic_submissions_single_spec"

yields

...
FAILED openff/qcsubmit/_tests/test_submissions.py::test_basic_submissions_single_spec[RDKit UFF gradient] - pydantic.v1.error_wrappers.ValidationError: 18 validation errors for DatasetEntry
...

while this passes using openff-toolkit main

@j-wags

j-wags commented Sep 25, 2026

Copy link
Copy Markdown
Member

After some thought, I think a good path forward could be

  • Check whether qcportal accepts v2 models,
    • If it does go with the third option above (keep the updates here to produce v2 models, update qcsubmit to (only?) accept v2 models)
    • If it doesn't then have to_qcschema continue to return v1 models (without adding an option to produce v2), and when qcportal is ready then switch everything over to v2 models.

@j-wags

j-wags commented Sep 25, 2026

Copy link
Copy Markdown
Member

Update: There is no way to have the OFF Toolkit install with python 3.14 and NOT output v2 qcelemental models.

So versions of QCSubmit which can not accept v2 qcel models (all current ones) need to pin to older openff toolkits.

Given that, we should just update openff toolkit to always output v2 qcel models (in this PR, that means we should remove the fallback to v1 models if v2 can't be made). Then we can remove the pin once we make a version of qcsubmit that can accept v2 models.

@j-wags j-wags left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for working through the options on this with me @mattwthompson!

@mattwthompson
mattwthompson merged commit cccef07 into main Sep 28, 2026
26 checks passed
@mattwthompson
mattwthompson deleted the test-py314 branch September 28, 2026 19:47
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.

Support Python 3.14

3 participants