Skip to content

Convert OptimizationResult.input_data to the requested version in convert_v - #416

Merged
loriab merged 7 commits into
masterfrom
opt_v12
Oct 14, 2026
Merged

loriab merged 7 commits into
masterfrom
opt_v12

Conversation

@bennybp

@bennybp bennybp commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Description

v2 OptimizationResult.convert_v always converted the nested input_data with convert_v(1), even when the target was QCEL_V1V2_SHIM_CODE. On Python 3.14, where QCSchema v1 models cannot be instantiated, converting an optimization result to the v1v2 shim therefore failed with "QCSchema v1 model 'Molecule' cannot be instantiated". QCFractal's compute workers do exactly this conversion, so every optimization they ran on 3.14 errored.

Changelog description

Status

  • Code base linted
  • Ready to go

bennybp and others added 7 commits October 13, 2026 14:11
…vert_v

v2 OptimizationResult.convert_v always converted the nested input_data with
convert_v(1), even when the target was QCEL_V1V2_SHIM_CODE. On Python 3.14,
where QCSchema v1 models cannot be instantiated, converting an optimization
result to the v1v2 shim therefore failed with "QCSchema v1 model 'Molecule'
cannot be instantiated". QCFractal's compute workers do exactly this
conversion, so every optimization they ran on 3.14 errored.

Pass target_version through, as AtomicResult.convert_v already does, and add
a test of the v2 -> shim conversion.

Assisted-by: claude-code/2.1.295:claude-opus-5-5
Signed-off-by: Benjamin Pritchard <ben@bennyp.org>
qcelemental.models only imports _v1v2 on Python 3.14+, so on older Pythons
qcel.models._v1v2 exists only once something else has imported it. The test
passed locally only because an installed pytest plugin (qcarchivetesting)
pulls in QCEngine, which imports the shim; in a clean environment it failed
with "module 'qcelemental.models' has no attribute '_v1v2'". Import it in the
test as real callers such as QCEngine do.

Assisted-by: claude-code/2.1.295:claude-opus-5-5
Signed-off-by: Benjamin Pritchard <ben@bennyp.org>
Updated Python versions in compatibility workflow and commented out conditional sed commands for Py-314.
Added changelog entries for version 0.51.3 including enhancements and miscellaneous updates.
@loriab
loriab merged commit ca4939a into master Oct 14, 2026
22 checks passed
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.

2 participants