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.
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.
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.
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.
* 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
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.
* 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.
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.
These differ specifically in the case of sticking reactions, where the
rate coefficient has units like m^3/kmol/s, depending on the reactant
orders while the sticking coefficient itself is dimensionless.