Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues with Quantity class #1517

Merged
merged 5 commits into from
Jun 29, 2023
Merged

Fix issues with Quantity class #1517

merged 5 commits into from
Jun 29, 2023

Conversation

speth
Copy link
Member

@speth speth commented Jun 29, 2023

Changes proposed in this pull request

  • Require pressure to be equal when mixing Quantity objects at constant enthalpy and pressure
  • Use the phase-specific "native" state instead of defaulting to temperature, density, and mass fractions
  • Fix addition of Quantity objects when the underlying Solution is set to use a molar property basis
  • Implement set_equivalence_ratio and set_mixture_fraction methods
  • Eliminate set_unnormalized_mass_fractions and set_unnormalized_mole_fractions methods that cannot be robustly implemented.

If applicable, fill in the issue number this pull request is fixing

Closes #1461
Closes #1493
Closes #1446

Checklist

  • The pull request includes a clear description of this code change
  • Commit messages have short titles and reference relevant issues
  • Build passes (scons build & scons test) and unit tests address code coverage
  • Style & formatting of contributed code follows contributing guidelines
  • The pull request is ready for review

The native state is always on a mass basis, which allows switching
between mass and molar basis possible without needing to update
the state stored by the Quantity object
Needing to go through the "native" state for the phase does not
necessarily preserve unnormalized mass and mole fractions.
@speth speth added the Python label Jun 29, 2023
@codecov
Copy link

codecov bot commented Jun 29, 2023

Codecov Report

Merging #1517 (53a0667) into main (36faa94) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1517      +/-   ##
==========================================
+ Coverage   70.42%   70.44%   +0.02%     
==========================================
  Files         375      375              
  Lines       58440    58462      +22     
  Branches    20919    20924       +5     
==========================================
+ Hits        41155    41185      +30     
+ Misses      14262    14254       -8     
  Partials     3023     3023              
Impacted Files Coverage Δ
interfaces/cython/cantera/composite.py 84.68% <100.00%> (+0.63%) ⬆️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@ischoegl ischoegl left a comment

Choose a reason for hiding this comment

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

Thanks … changes all look good to me.

@speth speth merged commit 25fee18 into Cantera:main Jun 29, 2023
@speth speth deleted the fix-quantity branch June 29, 2023 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
2 participants