-
-
Notifications
You must be signed in to change notification settings - Fork 350
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
Cantera Units #991
Cantera Units #991
Commits on Apr 22, 2023
-
Implement unit conversion file into Cantera
Template file added to Sconscript to autogenerate code in solution.py.in
Configuration menu - View commit details
-
Copy full SHA for 6cfd088 - Browse repository at this point
Copy the full SHA 6cfd088View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6dabf1a - Browse repository at this point
Copy the full SHA 6dabf1aView commit details -
Create Python examples with units
These examples use the units module to implement the existing examples, but demonstrate how alternative units can be used for the input and output quantities.
Configuration menu - View commit details
-
Copy full SHA for 594e50f - Browse repository at this point
Copy the full SHA 594e50fView commit details -
Configuration menu - View commit details
-
Copy full SHA for b7051d4 - Browse repository at this point
Copy the full SHA b7051d4View commit details -
Refactor PureFluid derived classes as functions
Since the only overridden method was __init__, it makes more sense for these to be functions than subclasses.
Configuration menu - View commit details
-
Copy full SHA for e7a59fa - Browse repository at this point
Copy the full SHA e7a59faView commit details -
Refactor setter and getter templates for units
* To allow setting properties on the upstream classes, __setattr__ is implemented and checks whether the attribute is defined on this class. This requires setting the phase instance directly into the __dict__ attribute to avoid a recursion error. * Class inheritance is not used here because it is not easy to set attributes on the super class. By design, super() does not allow setting properties, only getting. Furthermore, since the base PureFluid class is defined in Cython, the attributes of that class cannot be set by subclasses at all, again by design. * The PureFluid class implemented here does not inherit from the Solution class implemented here because eventually this Solution class will include methods and properties related to kinetics and transport, which are not implemented for PureFluid. The base PureFluid class is a subclass of ThermoPhase only, whereas the base Solution class is a subclass of ThermoPhase, Kinetics, and Transport. * To reflect the distinction between Solution and ThermoPhase, the template variables are renamed. * Several methods of the PureFluid are getters only, despite having three properties. These attributes are fixed here. TPQ is the only three-property attribute with a setter. * Setter methods now raise a CanteraError if the unit conversion to base units fails due to an AttributeError.
Configuration menu - View commit details
-
Copy full SHA for b1fbaf0 - Browse repository at this point
Copy the full SHA b1fbaf0View commit details -
Use numpy.isclose to compare array Quantities
The existing assertArrayNear method was causing units to be stripped from the array Quantities. Avoiding numpy.asarray conversions and using numpy.isclose prevents that from happening.
Configuration menu - View commit details
-
Copy full SHA for 8bf0fbb - Browse repository at this point
Copy the full SHA 8bf0fbbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 94c5908 - Browse repository at this point
Copy the full SHA 94c5908View commit details -
* Remove unnecessary tests of the underlying implementation that duplicate functionality in the upstream tests. * Move some dimensionality tests into the PureFluid tests where the saturation and critical attributes exist. * Remove unused imports
Configuration menu - View commit details
-
Copy full SHA for 4952189 - Browse repository at this point
Copy the full SHA 4952189View commit details -
Configuration menu - View commit details
-
Copy full SHA for b347d0a - Browse repository at this point
Copy the full SHA b347d0aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0755513 - Browse repository at this point
Copy the full SHA 0755513View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4a03313 - Browse repository at this point
Copy the full SHA 4a03313View commit details -
[Doc] Add default python_module key into env
This prevents KeyError failures if sphinx_docs=y and python_package=n
Configuration menu - View commit details
-
Copy full SHA for 3944c32 - Browse repository at this point
Copy the full SHA 3944c32View commit details -
[Units] Add application-level registry
This supports pickling and unpickling of quantities carrying Pint units.
Configuration menu - View commit details
-
Copy full SHA for f3667ab - Browse repository at this point
Copy the full SHA f3667abView commit details -
[Cython] Fix setuptools warning about data
The include_package_data config option is redundant with explicitly listing the package data, so setuptools was generating warnings. Since we explicitly list everything, this can be removed.
Configuration menu - View commit details
-
Copy full SHA for 7ae626e - Browse repository at this point
Copy the full SHA 7ae626eView commit details -
[Cython] Move units package to with_units
The units package shadowed the units Cython module. This made Cython very unhappy and we couldn't import anything from Cantera.
Configuration menu - View commit details
-
Copy full SHA for 590ebde - Browse repository at this point
Copy the full SHA 590ebdeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 443ad26 - Browse repository at this point
Copy the full SHA 443ad26View commit details -
[CI] Run examples from installed wheel
This lets us check whether the wheel is built properly and includes all the files necessary for the package to function.
Configuration menu - View commit details
-
Copy full SHA for 0f43463 - Browse repository at this point
Copy the full SHA 0f43463View commit details -
Configuration menu - View commit details
-
Copy full SHA for cde23e3 - Browse repository at this point
Copy the full SHA cde23e3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2effd6d - Browse repository at this point
Copy the full SHA 2effd6dView commit details -
[Units] Pass through kwargs in constructor
Allow setting the backed of the Water instance. Fix a typo in the R134a instance.
Configuration menu - View commit details
-
Copy full SHA for abd8b4b - Browse repository at this point
Copy the full SHA abd8b4bView commit details -
[Units] Refactor setter to use a loop
Rather than checking each value individually with try/except, use the ito method and try to convert within a loop. This simplifies testing for the error condition and looks a little cleaner.
Configuration menu - View commit details
-
Copy full SHA for cf4c134 - Browse repository at this point
Copy the full SHA cf4c134View commit details -
Configuration menu - View commit details
-
Copy full SHA for dfec96f - Browse repository at this point
Copy the full SHA dfec96fView commit details -
[Units/Test] Refactor test suite to use pytest
This increases the line coverage to near 100%, uses pint's testing assertions rather than rolling our own, and uses parameterize extensively to reduce boilerplate in testing as many properties as possible.
Configuration menu - View commit details
-
Copy full SHA for db403b4 - Browse repository at this point
Copy the full SHA db403b4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7e89b03 - Browse repository at this point
Copy the full SHA 7e89b03View commit details -
Configuration menu - View commit details
-
Copy full SHA for 966a249 - Browse repository at this point
Copy the full SHA 966a249View commit details -
Most of the docs are copied from the upstream object. Some updates are included for units.
Configuration menu - View commit details
-
Copy full SHA for 9d1b533 - Browse repository at this point
Copy the full SHA 9d1b533View commit details -
Configuration menu - View commit details
-
Copy full SHA for 12a6cb4 - Browse repository at this point
Copy the full SHA 12a6cb4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1ae4556 - Browse repository at this point
Copy the full SHA 1ae4556View commit details -
[CI] Add --pre option to sample installation step
This is required to find the version of Cantera in the dist folder. By default, pip only finds stable versions, and in this case, was going out to PyPI to find Cantera rather than use the local artifact. However, we can't set --no-index because we also need to install other dependencies from PyPI.
Configuration menu - View commit details
-
Copy full SHA for e6941bf - Browse repository at this point
Copy the full SHA e6941bfView commit details -
[CI] Don't use PyPI index when installing Cantera
Ensure that we only install the wheel from the archive and don't accidentally reach out to PyPI.
Configuration menu - View commit details
-
Copy full SHA for 6b554c7 - Browse repository at this point
Copy the full SHA 6b554c7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 582ef72 - Browse repository at this point
Copy the full SHA 582ef72View commit details -
Configuration menu - View commit details
-
Copy full SHA for 085480c - Browse repository at this point
Copy the full SHA 085480cView commit details -
Apply suggestions from code review
Co-authored-by: Ray Speth <yarmond@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for e382c2a - Browse repository at this point
Copy the full SHA e382c2aView commit details
Commits on Apr 23, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 094d5fa - Browse repository at this point
Copy the full SHA 094d5faView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0f9167b - Browse repository at this point
Copy the full SHA 0f9167bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5396e79 - Browse repository at this point
Copy the full SHA 5396e79View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7459ec3 - Browse repository at this point
Copy the full SHA 7459ec3View commit details -
Configuration menu - View commit details
-
Copy full SHA for ee8bdb6 - Browse repository at this point
Copy the full SHA ee8bdb6View commit details
Commits on Apr 24, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 3ba8aec - Browse repository at this point
Copy the full SHA 3ba8aecView commit details
Commits on Apr 25, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 644bc79 - Browse repository at this point
Copy the full SHA 644bc79View commit details