Skip to content

make enthalpy_units required in Python API#78

Merged
markleader merged 2 commits into
nasa:mainfrom
markleader:fix/explicit_enthalpy_units
May 12, 2026
Merged

make enthalpy_units required in Python API#78
markleader merged 2 commits into
nasa:mainfrom
markleader:fix/explicit_enthalpy_units

Conversation

@markleader
Copy link
Copy Markdown
Contributor

@markleader markleader commented May 12, 2026

Summary

Finalize the Python Reactant.enthalpy_units migration by removing the implicit legacy fallback when enthalpy is provided without units. Closes #65.

This makes enthalpy_units required whenever Reactant.enthalpy is passed, updates the typed Python surface and docs to match, and replaces the transitional warning-based regression with the new error behavior.

Changes

  • Update cea.Reactant in the Python binding to raise ValueError when enthalpy is provided without enthalpy_units
  • Keep explicit-unit handling unchanged for supported molar and weight-based unit spellings
  • Preserve the existing molecular_weight requirement for weight-based enthalpy units and the no-molecular_weight path for molar units
  • Update the Python type stubs so overloads reflect the required-units contract
  • Replace the warning regression test with a required-units failure regression
  • Update Python docs and the RP-1311 Example 5 docs to describe the finalized required-units behavior
  • Update CHANGELOG.md to record the breaking Python API change

Testing

Compatibility / Numerical behavior

  • No expected changes to numerical results
  • Expected changes (explain and provide validation)

This is an intentional Python API break: Reactant(enthalpy=...) without enthalpy_units=... now raises ValueError instead of falling back to implicit J/kg.

For callers already providing explicit enthalpy units, no numerical behavior is intended to change.

@markleader markleader merged commit 77e0999 into nasa:main May 12, 2026
22 checks passed
@markleader markleader deleted the fix/explicit_enthalpy_units branch May 12, 2026 15:10
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.

Require explicit enthalpy_units for Python Reactant enthalpy input

1 participant