API reference¶
Autogenerated reference for the documented public encomp modules. The core modules (encomp.units, encomp.utypes, encomp.fluids, encomp.coolprop) are listed first. encomp.sympy is included for existing users, but is legacy and planned for removal in a future major release.
encomp.units¶
Imports and extends the pint library for physical units.
Always import this module when working with encomp (most other modules
will import this one).
Implements a type-aware system on top of pint that verifies
that the dimensionality of the unit is correct.
- CUSTOM_DIMENSIONS: list[str] = ['currency', 'normal']¶
Names of the registered custom base dimensions. The entries defined out of the box match the custom-dimension section of
defs/units.txt;define_dimensionality()appends every dimensionality it defines.
- exception DimensionalityComparisonError(msg='')[source]¶
Bases:
_DimensionalityErrorRaised when an ordering comparison has incompatible dimensionality.
- Parameters:
msg (str)
- Return type:
None
- exception DimensionalityError(units1, units2, dim1='', dim2='', extra_msg='')[source]¶
Bases:
PintTypeErrorRaised when trying to convert between incompatible units.
- Parameters:
units1 (Any)
units2 (Any)
dim1 (str)
dim2 (str)
extra_msg (str)
- Return type:
None
- dim1: str = ''¶
- dim2: str = ''¶
- extra_msg: str = ''¶
- units1: Any¶
- units2: Any¶
- exception DimensionalityRedefinitionError[source]¶
Bases:
ValueErrorRaised when defining a dimensionality that already exists.
- exception DimensionalityTypeError(msg='')[source]¶
Bases:
_DimensionalityErrorRaised when two semantic dimensionality classes are not compatible.
- Parameters:
msg (str)
- Return type:
None
- exception ExpectedDimensionalityError(msg='')[source]¶
Bases:
_DimensionalityErrorRaised when a quantity cannot be reinterpreted as a requested dimensionality.
- Parameters:
msg (str)
- Return type:
None
- class Quantity(val, unit=None, _depth=0)[source]¶
Bases:
NumpyQuantity[Any],NonMultiplicativeQuantity[Any],MeasurementQuantity[Any],Generic[DT,MT]Physical quantity with a magnitude, unit, dimensionality, and magnitude type.
Quantityextends Pint’s quantity type with runtime dimensionality subclasses (for exampleQuantity[Pressure, float]) and magnitude containers such asfloat, numpy arrays, PolarsSeriesand PolarsExpr. Construction validates that the unit’s physical dimensions match the requested dimensionality subclass.Absolute temperature and temperature-difference quantities deliberately remain separate dimensionality types even though both have Pint dimension
[temperature]. Useto()for unit conversion andasdim()only for explicit semantic reinterpretation between compatible dimensionality classes.- Parameters:
val (Any)
unit (Any)
_depth (int)
- Return type:
Quantity[Any, Any]
- FORMATTING_SPECS = ('~P', '~L', '~H', '~Lx')¶
- NORMAL_M3_VARIANTS = ('nm³', 'Nm³', 'nm3', 'Nm3', 'nm**3', 'Nm**3', 'nm^3', 'Nm^3')¶
- PINT_PRESENTATION_SPECS: ClassVar[tuple[str, ...]] = ('raw', 'Lx', 'D', 'H', 'P', 'L', 'C')¶
- TEMPERATURE_DIFFERENCE_UCS = (<UnitsContainer({'delta_kelvin': 1})>, <UnitsContainer({'delta_degree_Celsius': 1})>, <UnitsContainer({'delta_degree_Fahrenheit': 1})>, <UnitsContainer({'delta_degree_Reaumur': 1})>)¶
- asdim(other)[source]¶
Return this quantity reinterpreted as another dimensionality class.
othercan be a dimensionality class or another quantity whose dimensionality should be used. This is not a unit conversion: it succeeds only when the source and target have the same physical dimensions. ForTemperatureDifference, offset temperature units such asdegCare rewritten to their delta units (delta_degC) so the result cannot be confused with an absolute temperature.- Return type:
Quantity[UnknownDimensionality]- Parameters:
other (type[DT_] | Quantity[UnknownDimensionality])
- astype(magnitude_type)[source]¶
- Overloads:
self, magnitude_type (Literal[‘float’]) → Quantity[DT, float]
self, magnitude_type (Literal[‘ndarray’]) → Quantity[DT, Numpy1DArray]
self, magnitude_type (Literal[‘pl.Expr’]) → Quantity[DT, pl.Expr]
self, magnitude_type (Literal[‘pl.Series’]) → Quantity[DT, pl.Series]
self, magnitude_type (type[MT_] | MagnitudeTypeName) → Quantity[DT, MT_]
- Parameters:
magnitude_type (type[Any] | Literal['float', 'ndarray', 'pl.Series', 'pl.Expr'])
- Return type:
Quantity[UnknownDimensionality]
Return this quantity with its magnitude converted to another container type.
magnitude_typeacceptsfloat, numpy array, PolarsSeries, PolarsExpr, or the corresponding string names. Units and dimensionality are unchanged. Converting topl.Expris only defined for scalar quantities, which become a literal expression.
- atol: float = 1e-12¶
- check(dimension)[source]¶
Return whether this quantity has the same physical dimensions as
dimension.This intentionally compares dimensions, not semantic dimensionality classes:
TemperatureandTemperatureDifferenceboth have[temperature], and sibling energy-per-mass classes share[energy] / [mass]. Useisinstance/isinstance_typesorcheck_compatibilitywhen that semantic distinction matters.- Return type:
bool- Parameters:
dimension (Quantity[UnknownDimensionality] | UnitsContainer | Unit[DT_] | Unit | str | Dimensionality | type[Dimensionality])
- check_compatibility(other)[source]¶
Raise
DimensionalityTypeErrorunlessothercan be combined with this quantity.Compatibility is semantic, not just dimensional:
TemperatureandTemperatureDifferenceshare[temperature]but are not compatible. A plain number is compatible only with a dimensionless quantity.- Return type:
None- Parameters:
other (Quantity[UnknownDimensionality] | float)
- static correct_unit(unit)[source]¶
Normalize supported unit spelling variants before Pint parses them.
Notably,
Nm3/nm3forms are interpreted as normal cubic meters (normal_cubic_meter), not nanometers cubed. Usenanometer**3when a nanoscale volume is intended.- Return type:
str- Parameters:
unit (str)
- property dt: type[DT]¶
Dimensionality class associated with this quantity.
- classmethod from_expr(expr)[source]¶
Create a scalar quantity from a SymPy expression containing SI unit symbols.
The expression is expected to use the symbols produced by
Quantity._sympy_(). Residual symbols that are not known unit symbols raiseKeyError.- Return type:
Quantity[UnknownDimensionality, float]- Parameters:
expr (Basic)
- get_subclass(dt, mt)[source]¶
Return the
Quantitysubclass for dimensionalitydtand magnitude typemt.- Return type:
type[Quantity[UnknownDimensionality]]- Parameters:
dt (type[DT_])
mt (type[MT_])
- classmethod get_unit(unit_name)[source]¶
Parse
unit_namewith the encomp unit registry and return aUnit.- Return type:
- Parameters:
unit_name (Literal['', '%', 'percent', 'pct', 'mol%', 'mol-%', 'mole%', 'mole-%', 'kg%', 'kg-%', 'm3%', 'm3-%', 'm³%', 'm³-%', 'vol%', 'vol-%', 'volume%', 'volume-%', 'wt%', 'wt-%', 'weight%', 'weight-%', 'ppm', '-', 'dimensionless'] | ~typing.Literal['SEK', 'EUR', 'USD', 'kSEK', 'kEUR', 'kUSD', 'MSEK', 'MEUR', 'MUSD'] | ~typing.Literal['SEK/MWh', 'EUR/MWh', 'SEK/kWh', 'EUR/kWh', 'SEK/GWh', 'EUR/GWh', 'SEK/TWh', 'EUR/TWh'] | ~typing.Literal['SEK/kg', 'EUR/kg', 'SEK/t', 'EUR/t', 'SEK/ton', 'EUR/ton', 'SEK/g', 'EUR/g', 'SEK/mg', 'EUR/mg', 'SEK/ug', 'EUR/ug'] | ~typing.Literal['SEK/L', 'EUR/L', 'SEK/l', 'EUR/l', 'SEK/liter', 'EUR/liter', 'SEK/m3', 'EUR/m3', 'SEK/m^3', 'EUR/m^3', 'SEK/m**3', 'EUR/m**3', 'SEK/m³', 'EUR/m³'] | ~typing.Literal['SEK/h', 'EUR/h', 'SEK/hr', 'EUR/hr', 'SEK/hour', 'EUR/hour', 'SEK/d', 'EUR/d', 'SEK/day', 'EUR/day', 'SEK/week', 'EUR/week', 'SEK/yr', 'EUR/yr', 'SEK/year', 'EUR/year', 'SEK/a', 'EUR/a'] | ~typing.Literal['m', 'meter', 'km', 'cm', 'mm', 'um'] | ~typing.Literal['kg', 'g', 'ton', 'tonne', 't', 'mg', 'ug'] | ~typing.Literal['s', 'second', 'min', 'minute', 'h', 'hr', 'hour', 'd', 'day', 'week', 'yr', 'a', 'year', 'ms', 'us'] | ~typing.Literal['Hz', 'kHz', 'MHz', 'GHz', 'rpm', '1/s'] | ~typing.Literal['degC', '°C', 'K', 'degF', '°F', '℃', '℉'] | ~typing.Literal['delta_K', 'ΔK', 'delta_°C', 'delta_degC', 'Δ°C', 'Δ℃', 'delta_°F', 'delta_degF', 'Δ°F', 'Δ℉'] | ~typing.Literal['mol', 'kmol'] | ~typing.Literal['g/mol', 'kg/mol', 'kg/kmol'] | ~typing.Literal['mol/g', 'kmol/kg'] | ~typing.Literal['A', 'mA'] | ~typing.Literal['cd', 'lm'] | ~typing.Literal['m2', 'm^2', 'm**2', 'm²', 'cm2', 'cm^2', 'cm**2', 'cm²'] | ~typing.Literal['L', 'l', 'liter', 'm3', 'm^3', 'm³', 'm**3', 'dm3', 'dm^3', 'dm³', 'dm**3', 'cm3', 'cm^3', 'cm³', 'cm**3'] | ~typing.Literal['normal liter', 'Nm3', 'nm3', 'Nm^3', 'nm^3', 'Nm³', 'nm³', 'Nm**3', 'nm**3'] | ~typing.Literal['bar', 'kPa', 'Pa', 'MPa', 'mbar', 'mmHg', 'torr', 'psi', 'atm', 'N/m2', 'N/m^2', 'N/m**2', 'N/m²'] | ~typing.Literal['kg/s', 'kg/h', 'kg/hr', 'g/s', 'g/h', 'g/hr', 'ton/h', 't/h', 'ton/hr', 't/hr', 't/d', 'ton/day', 'ton/week', 't/a', 't/year', 'ton/a', 'ton/year'] | ~typing.Literal['m3/s', 'm3/h', 'm3/hr', 'm**3/s', 'm**3/h', 'm**3/hr', 'm^3/s', 'm^3/h', 'm^3/hr', 'm³/s', 'm³/h', 'm³/hr', 'liter/second', 'l/s', 'L/s', 'liter/s', 'liter/hour', 'l/h', 'L/h', 'L/hr', 'l/hr'] | ~typing.Literal['Nm3/s', 'Nm3/h', 'Nm3/hr', 'nm3/s', 'nm3/h', 'nm3/hr', 'Nm^3/s', 'Nm^3/h', 'Nm^3/hr', 'nm^3/s', 'nm^3/h', 'nm^3/hr', 'Nm³/s', 'Nm³/h', 'Nm³/hr', 'nm³/s', 'nm³/h', 'nm³/hr', 'Nm**3/s', 'Nm**3/h', 'Nm**3/hr', 'nm**3/s', 'nm**3/h', 'nm**3/hr'] | ~typing.Literal['kg/m3', 'kg/m**3', 'kg/m^3', 'kg/m³', 'kg/liter', 'g/l', 'g/L', 'gram/liter', 'g/cm3', 'g/cm**3', 'g/cm^3', 'g/cm³'] | ~typing.Literal['mol/m3', 'mol/m**3', 'mol/m^3', 'mol/m³', 'kmol/m3', 'kmol/m**3', 'kmol/m^3', 'kmol/m³', 'mol/l', 'mol/L'] | ~typing.Literal['m3/kg', 'm^3/kg', 'm³/kg', 'l/g', 'L/g'] | ~typing.Literal['Nm3/kg', 'Nm^3/kg', 'Nm³/kg', 'nm3/kg', 'nm^3/kg', 'nm³/kg'] | ~typing.Literal['kg/Nm3', 'kg/Nm^3', 'kg/Nm³', 'kg/nm3', 'kg/nm^3', 'kg/nm³', 'g/Nm3', 'g/Nm^3', 'g/Nm³'] | ~typing.Literal['J', 'kJ', 'MJ', 'GJ', 'TJ', 'PJ', 'kWh', 'MWh', 'Wh', 'GWh', 'TWh'] | ~typing.Literal['W', 'kW', 'MW', 'GW', 'TW', 'mW', 'kWh/d', 'kWh/yr', 'kWh/year', 'MWh/d', 'MWh/yr', 'MWh/year', 'GWh/d', 'GWh/yr', 'GWh/year', 'TWh/d', 'TWh/yr', 'TWh/year'] | ~typing.Literal['W/m2', 'W/m^2', 'W/m**2', 'W/m²', 'kW/m2', 'kW/m^2', 'kW/m**2', 'kW/m²'] | ~typing.Literal['m/s', 'km/s', 'm/min', 'cm/s', 'cm/min', 'km/h', 'kmh', 'kph'] | ~typing.Literal['N', 'kN', 'mN'] | ~typing.Literal['Pa*s', 'Pa s', 'cP'] | ~typing.Literal['m2/s', 'm**2/s', 'm^2/s', 'm²/s', 'cSt', 'cm2/s', 'cm**2/s', 'cm^2/s', 'cm²/s'] | ~typing.Literal['MJ/kg', 'MWh/kg', 'kJ/kg', 'kWh/kg', 'J/kg', 'J/g', 'MJ/t', 'MWh/t', 'kJ/t', 'kWh/t', 'MJ/ton', 'MWh/ton', 'kJ/ton', 'kWh/ton'] | ~typing.Literal['J/mol', 'kJ/mol', 'J/kmol', 'kJ/kmol', 'MJ/kmol'] | ~typing.Literal['kJ/kg/K', 'kJ/kg/delta_degC', 'kJ/kg/Δ°C', 'kJ/kg/Δ℃', 'kJ/kg/°C', 'kJ/kg/℃', 'kJ/kg/degC', 'J/kg/K', 'J/kg/delta_degC', 'J/kg/Δ°C', 'J/kg/Δ℃', 'J/kg/°C', 'J/kg/℃', 'J/kg/degC', 'J/g/K', 'J/g/delta_degC', 'J/g/Δ°C', 'J/g/Δ℃', 'J/g/°C', 'J/g/℃', 'J/g/degC'] | ~typing.Literal['W/m/K', 'W/m/delta_degC', 'W/m/Δ°C', 'W/m/Δ℃', 'kW/m/K', 'mW/m/K'] | ~typing.Literal['W/m2/K', 'W/m^2/K', 'W/m**2/K', 'W/m²/K', 'W/m2/delta_degC', 'W/m^2/delta_degC', 'W/m**2/delta_degC', 'W/m²/delta_degC', 'W/m2/Δ°C', 'W/m^2/Δ°C', 'W/m**2/Δ°C', 'W/m²/Δ°C', 'kW/m2/K', 'kW/m^2/K', 'kW/m**2/K', 'kW/m²/K'] | str)
- static get_unknown_dimensionality_subclass()[source]¶
Return the magnitude-agnostic quantity subclass with unknown dimensionality.
- Return type:
type[Quantity[UnknownDimensionality]]
- is_compatible_with(other, *contexts, **ctx_kwargs)[source]¶
Whether
otheris convertible to this quantity’s unit andcheck_compatibility()passes.- Return type:
bool- Parameters:
other (Quantity[UnknownDimensionality] | float)
contexts (Any)
ctx_kwargs (Any)
- property is_scalar: bool¶
Whether the magnitude is a scalar (
float) rather than a container.
- ito(unit)[source]¶
Convert this quantity in place to
unit.Like
to(), this preserves the dimensionality type and applies the same temperature-vs-temperature-difference checks. Integer numpy magnitudes may be copied to floating point before conversion so unit scaling cannot fail due to integer casting rules.- Return type:
None- Parameters:
unit (Literal['', '%', 'percent', 'pct', 'mol%', 'mol-%', 'mole%', 'mole-%', 'kg%', 'kg-%', 'm3%', 'm3-%', 'm³%', 'm³-%', 'vol%', 'vol-%', 'volume%', 'volume-%', 'wt%', 'wt-%', 'weight%', 'weight-%', 'ppm', '-', 'dimensionless'] | ~typing.Literal['SEK', 'EUR', 'USD', 'kSEK', 'kEUR', 'kUSD', 'MSEK', 'MEUR', 'MUSD'] | ~typing.Literal['SEK/MWh', 'EUR/MWh', 'SEK/kWh', 'EUR/kWh', 'SEK/GWh', 'EUR/GWh', 'SEK/TWh', 'EUR/TWh'] | ~typing.Literal['SEK/kg', 'EUR/kg', 'SEK/t', 'EUR/t', 'SEK/ton', 'EUR/ton', 'SEK/g', 'EUR/g', 'SEK/mg', 'EUR/mg', 'SEK/ug', 'EUR/ug'] | ~typing.Literal['SEK/L', 'EUR/L', 'SEK/l', 'EUR/l', 'SEK/liter', 'EUR/liter', 'SEK/m3', 'EUR/m3', 'SEK/m^3', 'EUR/m^3', 'SEK/m**3', 'EUR/m**3', 'SEK/m³', 'EUR/m³'] | ~typing.Literal['SEK/h', 'EUR/h', 'SEK/hr', 'EUR/hr', 'SEK/hour', 'EUR/hour', 'SEK/d', 'EUR/d', 'SEK/day', 'EUR/day', 'SEK/week', 'EUR/week', 'SEK/yr', 'EUR/yr', 'SEK/year', 'EUR/year', 'SEK/a', 'EUR/a'] | ~typing.Literal['m', 'meter', 'km', 'cm', 'mm', 'um'] | ~typing.Literal['kg', 'g', 'ton', 'tonne', 't', 'mg', 'ug'] | ~typing.Literal['s', 'second', 'min', 'minute', 'h', 'hr', 'hour', 'd', 'day', 'week', 'yr', 'a', 'year', 'ms', 'us'] | ~typing.Literal['Hz', 'kHz', 'MHz', 'GHz', 'rpm', '1/s'] | ~typing.Literal['degC', '°C', 'K', 'degF', '°F', '℃', '℉'] | ~typing.Literal['delta_K', 'ΔK', 'delta_°C', 'delta_degC', 'Δ°C', 'Δ℃', 'delta_°F', 'delta_degF', 'Δ°F', 'Δ℉'] | ~typing.Literal['mol', 'kmol'] | ~typing.Literal['g/mol', 'kg/mol', 'kg/kmol'] | ~typing.Literal['mol/g', 'kmol/kg'] | ~typing.Literal['A', 'mA'] | ~typing.Literal['cd', 'lm'] | ~typing.Literal['m2', 'm^2', 'm**2', 'm²', 'cm2', 'cm^2', 'cm**2', 'cm²'] | ~typing.Literal['L', 'l', 'liter', 'm3', 'm^3', 'm³', 'm**3', 'dm3', 'dm^3', 'dm³', 'dm**3', 'cm3', 'cm^3', 'cm³', 'cm**3'] | ~typing.Literal['normal liter', 'Nm3', 'nm3', 'Nm^3', 'nm^3', 'Nm³', 'nm³', 'Nm**3', 'nm**3'] | ~typing.Literal['bar', 'kPa', 'Pa', 'MPa', 'mbar', 'mmHg', 'torr', 'psi', 'atm', 'N/m2', 'N/m^2', 'N/m**2', 'N/m²'] | ~typing.Literal['kg/s', 'kg/h', 'kg/hr', 'g/s', 'g/h', 'g/hr', 'ton/h', 't/h', 'ton/hr', 't/hr', 't/d', 'ton/day', 'ton/week', 't/a', 't/year', 'ton/a', 'ton/year'] | ~typing.Literal['m3/s', 'm3/h', 'm3/hr', 'm**3/s', 'm**3/h', 'm**3/hr', 'm^3/s', 'm^3/h', 'm^3/hr', 'm³/s', 'm³/h', 'm³/hr', 'liter/second', 'l/s', 'L/s', 'liter/s', 'liter/hour', 'l/h', 'L/h', 'L/hr', 'l/hr'] | ~typing.Literal['Nm3/s', 'Nm3/h', 'Nm3/hr', 'nm3/s', 'nm3/h', 'nm3/hr', 'Nm^3/s', 'Nm^3/h', 'Nm^3/hr', 'nm^3/s', 'nm^3/h', 'nm^3/hr', 'Nm³/s', 'Nm³/h', 'Nm³/hr', 'nm³/s', 'nm³/h', 'nm³/hr', 'Nm**3/s', 'Nm**3/h', 'Nm**3/hr', 'nm**3/s', 'nm**3/h', 'nm**3/hr'] | ~typing.Literal['kg/m3', 'kg/m**3', 'kg/m^3', 'kg/m³', 'kg/liter', 'g/l', 'g/L', 'gram/liter', 'g/cm3', 'g/cm**3', 'g/cm^3', 'g/cm³'] | ~typing.Literal['mol/m3', 'mol/m**3', 'mol/m^3', 'mol/m³', 'kmol/m3', 'kmol/m**3', 'kmol/m^3', 'kmol/m³', 'mol/l', 'mol/L'] | ~typing.Literal['m3/kg', 'm^3/kg', 'm³/kg', 'l/g', 'L/g'] | ~typing.Literal['Nm3/kg', 'Nm^3/kg', 'Nm³/kg', 'nm3/kg', 'nm^3/kg', 'nm³/kg'] | ~typing.Literal['kg/Nm3', 'kg/Nm^3', 'kg/Nm³', 'kg/nm3', 'kg/nm^3', 'kg/nm³', 'g/Nm3', 'g/Nm^3', 'g/Nm³'] | ~typing.Literal['J', 'kJ', 'MJ', 'GJ', 'TJ', 'PJ', 'kWh', 'MWh', 'Wh', 'GWh', 'TWh'] | ~typing.Literal['W', 'kW', 'MW', 'GW', 'TW', 'mW', 'kWh/d', 'kWh/yr', 'kWh/year', 'MWh/d', 'MWh/yr', 'MWh/year', 'GWh/d', 'GWh/yr', 'GWh/year', 'TWh/d', 'TWh/yr', 'TWh/year'] | ~typing.Literal['W/m2', 'W/m^2', 'W/m**2', 'W/m²', 'kW/m2', 'kW/m^2', 'kW/m**2', 'kW/m²'] | ~typing.Literal['m/s', 'km/s', 'm/min', 'cm/s', 'cm/min', 'km/h', 'kmh', 'kph'] | ~typing.Literal['N', 'kN', 'mN'] | ~typing.Literal['Pa*s', 'Pa s', 'cP'] | ~typing.Literal['m2/s', 'm**2/s', 'm^2/s', 'm²/s', 'cSt', 'cm2/s', 'cm**2/s', 'cm^2/s', 'cm²/s'] | ~typing.Literal['MJ/kg', 'MWh/kg', 'kJ/kg', 'kWh/kg', 'J/kg', 'J/g', 'MJ/t', 'MWh/t', 'kJ/t', 'kWh/t', 'MJ/ton', 'MWh/ton', 'kJ/ton', 'kWh/ton'] | ~typing.Literal['J/mol', 'kJ/mol', 'J/kmol', 'kJ/kmol', 'MJ/kmol'] | ~typing.Literal['kJ/kg/K', 'kJ/kg/delta_degC', 'kJ/kg/Δ°C', 'kJ/kg/Δ℃', 'kJ/kg/°C', 'kJ/kg/℃', 'kJ/kg/degC', 'J/kg/K', 'J/kg/delta_degC', 'J/kg/Δ°C', 'J/kg/Δ℃', 'J/kg/°C', 'J/kg/℃', 'J/kg/degC', 'J/g/K', 'J/g/delta_degC', 'J/g/Δ°C', 'J/g/Δ℃', 'J/g/°C', 'J/g/℃', 'J/g/degC'] | ~typing.Literal['W/m/K', 'W/m/delta_degC', 'W/m/Δ°C', 'W/m/Δ℃', 'kW/m/K', 'mW/m/K'] | ~typing.Literal['W/m2/K', 'W/m^2/K', 'W/m**2/K', 'W/m²/K', 'W/m2/delta_degC', 'W/m^2/delta_degC', 'W/m**2/delta_degC', 'W/m²/delta_degC', 'W/m2/Δ°C', 'W/m^2/Δ°C', 'W/m**2/Δ°C', 'W/m²/Δ°C', 'kW/m2/K', 'kW/m^2/K', 'kW/m**2/K', 'kW/m²/K'] | ~encomp.units.Unit[~encomp.utypes.DT] | ~pint.util.UnitsContainer | str | dict[str, ~numbers.Number])
- property m: MT¶
Magnitude value stored in this quantity.
- m_as(units)[source]¶
Return the magnitude converted to
unit.This is the typed shorthand for
self.to(unit).mand applies exactly the same dimensionality and temperature-safety checks asto().- Return type:
TypeVar(MT,float,ndarray[tuple[int],dtype[float64]],Series,Expr)- Parameters:
units (Literal['', '%', 'percent', 'pct', 'mol%', 'mol-%', 'mole%', 'mole-%', 'kg%', 'kg-%', 'm3%', 'm3-%', 'm³%', 'm³-%', 'vol%', 'vol-%', 'volume%', 'volume-%', 'wt%', 'wt-%', 'weight%', 'weight-%', 'ppm', '-', 'dimensionless'] | ~typing.Literal['SEK', 'EUR', 'USD', 'kSEK', 'kEUR', 'kUSD', 'MSEK', 'MEUR', 'MUSD'] | ~typing.Literal['SEK/MWh', 'EUR/MWh', 'SEK/kWh', 'EUR/kWh', 'SEK/GWh', 'EUR/GWh', 'SEK/TWh', 'EUR/TWh'] | ~typing.Literal['SEK/kg', 'EUR/kg', 'SEK/t', 'EUR/t', 'SEK/ton', 'EUR/ton', 'SEK/g', 'EUR/g', 'SEK/mg', 'EUR/mg', 'SEK/ug', 'EUR/ug'] | ~typing.Literal['SEK/L', 'EUR/L', 'SEK/l', 'EUR/l', 'SEK/liter', 'EUR/liter', 'SEK/m3', 'EUR/m3', 'SEK/m^3', 'EUR/m^3', 'SEK/m**3', 'EUR/m**3', 'SEK/m³', 'EUR/m³'] | ~typing.Literal['SEK/h', 'EUR/h', 'SEK/hr', 'EUR/hr', 'SEK/hour', 'EUR/hour', 'SEK/d', 'EUR/d', 'SEK/day', 'EUR/day', 'SEK/week', 'EUR/week', 'SEK/yr', 'EUR/yr', 'SEK/year', 'EUR/year', 'SEK/a', 'EUR/a'] | ~typing.Literal['m', 'meter', 'km', 'cm', 'mm', 'um'] | ~typing.Literal['kg', 'g', 'ton', 'tonne', 't', 'mg', 'ug'] | ~typing.Literal['s', 'second', 'min', 'minute', 'h', 'hr', 'hour', 'd', 'day', 'week', 'yr', 'a', 'year', 'ms', 'us'] | ~typing.Literal['Hz', 'kHz', 'MHz', 'GHz', 'rpm', '1/s'] | ~typing.Literal['degC', '°C', 'K', 'degF', '°F', '℃', '℉'] | ~typing.Literal['delta_K', 'ΔK', 'delta_°C', 'delta_degC', 'Δ°C', 'Δ℃', 'delta_°F', 'delta_degF', 'Δ°F', 'Δ℉'] | ~typing.Literal['mol', 'kmol'] | ~typing.Literal['g/mol', 'kg/mol', 'kg/kmol'] | ~typing.Literal['mol/g', 'kmol/kg'] | ~typing.Literal['A', 'mA'] | ~typing.Literal['cd', 'lm'] | ~typing.Literal['m2', 'm^2', 'm**2', 'm²', 'cm2', 'cm^2', 'cm**2', 'cm²'] | ~typing.Literal['L', 'l', 'liter', 'm3', 'm^3', 'm³', 'm**3', 'dm3', 'dm^3', 'dm³', 'dm**3', 'cm3', 'cm^3', 'cm³', 'cm**3'] | ~typing.Literal['normal liter', 'Nm3', 'nm3', 'Nm^3', 'nm^3', 'Nm³', 'nm³', 'Nm**3', 'nm**3'] | ~typing.Literal['bar', 'kPa', 'Pa', 'MPa', 'mbar', 'mmHg', 'torr', 'psi', 'atm', 'N/m2', 'N/m^2', 'N/m**2', 'N/m²'] | ~typing.Literal['kg/s', 'kg/h', 'kg/hr', 'g/s', 'g/h', 'g/hr', 'ton/h', 't/h', 'ton/hr', 't/hr', 't/d', 'ton/day', 'ton/week', 't/a', 't/year', 'ton/a', 'ton/year'] | ~typing.Literal['m3/s', 'm3/h', 'm3/hr', 'm**3/s', 'm**3/h', 'm**3/hr', 'm^3/s', 'm^3/h', 'm^3/hr', 'm³/s', 'm³/h', 'm³/hr', 'liter/second', 'l/s', 'L/s', 'liter/s', 'liter/hour', 'l/h', 'L/h', 'L/hr', 'l/hr'] | ~typing.Literal['Nm3/s', 'Nm3/h', 'Nm3/hr', 'nm3/s', 'nm3/h', 'nm3/hr', 'Nm^3/s', 'Nm^3/h', 'Nm^3/hr', 'nm^3/s', 'nm^3/h', 'nm^3/hr', 'Nm³/s', 'Nm³/h', 'Nm³/hr', 'nm³/s', 'nm³/h', 'nm³/hr', 'Nm**3/s', 'Nm**3/h', 'Nm**3/hr', 'nm**3/s', 'nm**3/h', 'nm**3/hr'] | ~typing.Literal['kg/m3', 'kg/m**3', 'kg/m^3', 'kg/m³', 'kg/liter', 'g/l', 'g/L', 'gram/liter', 'g/cm3', 'g/cm**3', 'g/cm^3', 'g/cm³'] | ~typing.Literal['mol/m3', 'mol/m**3', 'mol/m^3', 'mol/m³', 'kmol/m3', 'kmol/m**3', 'kmol/m^3', 'kmol/m³', 'mol/l', 'mol/L'] | ~typing.Literal['m3/kg', 'm^3/kg', 'm³/kg', 'l/g', 'L/g'] | ~typing.Literal['Nm3/kg', 'Nm^3/kg', 'Nm³/kg', 'nm3/kg', 'nm^3/kg', 'nm³/kg'] | ~typing.Literal['kg/Nm3', 'kg/Nm^3', 'kg/Nm³', 'kg/nm3', 'kg/nm^3', 'kg/nm³', 'g/Nm3', 'g/Nm^3', 'g/Nm³'] | ~typing.Literal['J', 'kJ', 'MJ', 'GJ', 'TJ', 'PJ', 'kWh', 'MWh', 'Wh', 'GWh', 'TWh'] | ~typing.Literal['W', 'kW', 'MW', 'GW', 'TW', 'mW', 'kWh/d', 'kWh/yr', 'kWh/year', 'MWh/d', 'MWh/yr', 'MWh/year', 'GWh/d', 'GWh/yr', 'GWh/year', 'TWh/d', 'TWh/yr', 'TWh/year'] | ~typing.Literal['W/m2', 'W/m^2', 'W/m**2', 'W/m²', 'kW/m2', 'kW/m^2', 'kW/m**2', 'kW/m²'] | ~typing.Literal['m/s', 'km/s', 'm/min', 'cm/s', 'cm/min', 'km/h', 'kmh', 'kph'] | ~typing.Literal['N', 'kN', 'mN'] | ~typing.Literal['Pa*s', 'Pa s', 'cP'] | ~typing.Literal['m2/s', 'm**2/s', 'm^2/s', 'm²/s', 'cSt', 'cm2/s', 'cm**2/s', 'cm^2/s', 'cm²/s'] | ~typing.Literal['MJ/kg', 'MWh/kg', 'kJ/kg', 'kWh/kg', 'J/kg', 'J/g', 'MJ/t', 'MWh/t', 'kJ/t', 'kWh/t', 'MJ/ton', 'MWh/ton', 'kJ/ton', 'kWh/ton'] | ~typing.Literal['J/mol', 'kJ/mol', 'J/kmol', 'kJ/kmol', 'MJ/kmol'] | ~typing.Literal['kJ/kg/K', 'kJ/kg/delta_degC', 'kJ/kg/Δ°C', 'kJ/kg/Δ℃', 'kJ/kg/°C', 'kJ/kg/℃', 'kJ/kg/degC', 'J/kg/K', 'J/kg/delta_degC', 'J/kg/Δ°C', 'J/kg/Δ℃', 'J/kg/°C', 'J/kg/℃', 'J/kg/degC', 'J/g/K', 'J/g/delta_degC', 'J/g/Δ°C', 'J/g/Δ℃', 'J/g/°C', 'J/g/℃', 'J/g/degC'] | ~typing.Literal['W/m/K', 'W/m/delta_degC', 'W/m/Δ°C', 'W/m/Δ℃', 'kW/m/K', 'mW/m/K'] | ~typing.Literal['W/m2/K', 'W/m^2/K', 'W/m**2/K', 'W/m²/K', 'W/m2/delta_degC', 'W/m^2/delta_degC', 'W/m**2/delta_degC', 'W/m²/delta_degC', 'W/m2/Δ°C', 'W/m^2/Δ°C', 'W/m**2/Δ°C', 'W/m²/Δ°C', 'kW/m2/K', 'kW/m^2/K', 'kW/m**2/K', 'kW/m²/K'] | ~encomp.units.Unit[~encomp.utypes.DT] | ~pint.util.UnitsContainer | str | dict[str, ~numbers.Number] | ~encomp.units.Quantity[UnknownDimensionality])
- property mt: type[MT]¶
Concrete magnitude container type for this quantity.
- property mt_name: Literal['float', 'ndarray', 'pl.Series', 'pl.Expr']¶
String name for this quantity’s magnitude container type.
- property ndim: int¶
0 for a scalar, 1 for a vector magnitude.
- Type:
Number of magnitude dimensions
- rtol: float = 1e-09¶
- to(unit)[source]¶
Return a new quantity converted to
unit.The returned quantity keeps this quantity’s dimensionality type. The target may be a unit string,
Unit,UnitsContainer, dict accepted by Pint, or another quantity whose unit should be used. Absolute temperatures cannot be converted to delta temperature units, and temperature differences cannot be converted to offset temperature units; useasdim()when that reinterpretation is intentional.- Return type:
Quantity[UnknownDimensionality]- Parameters:
unit (Literal['', '%', 'percent', 'pct', 'mol%', 'mol-%', 'mole%', 'mole-%', 'kg%', 'kg-%', 'm3%', 'm3-%', 'm³%', 'm³-%', 'vol%', 'vol-%', 'volume%', 'volume-%', 'wt%', 'wt-%', 'weight%', 'weight-%', 'ppm', '-', 'dimensionless'] | ~typing.Literal['SEK', 'EUR', 'USD', 'kSEK', 'kEUR', 'kUSD', 'MSEK', 'MEUR', 'MUSD'] | ~typing.Literal['SEK/MWh', 'EUR/MWh', 'SEK/kWh', 'EUR/kWh', 'SEK/GWh', 'EUR/GWh', 'SEK/TWh', 'EUR/TWh'] | ~typing.Literal['SEK/kg', 'EUR/kg', 'SEK/t', 'EUR/t', 'SEK/ton', 'EUR/ton', 'SEK/g', 'EUR/g', 'SEK/mg', 'EUR/mg', 'SEK/ug', 'EUR/ug'] | ~typing.Literal['SEK/L', 'EUR/L', 'SEK/l', 'EUR/l', 'SEK/liter', 'EUR/liter', 'SEK/m3', 'EUR/m3', 'SEK/m^3', 'EUR/m^3', 'SEK/m**3', 'EUR/m**3', 'SEK/m³', 'EUR/m³'] | ~typing.Literal['SEK/h', 'EUR/h', 'SEK/hr', 'EUR/hr', 'SEK/hour', 'EUR/hour', 'SEK/d', 'EUR/d', 'SEK/day', 'EUR/day', 'SEK/week', 'EUR/week', 'SEK/yr', 'EUR/yr', 'SEK/year', 'EUR/year', 'SEK/a', 'EUR/a'] | ~typing.Literal['m', 'meter', 'km', 'cm', 'mm', 'um'] | ~typing.Literal['kg', 'g', 'ton', 'tonne', 't', 'mg', 'ug'] | ~typing.Literal['s', 'second', 'min', 'minute', 'h', 'hr', 'hour', 'd', 'day', 'week', 'yr', 'a', 'year', 'ms', 'us'] | ~typing.Literal['Hz', 'kHz', 'MHz', 'GHz', 'rpm', '1/s'] | ~typing.Literal['degC', '°C', 'K', 'degF', '°F', '℃', '℉'] | ~typing.Literal['delta_K', 'ΔK', 'delta_°C', 'delta_degC', 'Δ°C', 'Δ℃', 'delta_°F', 'delta_degF', 'Δ°F', 'Δ℉'] | ~typing.Literal['mol', 'kmol'] | ~typing.Literal['g/mol', 'kg/mol', 'kg/kmol'] | ~typing.Literal['mol/g', 'kmol/kg'] | ~typing.Literal['A', 'mA'] | ~typing.Literal['cd', 'lm'] | ~typing.Literal['m2', 'm^2', 'm**2', 'm²', 'cm2', 'cm^2', 'cm**2', 'cm²'] | ~typing.Literal['L', 'l', 'liter', 'm3', 'm^3', 'm³', 'm**3', 'dm3', 'dm^3', 'dm³', 'dm**3', 'cm3', 'cm^3', 'cm³', 'cm**3'] | ~typing.Literal['normal liter', 'Nm3', 'nm3', 'Nm^3', 'nm^3', 'Nm³', 'nm³', 'Nm**3', 'nm**3'] | ~typing.Literal['bar', 'kPa', 'Pa', 'MPa', 'mbar', 'mmHg', 'torr', 'psi', 'atm', 'N/m2', 'N/m^2', 'N/m**2', 'N/m²'] | ~typing.Literal['kg/s', 'kg/h', 'kg/hr', 'g/s', 'g/h', 'g/hr', 'ton/h', 't/h', 'ton/hr', 't/hr', 't/d', 'ton/day', 'ton/week', 't/a', 't/year', 'ton/a', 'ton/year'] | ~typing.Literal['m3/s', 'm3/h', 'm3/hr', 'm**3/s', 'm**3/h', 'm**3/hr', 'm^3/s', 'm^3/h', 'm^3/hr', 'm³/s', 'm³/h', 'm³/hr', 'liter/second', 'l/s', 'L/s', 'liter/s', 'liter/hour', 'l/h', 'L/h', 'L/hr', 'l/hr'] | ~typing.Literal['Nm3/s', 'Nm3/h', 'Nm3/hr', 'nm3/s', 'nm3/h', 'nm3/hr', 'Nm^3/s', 'Nm^3/h', 'Nm^3/hr', 'nm^3/s', 'nm^3/h', 'nm^3/hr', 'Nm³/s', 'Nm³/h', 'Nm³/hr', 'nm³/s', 'nm³/h', 'nm³/hr', 'Nm**3/s', 'Nm**3/h', 'Nm**3/hr', 'nm**3/s', 'nm**3/h', 'nm**3/hr'] | ~typing.Literal['kg/m3', 'kg/m**3', 'kg/m^3', 'kg/m³', 'kg/liter', 'g/l', 'g/L', 'gram/liter', 'g/cm3', 'g/cm**3', 'g/cm^3', 'g/cm³'] | ~typing.Literal['mol/m3', 'mol/m**3', 'mol/m^3', 'mol/m³', 'kmol/m3', 'kmol/m**3', 'kmol/m^3', 'kmol/m³', 'mol/l', 'mol/L'] | ~typing.Literal['m3/kg', 'm^3/kg', 'm³/kg', 'l/g', 'L/g'] | ~typing.Literal['Nm3/kg', 'Nm^3/kg', 'Nm³/kg', 'nm3/kg', 'nm^3/kg', 'nm³/kg'] | ~typing.Literal['kg/Nm3', 'kg/Nm^3', 'kg/Nm³', 'kg/nm3', 'kg/nm^3', 'kg/nm³', 'g/Nm3', 'g/Nm^3', 'g/Nm³'] | ~typing.Literal['J', 'kJ', 'MJ', 'GJ', 'TJ', 'PJ', 'kWh', 'MWh', 'Wh', 'GWh', 'TWh'] | ~typing.Literal['W', 'kW', 'MW', 'GW', 'TW', 'mW', 'kWh/d', 'kWh/yr', 'kWh/year', 'MWh/d', 'MWh/yr', 'MWh/year', 'GWh/d', 'GWh/yr', 'GWh/year', 'TWh/d', 'TWh/yr', 'TWh/year'] | ~typing.Literal['W/m2', 'W/m^2', 'W/m**2', 'W/m²', 'kW/m2', 'kW/m^2', 'kW/m**2', 'kW/m²'] | ~typing.Literal['m/s', 'km/s', 'm/min', 'cm/s', 'cm/min', 'km/h', 'kmh', 'kph'] | ~typing.Literal['N', 'kN', 'mN'] | ~typing.Literal['Pa*s', 'Pa s', 'cP'] | ~typing.Literal['m2/s', 'm**2/s', 'm^2/s', 'm²/s', 'cSt', 'cm2/s', 'cm**2/s', 'cm^2/s', 'cm²/s'] | ~typing.Literal['MJ/kg', 'MWh/kg', 'kJ/kg', 'kWh/kg', 'J/kg', 'J/g', 'MJ/t', 'MWh/t', 'kJ/t', 'kWh/t', 'MJ/ton', 'MWh/ton', 'kJ/ton', 'kWh/ton'] | ~typing.Literal['J/mol', 'kJ/mol', 'J/kmol', 'kJ/kmol', 'MJ/kmol'] | ~typing.Literal['kJ/kg/K', 'kJ/kg/delta_degC', 'kJ/kg/Δ°C', 'kJ/kg/Δ℃', 'kJ/kg/°C', 'kJ/kg/℃', 'kJ/kg/degC', 'J/kg/K', 'J/kg/delta_degC', 'J/kg/Δ°C', 'J/kg/Δ℃', 'J/kg/°C', 'J/kg/℃', 'J/kg/degC', 'J/g/K', 'J/g/delta_degC', 'J/g/Δ°C', 'J/g/Δ℃', 'J/g/°C', 'J/g/℃', 'J/g/degC'] | ~typing.Literal['W/m/K', 'W/m/delta_degC', 'W/m/Δ°C', 'W/m/Δ℃', 'kW/m/K', 'mW/m/K'] | ~typing.Literal['W/m2/K', 'W/m^2/K', 'W/m**2/K', 'W/m²/K', 'W/m2/delta_degC', 'W/m^2/delta_degC', 'W/m**2/delta_degC', 'W/m²/delta_degC', 'W/m2/Δ°C', 'W/m^2/Δ°C', 'W/m**2/Δ°C', 'W/m²/Δ°C', 'kW/m2/K', 'kW/m^2/K', 'kW/m**2/K', 'kW/m²/K'] | ~encomp.units.Unit[~encomp.utypes.DT] | ~pint.util.UnitsContainer | str | dict[str, ~numbers.Number] | ~encomp.units.Quantity[UnknownDimensionality])
- to_base_units()[source]¶
Return a copy converted to base SI units.
- Return type:
Quantity[UnknownDimensionality]
- to_reduced_units()[source]¶
Return a copy with units reduced by canceling common factors.
- Return type:
Quantity[UnknownDimensionality]
- to_root_units()[source]¶
Return a copy converted to Pint root units.
- Return type:
Quantity[UnknownDimensionality]
- unknown()[source]¶
Return this quantity with its dimensionality erased, i.e.
asdim(UnknownDimensionality).- Return type:
Quantity[UnknownDimensionality]
- classmethod validate(qty, info)[source]¶
Pydantic validator: coerce
qtyto this subclass, checking dimensionality and magnitude type.Every failure is re-raised as a
pydantic_core.PydanticCustomErrorwith typequantity_dimensionality,quantity_magnitude_typeorquantity_validation.- Return type:
Quantity[UnknownDimensionality]- Parameters:
qty (Any)
info (Any)
- exception UnitStrippedWarning(msg)[source]¶
Bases:
UserWarning,PintError- Parameters:
msg (str)
- msg: str¶
- define_dimensionality(name, symbol=None, if_exists='raise')[source]¶
Defines a new dimensionality that can be combined with existing dimensionalities. In case the dimensionality is already defined,
DimensionalityRedefinitionErrorwill be raised.This can be used to define a new dimensionality for an amount of some specific substance. For instance, if the dimensionalities “air” and “fuel” are defined, the unit
(kg air) / (kg fuel)has the simplified dimensionality of[air] / [fuel].Note
Make sure to only define new custom dimensions using this function, since the unit needs to be appended to the
CUSTOM_DIMENSIONSlist as well.- Parameters:
name (
str) – Name of the dimensionalitysymbol (
str|None) – Optional (short) symbol, by default Noneif_exists (
Literal['raise','warn']) – What to do when a dimensionality with this name is already defined:"raise"(default) raisesDimensionalityRedefinitionError,"warn"logs a warning and keeps the existing definition
- Return type:
None
- set_quantity_format(fmt='compact')[source]¶
Set the process-wide default format used when rendering quantities and units.
"compact"/"normal"select Pint’s compact pretty format ("~P");"siunitx"selects the LaTeX siunitx format ("~Lx"). Any value inQuantity.FORMATTING_SPECScan also be passed directly.- Return type:
None- Parameters:
fmt (str)
encomp.utypes¶
Contains type definitions for encomp.units.Quantity objects.
The dimensionalities defined in this module can be combined with * and /.
Some commonly used derived dimensionalities (like density) are defined for convenience.
Most dimensionalities are backed by unit literals (see get_registered_units())
and by * / / overloads on encomp.units.Quantity, so they are inferred
statically. A few – NormalTemperature, MassPerEnergy, PowerPerLength,
PowerPerVolume, PowerPerTemperature and the HeatingValue family – are
deliberately vocabulary only: they have no unit literals and no overloads, and exist so
user code can annotate quantities with them and reinterpret via
encomp.units.Quantity.asdim().
- class Area[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 2})>¶
- class Currency[source]¶
Bases:
DimensionalityArbitrary currency (
[currency]dimension).Warning
The scaling between the built-in currencies (
SEK,EUR,USD) is a fixed placeholder (10 SEK = 1 EUR = 1 USD), not an exchange rate: converting a Quantity across currencies silently applies these fabricated factors. Do not use this system for currency conversion – keep all quantities in a single currency, or implement a pint context with real exchange rates.- dimensions: UnitsContainer = <UnitsContainer({'[currency]': 1})>¶
- class CurrencyPerEnergy[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[currency]': 1, '[length]': -2, '[mass]': -1, '[time]': 2})>¶
- class CurrencyPerMass[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[currency]': 1, '[mass]': -1})>¶
- class CurrencyPerTime[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[currency]': 1, '[time]': -1})>¶
- class CurrencyPerVolume[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[currency]': 1, '[length]': -3})>¶
- class Current[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[current]': 1})>¶
- class Density[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': -3, '[mass]': 1})>¶
- class Dimensionality[source]¶
Bases:
objectRepresents the dimensionality of a unit, i.e. a combination (product) of the base dimensions (with optional rational exponents).
A dimension can be expressed as
\[\Pi \, d^n_d, d \in \{T, L, M ,I, \Theta, N, J, \ldots\}, n_d \in \mathbb{Q}\]where ${T, L, M, …}$ are the base dimensions (time, length, mass, …) and $n_d$ is a rational number.
Subclasses of this abstract base class are used as type parameters when creating instances of
encomp.units.Quantity.The
dimensionsclass attribute defines the dimensions of the dimensionality using an instance ofpint.unit.UnitsContainer.Distinctness is registry-relative: if another dimensionality with the same dimensions is registered later,
is_distinct()for those dimensions may change. Define custom dimensionalities at import time and use globally unique class names in library code.- dimensions: UnitsContainer = <UnitsContainer({})>¶
- classmethod get_dimensionality(dimensions)[source]¶
Return the registered dimensionality for
dimensions.Unregistered dimensions get a new subclass named after them, for example
Dimensionality[[mass] ** 2 / [length] ** 3].- Return type:
type[Dimensionality]- Parameters:
dimensions (UnitsContainer)
- classmethod is_distinct()[source]¶
Whether this class is the one
get_dimensionality()returns for its dimensions.Unless
_distinctis set explicitly, only the first registered subclass with a givendimensionsis distinct. The answer is registry-relative and can change when a later subclass registers the same dimensions.- Return type:
bool
- class Dimensionless[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({})>¶
- class DynamicViscosity[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': -1, '[mass]': 1, '[time]': -1})>¶
- class Energy[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 2, '[mass]': 1, '[time]': -2})>¶
- class EnergyPerMass[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 2, '[time]': -2})>¶
- class Force[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 1, '[mass]': 1, '[time]': -2})>¶
- class Frequency[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[time]': -1})>¶
- class HeatTransferCoefficient[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[mass]': 1, '[temperature]': -1, '[time]': -3})>¶
- class HeatingValue[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 2, '[time]': -2})>¶
- class HigherHeatingValue[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 2, '[time]': -2})>¶
- class IndistinctDimensionality[source]¶
Bases:
Dimensionality
- class KinematicViscosity[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 2, '[time]': -1})>¶
- class Length[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 1})>¶
- class LowerHeatingValue[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 2, '[time]': -2})>¶
- class Luminosity[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[luminosity]': 1})>¶
- class Mass[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[mass]': 1})>¶
- class MassFlow[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[mass]': 1, '[time]': -1})>¶
- class MassPerEnergy[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': -2, '[time]': 2})>¶
- class MassPerNormalVolume[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': -3, '[mass]': 1, '[normal]': -1})>¶
- class MixtureEnthalpyPerDryAir[source]¶
Bases:
IndistinctDimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 2, '[time]': -2})>¶
- class MixtureEnthalpyPerHumidAir[source]¶
Bases:
IndistinctDimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 2, '[time]': -2})>¶
- class MixtureEntropyPerDryAir[source]¶
Bases:
IndistinctDimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 2, '[temperature]': -1, '[time]': -2})>¶
- class MixtureEntropyPerHumidAir[source]¶
Bases:
IndistinctDimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 2, '[temperature]': -1, '[time]': -2})>¶
- class MixtureVolumePerDryAir[source]¶
Bases:
IndistinctDimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 3, '[mass]': -1})>¶
- class MixtureVolumePerHumidAir[source]¶
Bases:
IndistinctDimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 3, '[mass]': -1})>¶
- class MolarDensity[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': -3, '[substance]': 1})>¶
- class MolarMass[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[mass]': 1, '[substance]': -1})>¶
- class MolarSpecificEnthalpy[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 2, '[mass]': 1, '[substance]': -1, '[time]': -2})>¶
- class MolarSpecificEntropy[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 2, '[mass]': 1, '[substance]': -1, '[temperature]': -1, '[time]': -2})>¶
- class MolarSpecificHeatCapacity[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 2, '[mass]': 1, '[substance]': -1, '[temperature]': -1, '[time]': -2})>¶
- class MolarSpecificInternalEnergy[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 2, '[mass]': 1, '[substance]': -1, '[time]': -2})>¶
- class Normal[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[normal]': 1})>¶
- class NormalTemperature[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[normal]': 1, '[temperature]': 1})>¶
- class NormalVolume[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 3, '[normal]': 1})>¶
- class NormalVolumeFlow[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 3, '[normal]': 1, '[time]': -1})>¶
- class NormalVolumePerMass[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 3, '[mass]': -1, '[normal]': 1})>¶
- class Power[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 2, '[mass]': 1, '[time]': -3})>¶
- class PowerPerArea[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[mass]': 1, '[time]': -3})>¶
- class PowerPerLength[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 1, '[mass]': 1, '[time]': -3})>¶
- class PowerPerTemperature[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 2, '[mass]': 1, '[temperature]': -1, '[time]': -3})>¶
- class PowerPerVolume[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': -1, '[mass]': 1, '[time]': -3})>¶
- class Pressure[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': -1, '[mass]': 1, '[time]': -2})>¶
- SpecificEnthalpy¶
alias of
EnergyPerMass
- class SpecificEntropy[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 2, '[temperature]': -1, '[time]': -2})>¶
- class SpecificHeatCapacity[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 2, '[temperature]': -1, '[time]': -2})>¶
- class SpecificHeatPerDryAir[source]¶
Bases:
IndistinctDimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 2, '[temperature]': -1, '[time]': -2})>¶
- class SpecificHeatPerHumidAir[source]¶
Bases:
IndistinctDimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 2, '[temperature]': -1, '[time]': -2})>¶
- class SpecificInternalEnergy[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 2, '[time]': -2})>¶
- class SpecificVolume[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 3, '[mass]': -1})>¶
- class Substance[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[substance]': 1})>¶
- class SubstancePerMass[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[mass]': -1, '[substance]': 1})>¶
- class SurfaceTension[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[mass]': 1, '[time]': -2})>¶
- class Temperature[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[temperature]': 1})>¶
- class TemperatureDifference[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[temperature]': 1})>¶
- class ThermalConductivity[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 1, '[mass]': 1, '[temperature]': -1, '[time]': -3})>¶
- class Time[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[time]': 1})>¶
- class UnitsContainer(*args, non_int_type=None, **kwargs)[source]¶
Bases:
Mapping[str,complex|float|int|Decimal|Fraction]The UnitsContainer stores the product of units and their respective exponent and implements the corresponding operations.
UnitsContainer is a read-only mapping. All operations (even in place ones) return new instances.
- Parameters:
non_int_type (
type|None) – Numerical type used for non integer values.args (Any)
kwargs (Any)
- add(key, value)[source]¶
Create a new UnitsContainer adding value to the value existing for a given key.
- Parameters:
key (
str) – unit to which the value will be added.value (
Number) – value to be added.self (Self)
- Returns:
A copy of this container.
- Return type:
Self
- remove(keys)[source]¶
Create a new UnitsContainer purged from given entries.
- Parameters:
keys (
Iterable[str]) – Iterable of keys (units) to remove.self (Self)
- Returns:
A copy of this container.
- Return type:
Self
- class UnknownDimensionality[source]¶
Bases:
Dimensionality
- class Velocity[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 1, '[time]': -1})>¶
- class Volume[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 3})>¶
- class VolumeFlow[source]¶
Bases:
Dimensionality- dimensions: UnitsContainer = <UnitsContainer({'[length]': 3, '[time]': -1})>¶
encomp.fluids¶
Classes and functions relating to fluid properties. Uses CoolProp as backend.
- class CoolPropFluid(name, **kwargs)[source]¶
Bases:
ABC,Generic[MT]Base class that represents a fluid (pure or mixture, gas or liquid). Uses CoolProp as backend to determine fluid properties.
This class should not be used directly, since it does not contain a fixed point to determine fluid properties (temperature, pressure, enthalpy, entropy, …). Define a subclass of
encomp.fluids.CoolPropFluidthat implements the__init__method (this method must set instance attributesnameandpoints).Fluid names for pure fluids are not case-sensitive, but the mixture names are. A name may fold in the backend (
"IF97::Water","HEOS::CO2&O2"); a bare name defaults to the HEOS backend. Incompressible fluids and their mixtures use theINCOMP::prefix, optionally with a concentration ("INCOMP::MEG[0.5]"). An unknown name raisesValueErrorat construction.The names recognized by the installed CoolProp build are listed by
import CoolProp.CoolProp as CP CP.get_global_param_string("FluidsList") # pure and pseudo-pure CP.get_global_param_string("incompressible_list_pure") CP.get_global_param_string("incompressible_list_solution") CP.get_global_param_string("predefined_mixtures")
Examples:
Water,Air,Nitrogen,CarbonDioxide,Ammonia,R134a,Toluene,INCOMP::T66,INCOMP::MPG[0.5],R410A.mix.Refer to the CoolProp documentation for more information:
http://www.coolprop.org/fluid_properties/PurePseudoPure.html#list-of-fluids
http://www.coolprop.org/fluid_properties/Mixtures.html#binary-pairs
http://www.coolprop.org/fluid_properties/Incompressibles.html#the-different-fluids
http://www.coolprop.org/fluid_properties/HumidAir.html#table-of-inputs-outputs-to-hapropssi
The names
WaterandHEOS::Wateruse the formulation defined by IAPWS-95. Use the nameIF97::Waterto instead use the slightly faster (but less accurate) IAPWS-97 formulation. In most cases, the difference between IAPWS-95 and IAPWS-97 is negligible. Read CoolProp’s introduction about water properties for more information.- Parameters:
name (
Union[Literal['Water','IF97::Water','HEOS::Water','HEOS','Air','Nitrogen','Oxygen','CarbonDioxide','Hydrogen','Methane','Ammonia','Argon','R134a'],str]) –The name of the fluid, same name as is used by CoolProp. Include the
INCOMP::prefix and potential mixing ratio for incompressible mixtures.Examples:
INCOMP::MITSW[0.05]: seawater with 5 mass-percent salt.INCOMP::MPG[0.5]: 50 % propylene glycolINCOMP::T66: Therminol 66 (https://www.therminol.com/product/71093438)
kwargs (Quantity[UnknownDimensionality] | Quantity[UnknownDimensionality, float])
- ALL_PROPERTIES: set[Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity', 'B', 'CV', 'CVha', 'Cha', 'Conductivity', 'DewPoint', 'Enthalpy', 'Entropy', 'Hda', 'Hha', 'HumRat', 'K', 'Omega', 'P_w', 'R', 'RH', 'RelHum', 'Sda', 'Sha', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w']] = {'A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GAS_CONSTANT', 'GMASS', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity'}¶
- BACKEND: ClassVar[dict[Literal['backend'], Callable[[...], float | ndarray[tuple[int], dtype[float64]]]]] = {'backend': <nanobind.nb_func object>}¶
- COOLPROP_ERROR_MESSAGES = ('is not valid for keyed_output', 'is not valid for trivial_keyed_output', "For now, we don't support", 'is not implemented for this backend', 'is only defined within the two-phase region', 'failed ungracefully', 'value to T_phase_determination_pure_or_pseudopure is invalid', "Brent's method f(b) is NAN", 'do not bracket the root', 'was unable to find a solution for')¶
- PHASES: dict[float, Literal['Liquid', 'Gas', 'Two-phase', 'Supercritical liquid', 'Supercritical gas', 'Supercritical fluid', 'Critical point', 'Unknown', 'Not imposed', 'Variable', 'N/A']] = {0.0: 'Liquid', 1.0: 'Supercritical fluid', 2.0: 'Supercritical gas', 3.0: 'Supercritical liquid', 4.0: 'Critical point', 5.0: 'Gas', 6.0: 'Two-phase', 7.0: 'Unknown', 8.0: 'Not imposed'}¶
- PROPERTY_MAP: dict[tuple[Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity', 'B', 'CV', 'CVha', 'Cha', 'Conductivity', 'DewPoint', 'Enthalpy', 'Entropy', 'Hda', 'Hha', 'HumRat', 'K', 'Omega', 'P_w', 'R', 'RH', 'RelHum', 'Sda', 'Sha', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w'], ...], tuple[Annotated[str, 'Unit string'], str]] = {('A', 'SPEED_OF_SOUND', 'speed_of_sound'): ('m/s', 'Speed of sound'), ('C', 'CPMASS', 'Cpmass'): ('J/kg/K', 'Mass specific constant pressure specific heat'), ('CONDUCTIVITY', 'L', 'conductivity'): ('W/m/K', 'Thermal conductivity'), ('CP0MASS', 'Cp0mass'): ('J/kg/K', 'Ideal gas mass specific constant pressure specific heat'), ('CP0MOLAR', 'Cp0molar'): ('J/mol/K', 'Ideal gas molar specific constant pressure specific heat'), ('CPMOLAR', 'Cpmolar'): ('J/mol/K', 'Molar specific constant pressure specific heat'), ('CVMASS', 'Cvmass', 'O'): ('J/kg/K', 'Mass specific constant volume specific heat'), ('CVMOLAR', 'Cvmolar'): ('J/mol/K', 'Molar specific constant volume specific heat'), ('D', 'DMASS', 'Dmass'): ('kg/m³', 'Mass density'), ('DELTA', 'Delta'): ('dimensionless', 'Reduced density (rho/rhoc)'), ('DIPOLE_MOMENT', 'dipole_moment'): ('C*m', 'Dipole moment'), ('DMOLAR', 'Dmolar'): ('mol/m³', 'Molar density'), ('G', 'GMASS', 'Gmass'): ('J/kg', 'Mass specific Gibbs energy'), ('GAS_CONSTANT', 'gas_constant'): ('J/mol/K', 'Molar gas constant'), ('GMOLAR', 'Gmolar'): ('J/mol', 'Molar specific Gibbs energy'), ('GMOLAR_RESIDUAL', 'Gmolar_residual'): ('J/mol', 'Residual molar Gibbs energy'), ('H', 'HMASS', 'Hmass'): ('J/kg', 'Mass specific enthalpy'), ('HELMHOLTZMASS', 'Helmholtzmass'): ('J/kg', 'Mass specific Helmholtz energy'), ('HELMHOLTZMOLAR', 'Helmholtzmolar'): ('J/mol', 'Molar specific Helmholtz energy'), ('HMOLAR', 'Hmolar'): ('J/mol', 'Molar specific enthalpy'), ('HMOLAR_RESIDUAL', 'Hmolar_residual'): ('J/mol', 'Residual molar enthalpy'), ('I', 'SURFACE_TENSION', 'surface_tension'): ('N/m', 'Surface tension'), ('ISENTROPIC_EXPANSION_COEFFICIENT', 'isentropic_expansion_coefficient'): ('dimensionless', 'Isentropic expansion coefficient'), ('ISOBARIC_EXPANSION_COEFFICIENT', 'isobaric_expansion_coefficient'): ('1/K', 'Isobaric expansion coefficient'), ('ISOTHERMAL_COMPRESSIBILITY', 'isothermal_compressibility'): ('1/Pa', 'Isothermal compressibility'), ('M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'molar_mass', 'molarmass', 'molemass'): ('kg/mol', 'Molar mass'), ('P',): ('Pa', 'Pressure'), ('PCRIT', 'P_CRITICAL', 'Pcrit', 'p_critical', 'pcrit'): ('Pa', 'Pressure at the critical point'), ('PHASE', 'Phase'): ('dimensionless', 'Phase index as a float'), ('PMAX', 'P_MAX', 'P_max', 'pmax'): ('Pa', 'Maximum pressure limit'), ('PMIN', 'P_MIN', 'P_min', 'pmin'): ('Pa', 'Minimum pressure limit'), ('PRANDTL', 'Prandtl'): ('dimensionless', 'Prandtl number'), ('PTRIPLE', 'P_TRIPLE', 'p_triple', 'ptriple'): ('Pa', 'Pressure at the triple point (pure only)'), ('P_REDUCING', 'p_reducing'): ('Pa', 'Pressure at the reducing point'), ('Q',): ('dimensionless', 'Mass vapor quality'), ('RHOCRIT', 'RHOMASS_CRITICAL', 'rhocrit', 'rhomass_critical'): ('kg/m³', 'Mass density at critical point'), ('RHOMASS_REDUCING', 'rhomass_reducing'): ('kg/m³', 'Mass density at reducing point'), ('RHOMOLAR_CRITICAL', 'rhomolar_critical'): ('mol/m³', 'Molar density at critical point'), ('RHOMOLAR_REDUCING', 'rhomolar_reducing'): ('mol/m³', 'Molar density at reducing point'), ('S', 'SMASS', 'Smass'): ('J/kg/K', 'Mass specific entropy'), ('SMOLAR', 'Smolar'): ('J/mol/K', 'Molar specific entropy'), ('SMOLAR_RESIDUAL', 'Smolar_residual'): ('J/mol/K', 'Residual molar entropy'), ('T',): ('K', 'Temperature'), ('TAU', 'Tau'): ('dimensionless', 'Reciprocal reduced temperature (Tc/T)'), ('TCRIT', 'T_CRITICAL', 'T_critical', 'Tcrit'): ('K', 'Temperature at the critical point'), ('TMAX', 'T_MAX', 'T_max', 'Tmax'): ('K', 'Maximum temperature limit'), ('TMIN', 'T_MIN', 'T_min', 'Tmin'): ('K', 'Minimum temperature limit'), ('TTRIPLE', 'T_TRIPLE', 'T_triple', 'Ttriple'): ('K', 'Temperature at the triple point'), ('T_FREEZE', 'T_freeze'): ('K', 'Freezing temperature for incompressible solutions'), ('T_REDUCING', 'T_reducing'): ('K', 'Temperature at the reducing point'), ('U', 'UMASS', 'Umass'): ('J/kg', 'Mass specific internal energy'), ('UMOLAR', 'Umolar'): ('J/mol', 'Molar specific internal energy'), ('V', 'VISCOSITY', 'viscosity'): ('Pa*s', 'Viscosity'), ('Z',): ('dimensionless', 'Compressibility factor')}¶
- REPR_PROPERTIES: tuple[tuple[Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity', 'B', 'CV', 'CVha', 'Cha', 'Conductivity', 'DewPoint', 'Enthalpy', 'Entropy', 'Hda', 'Hha', 'HumRat', 'K', 'Omega', 'P_w', 'R', 'RH', 'RelHum', 'Sda', 'Sha', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w'], str], ...] = (('P', '.0f'), ('T', '.1f'), ('D', '.1f'), ('V', '.2g'))¶
- RETURN_UNITS: dict[Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity', 'B', 'CV', 'CVha', 'Cha', 'Conductivity', 'DewPoint', 'Enthalpy', 'Entropy', 'Hda', 'Hha', 'HumRat', 'K', 'Omega', 'P_w', 'R', 'RH', 'RelHum', 'Sda', 'Sha', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w'], Annotated[str, 'Unit string']] = {'C': 'kJ/kg/K', 'H': 'kJ/kg', 'P': 'kPa', 'PCRIT': 'kPa', 'PMAX': 'kPa', 'PMIN': 'kPa', 'PTRIPLE': 'kPa', 'P_REDUCING': 'kPa', 'S': 'kJ/kg/K', 'T': '°C', 'TCRIT': '°C', 'TMAX': '°C', 'TMIN': '°C', 'TTRIPLE': '°C', 'T_FREEZE': '°C', 'T_REDUCING': '°C', 'U': 'kJ/kg', 'V': 'cP'}¶
- STATE_INPUTS: ClassVar[frozenset[str]] = frozenset({'D', 'DMASS', 'DMOLAR', 'Dmass', 'Dmolar', 'H', 'HMASS', 'HMOLAR', 'Hmass', 'Hmolar', 'P', 'Q', 'S', 'SMASS', 'SMOLAR', 'Smass', 'Smolar', 'T', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar'})¶
- check_exception(prop, e)[source]¶
Re-raise
e, or return so the caller can yieldNaNforprop.CoolProp signals both “out of range” and “not implemented” with
ValueError; those cases warn (or stay silent) and produceNaN. Anything else re-raises.- Return type:
None- Parameters:
prop (Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity', 'B', 'CV', 'CVha', 'Cha', 'Conductivity', 'DewPoint', 'Enthalpy', 'Entropy', 'Hda', 'Hha', 'HumRat', 'K', 'Omega', 'P_w', 'R', 'RH', 'RelHum', 'Sda', 'Sha', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w'])
e (ValueError)
- classmethod check_inputs(kwargs)[source]¶
Raise
ValueErrorunless every key names a distinct CoolProp state input.- Return type:
None- Parameters:
kwargs (Mapping[str, object])
- construct_quantity(val, output, convert_magnitude=True)[source]¶
Wrap a raw CoolProp result as a
Quantity, converted to the preferredRETURN_UNITS.- Return type:
Quantity[UnknownDimensionality]- Parameters:
val (float | ndarray[tuple[int], dtype[float64]] | Expr)
output (Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity', 'B', 'CV', 'CVha', 'Cha', 'Conductivity', 'DewPoint', 'Enthalpy', 'Entropy', 'Hda', 'Hha', 'HumRat', 'K', 'Omega', 'P_w', 'R', 'RH', 'RelHum', 'Sda', 'Sha', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w'])
convert_magnitude (bool)
- classmethod describe(prop)[source]¶
Return a one-line description of
prop: its synonyms, meaning, and unit.- Return type:
str- Parameters:
prop (Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity', 'B', 'CV', 'CVha', 'Cha', 'Conductivity', 'DewPoint', 'Enthalpy', 'Entropy', 'Hda', 'Hha', 'HumRat', 'K', 'Omega', 'P_w', 'R', 'RH', 'RelHum', 'Sda', 'Sha', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w'])
- evaluate(output, *points)[source]¶
Evaluate
outputin CoolProp’s own unit, dispatching on the magnitude type ofpoints.- Return type:
float|ndarray[tuple[int],dtype[float64]] |Expr- Parameters:
output (Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity', 'B', 'CV', 'CVha', 'Cha', 'Conductivity', 'DewPoint', 'Enthalpy', 'Entropy', 'Hda', 'Hha', 'HumRat', 'K', 'Omega', 'P_w', 'R', 'RH', 'RelHum', 'Sda', 'Sha', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w'])
points (tuple[Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity', 'B', 'CV', 'CVha', 'Cha', 'Conductivity', 'DewPoint', 'Enthalpy', 'Entropy', 'Hda', 'Hha', 'HumRat', 'K', 'Omega', 'P_w', 'R', 'RH', 'RelHum', 'Sda', 'Sha', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w'], float | ~numpy.ndarray[tuple[int], ~numpy.dtype[~numpy.float64]] | ~polars.expr.expr.Expr])
- evaluate_expression(output, *points)[source]¶
Build (or reuse) the cached
pl.Exprplugin node that evaluatesoutput.- Return type:
Expr- Parameters:
output (Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity', 'B', 'CV', 'CVha', 'Cha', 'Conductivity', 'DewPoint', 'Enthalpy', 'Entropy', 'Hda', 'Hha', 'HumRat', 'K', 'Omega', 'P_w', 'R', 'RH', 'RelHum', 'Sda', 'Sha', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w'])
points (tuple[Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity', 'B', 'CV', 'CVha', 'Cha', 'Conductivity', 'DewPoint', 'Enthalpy', 'Entropy', 'Hda', 'Hha', 'HumRat', 'K', 'Omega', 'P_w', 'R', 'RH', 'RelHum', 'Sda', 'Sha', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w'], ~polars.expr.expr.Expr])
- evaluate_multiple(output, *points)[source]¶
Evaluate
outputfor array inputs in one vectorized backend call; non-finite rows areNaN.- Return type:
ndarray[tuple[int],dtype[float64]]- Parameters:
output (Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity', 'B', 'CV', 'CVha', 'Cha', 'Conductivity', 'DewPoint', 'Enthalpy', 'Entropy', 'Hda', 'Hha', 'HumRat', 'K', 'Omega', 'P_w', 'R', 'RH', 'RelHum', 'Sda', 'Sha', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w'])
points (tuple[Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity', 'B', 'CV', 'CVha', 'Cha', 'Conductivity', 'DewPoint', 'Enthalpy', 'Entropy', 'Hda', 'Hha', 'HumRat', 'K', 'Omega', 'P_w', 'R', 'RH', 'RelHum', 'Sda', 'Sha', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w'], ~numpy.ndarray[tuple[int], ~numpy.dtype[~numpy.float64]]])
- evaluate_multiple_separately(output, props, arrs_flat_masked, N)[source]¶
Evaluate
outputrow by row, so a single invalid row yieldsNaNrather than failing the batch.- Return type:
ndarray[tuple[int],dtype[float64]]- Parameters:
output (Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity', 'B', 'CV', 'CVha', 'Cha', 'Conductivity', 'DewPoint', 'Enthalpy', 'Entropy', 'Hda', 'Hha', 'HumRat', 'K', 'Omega', 'P_w', 'R', 'RH', 'RelHum', 'Sda', 'Sha', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w'])
props (list[Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity', 'B', 'CV', 'CVha', 'Cha', 'Conductivity', 'DewPoint', 'Enthalpy', 'Entropy', 'Hda', 'Hha', 'HumRat', 'K', 'Omega', 'P_w', 'R', 'RH', 'RelHum', 'Sda', 'Sha', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w']])
arrs_flat_masked (list[ndarray[tuple[int], dtype[float64]]])
N (int)
- evaluate_single(output, *points)[source]¶
Evaluate
outputfor scalar inputs through the CoolProp backend, returningNaNon an invalid state.- Return type:
float- Parameters:
output (Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity', 'B', 'CV', 'CVha', 'Cha', 'Conductivity', 'DewPoint', 'Enthalpy', 'Entropy', 'Hda', 'Hha', 'HumRat', 'K', 'Omega', 'P_w', 'R', 'RH', 'RelHum', 'Sda', 'Sha', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w'])
points (tuple[Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity', 'B', 'CV', 'CVha', 'Cha', 'Conductivity', 'DewPoint', 'Enthalpy', 'Entropy', 'Hda', 'Hha', 'HumRat', 'K', 'Omega', 'P_w', 'R', 'RH', 'RelHum', 'Sda', 'Sha', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w'], float])
- get(output, points=None, convert_magnitude=True)[source]¶
Wraps the CoolProp backend function (
PropsSI, orHAPropsSIforencomp.fluids.HumidAir), handles input and output withencomp.units.Quantityobjects.- Parameters:
output (
Union[Literal['A','C','CONDUCTIVITY','CP0MASS','CP0MOLAR','CPMASS','CPMOLAR','CVMASS','CVMOLAR','Cp0mass','Cp0molar','Cpmass','Cpmolar','Cvmass','Cvmolar','D','DELTA','DIPOLE_MOMENT','DMASS','DMOLAR','Delta','Dmass','Dmolar','G','GMASS','GAS_CONSTANT','GMOLAR','GMOLAR_RESIDUAL','Gmass','Gmolar','Gmolar_residual','H','HELMHOLTZMASS','HELMHOLTZMOLAR','HMASS','HMOLAR','HMOLAR_RESIDUAL','Helmholtzmass','Helmholtzmolar','Hmass','Hmolar','Hmolar_residual','I','ISENTROPIC_EXPANSION_COEFFICIENT','ISOBARIC_EXPANSION_COEFFICIENT','ISOTHERMAL_COMPRESSIBILITY','L','M','MOLARMASS','MOLAR_MASS','MOLEMASS','O','P','PCRIT','PHASE','PMAX','PMIN','PRANDTL','PTRIPLE','P_CRITICAL','P_MAX','P_MIN','P_REDUCING','P_TRIPLE','P_max','P_min','Pcrit','Phase','Prandtl','Q','RHOCRIT','RHOMASS_CRITICAL','RHOMASS_REDUCING','RHOMOLAR_CRITICAL','RHOMOLAR_REDUCING','S','SMASS','SMOLAR','SMOLAR_RESIDUAL','SPEED_OF_SOUND','SURFACE_TENSION','Smass','Smolar','Smolar_residual','T','TAU','TCRIT','TMAX','TMIN','TTRIPLE','T_CRITICAL','T_FREEZE','T_MAX','T_MIN','T_REDUCING','T_TRIPLE','T_critical','T_freeze','T_max','T_min','T_reducing','T_triple','Tau','Tcrit','Tmax','Tmin','Ttriple','U','UMASS','UMOLAR','Umass','Umolar','V','VISCOSITY','Z','conductivity','dipole_moment','gas_constant','isentropic_expansion_coefficient','isobaric_expansion_coefficient','isothermal_compressibility','molar_mass','molarmass','molemass','p_critical','p_reducing','p_triple','pcrit','pmax','pmin','ptriple','rhocrit','rhomass_critical','rhomass_reducing','rhomolar_critical','rhomolar_reducing','speed_of_sound','surface_tension','viscosity'],Literal['B','C','CV','CVha','Cha','Conductivity','D','DewPoint','Enthalpy','Entropy','H','Hda','Hha','HumRat','K','M','Omega','P','P_w','R','RH','RelHum','S','Sda','Sha','T','T_db','T_dp','T_wb','Tdb','Tdp','Twb','V','Vda','Vha','Visc','W','WetBulb','Y','Z','cp','cp_ha','cv_ha','k','mu','psi_w']]) – Name of the output propertypoints (
list[tuple[Union[Literal['A','C','CONDUCTIVITY','CP0MASS','CP0MOLAR','CPMASS','CPMOLAR','CVMASS','CVMOLAR','Cp0mass','Cp0molar','Cpmass','Cpmolar','Cvmass','Cvmolar','D','DELTA','DIPOLE_MOMENT','DMASS','DMOLAR','Delta','Dmass','Dmolar','G','GMASS','GAS_CONSTANT','GMOLAR','GMOLAR_RESIDUAL','Gmass','Gmolar','Gmolar_residual','H','HELMHOLTZMASS','HELMHOLTZMOLAR','HMASS','HMOLAR','HMOLAR_RESIDUAL','Helmholtzmass','Helmholtzmolar','Hmass','Hmolar','Hmolar_residual','I','ISENTROPIC_EXPANSION_COEFFICIENT','ISOBARIC_EXPANSION_COEFFICIENT','ISOTHERMAL_COMPRESSIBILITY','L','M','MOLARMASS','MOLAR_MASS','MOLEMASS','O','P','PCRIT','PHASE','PMAX','PMIN','PRANDTL','PTRIPLE','P_CRITICAL','P_MAX','P_MIN','P_REDUCING','P_TRIPLE','P_max','P_min','Pcrit','Phase','Prandtl','Q','RHOCRIT','RHOMASS_CRITICAL','RHOMASS_REDUCING','RHOMOLAR_CRITICAL','RHOMOLAR_REDUCING','S','SMASS','SMOLAR','SMOLAR_RESIDUAL','SPEED_OF_SOUND','SURFACE_TENSION','Smass','Smolar','Smolar_residual','T','TAU','TCRIT','TMAX','TMIN','TTRIPLE','T_CRITICAL','T_FREEZE','T_MAX','T_MIN','T_REDUCING','T_TRIPLE','T_critical','T_freeze','T_max','T_min','T_reducing','T_triple','Tau','Tcrit','Tmax','Tmin','Ttriple','U','UMASS','UMOLAR','Umass','Umolar','V','VISCOSITY','Z','conductivity','dipole_moment','gas_constant','isentropic_expansion_coefficient','isobaric_expansion_coefficient','isothermal_compressibility','molar_mass','molarmass','molemass','p_critical','p_reducing','p_triple','pcrit','pmax','pmin','ptriple','rhocrit','rhomass_critical','rhomass_reducing','rhomolar_critical','rhomolar_reducing','speed_of_sound','surface_tension','viscosity'],Literal['B','C','CV','CVha','Cha','Conductivity','D','DewPoint','Enthalpy','Entropy','H','Hda','Hha','HumRat','K','M','Omega','P','P_w','R','RH','RelHum','S','Sda','Sha','T','T_db','T_dp','T_wb','Tdb','Tdp','Twb','V','Vda','Vha','Visc','W','WetBulb','Y','Z','cp','cp_ha','cv_ha','k','mu','psi_w']],Quantity[UnknownDimensionality]|Quantity[UnknownDimensionality, float]]] |None) – Fixed state variables: name and value of the property. The number of points must match the number expected by the CoolProp backend function. If None, the points from the__init__method are usedconvert_magnitude (
bool) – Whether to convert the output to the same magnitude type as the input, by default True
- Returns:
Quantity representing the output property
- Return type:
Quantity[UnknownDimensionality]
- classmethod get_coolprop_unit(prop)[source]¶
Return the unit CoolProp reports
propin, before conversion toRETURN_UNITS.- Return type:
- Parameters:
prop (Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity', 'B', 'CV', 'CVha', 'Cha', 'Conductivity', 'DewPoint', 'Enthalpy', 'Entropy', 'Hda', 'Hha', 'HumRat', 'K', 'Omega', 'P_w', 'R', 'RH', 'RelHum', 'Sda', 'Sha', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w'])
- classmethod get_prop_key(prop)[source]¶
Return the tuple of synonyms in
PROPERTY_MAPthatpropbelongs to.- Return type:
tuple[Union[Literal['A','C','CONDUCTIVITY','CP0MASS','CP0MOLAR','CPMASS','CPMOLAR','CVMASS','CVMOLAR','Cp0mass','Cp0molar','Cpmass','Cpmolar','Cvmass','Cvmolar','D','DELTA','DIPOLE_MOMENT','DMASS','DMOLAR','Delta','Dmass','Dmolar','G','GMASS','GAS_CONSTANT','GMOLAR','GMOLAR_RESIDUAL','Gmass','Gmolar','Gmolar_residual','H','HELMHOLTZMASS','HELMHOLTZMOLAR','HMASS','HMOLAR','HMOLAR_RESIDUAL','Helmholtzmass','Helmholtzmolar','Hmass','Hmolar','Hmolar_residual','I','ISENTROPIC_EXPANSION_COEFFICIENT','ISOBARIC_EXPANSION_COEFFICIENT','ISOTHERMAL_COMPRESSIBILITY','L','M','MOLARMASS','MOLAR_MASS','MOLEMASS','O','P','PCRIT','PHASE','PMAX','PMIN','PRANDTL','PTRIPLE','P_CRITICAL','P_MAX','P_MIN','P_REDUCING','P_TRIPLE','P_max','P_min','Pcrit','Phase','Prandtl','Q','RHOCRIT','RHOMASS_CRITICAL','RHOMASS_REDUCING','RHOMOLAR_CRITICAL','RHOMOLAR_REDUCING','S','SMASS','SMOLAR','SMOLAR_RESIDUAL','SPEED_OF_SOUND','SURFACE_TENSION','Smass','Smolar','Smolar_residual','T','TAU','TCRIT','TMAX','TMIN','TTRIPLE','T_CRITICAL','T_FREEZE','T_MAX','T_MIN','T_REDUCING','T_TRIPLE','T_critical','T_freeze','T_max','T_min','T_reducing','T_triple','Tau','Tcrit','Tmax','Tmin','Ttriple','U','UMASS','UMOLAR','Umass','Umolar','V','VISCOSITY','Z','conductivity','dipole_moment','gas_constant','isentropic_expansion_coefficient','isobaric_expansion_coefficient','isothermal_compressibility','molar_mass','molarmass','molemass','p_critical','p_reducing','p_triple','pcrit','pmax','pmin','ptriple','rhocrit','rhomass_critical','rhomass_reducing','rhomolar_critical','rhomolar_reducing','speed_of_sound','surface_tension','viscosity'],Literal['B','C','CV','CVha','Cha','Conductivity','D','DewPoint','Enthalpy','Entropy','H','Hda','Hha','HumRat','K','M','Omega','P','P_w','R','RH','RelHum','S','Sda','Sha','T','T_db','T_dp','T_wb','Tdb','Tdp','Twb','V','Vda','Vha','Visc','W','WetBulb','Y','Z','cp','cp_ha','cv_ha','k','mu','psi_w']],...]- Parameters:
prop (str)
- classmethod is_valid_prop(prop)[source]¶
Whether
propis a CoolProp property name known to this class.- Return type:
bool- Parameters:
prop (str)
- name: Literal['Water', 'IF97::Water', 'HEOS::Water', 'HEOS', 'Air', 'Nitrogen', 'Oxygen', 'CarbonDioxide', 'Hydrogen', 'Methane', 'Ammonia', 'Argon', 'R134a'] | str¶
- points: list[tuple[Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity', 'B', 'CV', 'CVha', 'Cha', 'Conductivity', 'DewPoint', 'Enthalpy', 'Entropy', 'Hda', 'Hha', 'HumRat', 'K', 'Omega', 'P_w', 'R', 'RH', 'RelHum', 'Sda', 'Sha', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w'], Quantity[UnknownDimensionality] | Quantity[UnknownDimensionality, float]]]¶
- classmethod search(inp)[source]¶
Return the
describe()lines of every property whose description containsinp.- Return type:
list[str]- Parameters:
inp (str)
- to_numeric_correct_unit(prop, qty)[source]¶
Convert a state-input quantity to CoolProp’s unit for
propand return its bare magnitude.This is where the dimensionality of a state input is validated: a mismatch raises
encomp.units.ExpectedDimensionalityError.- Return type:
float|ndarray[tuple[int],dtype[float64]] |Expr- Parameters:
prop (Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity', 'B', 'CV', 'CVha', 'Cha', 'Conductivity', 'DewPoint', 'Enthalpy', 'Entropy', 'Hda', 'Hha', 'HumRat', 'K', 'Omega', 'P_w', 'R', 'RH', 'RelHum', 'Sda', 'Sha', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w'])
qty (Quantity[UnknownDimensionality] | Quantity[UnknownDimensionality, float])
- EAGER_PLUGIN_MIN_SIZE = 1000¶
Eager numpy /
pl.Seriesinputs with at least this many elements are evaluated through the GIL-free rust plugin (faster and lower peak memory than CoolProp’s vectorizedPropsSI, and much faster than the low-level per-row Python loop for an assumed phase / composition). Scalars and smaller arrays stay on the Python CoolProp path, where the plugin’s fixed dispatch overhead would dominate. The two paths are verified to agree on dtype, value, and NaN/inf handling (test_fluids).
- class Fluid(name, *, composition=None, **kwargs)[source]¶
Bases:
CoolPropFluid[MT]Represents a fluid at a fixed state, for example at a specific temperature and pressure.
The fluid name is resolved eagerly: an unknown name raises
ValueErrorhere, not at the first property access. The dimensionality of each state input is still validated lazily, when a property is evaluated.- Parameters:
name (
Union[Literal['Water','IF97::Water','HEOS::Water','HEOS','Air','Nitrogen','Oxygen','CarbonDioxide','Hydrogen','Methane','Ammonia','Argon','R134a'],str]) – Name of the fluid. Withcompositionthis is the backend only (e.g."HEOS"); otherwise the full CoolProp name, optionally with fixed fractions (e.g."HEOS::CO2[0.5]&O2[0.5]").composition (
dict[Union[Literal['Water','IF97::Water','HEOS::Water','HEOS','Air','Nitrogen','Oxygen','CarbonDioxide','Hydrogen','Methane','Ammonia','Argon','R134a'],str],float|int] |None) – Fixed mixture composition as{species: mole fraction}(like CoolProp’s"HEOS::CO2[0.5]&O2[0.5]"name syntax). Mole fractions must sum to 1. Cannot be combined with fractions baked intoname, and requires a mixture backend (e.g. HEOS). Pair withassume_phase()for speed. Per-row varying composition is not supported – loop and build one Fluid per composition. (For an incompressible mixture instead use the name concentration, e.g."INCOMP::MEG[0.5]"– 50 % glycol, on the fluid’s own mass/volume basis.)kwargs (
Unpack[FluidState[TypeVar(MT,float,ndarray[tuple[int],dtype[float64]],Series,Expr)]]) – Values for the two fixed points. The name of the keyword argument is the CoolProp property name.
- property GAS_CONSTANT: Quantity[MolarSpecificHeatCapacity]¶
Molar gas constant, which shares its dimensions with a molar heat capacity.
- assume_phase(phase)[source]¶
Force the equation of state to assume
phase, skipping CoolProp’s own phase determination. This is a speed tool, not a validation tool.With
P, Tinputs CoolProp normally runs a phase-stability search to decide whether the state is single- or two-phase. For HEOS/GERG mixtures that search dominates the cost (~5 ms/point); assuming a phase you already know skips it and switches evaluation to the low-levelAbstractStateAPI – on the order of 100-1000x faster.Important caveats:
Only the HEOS/GERG backends honour it.
IF97(the default forWater) is region-explicit and ignores an assumed phase, so this call is a no-op there: it emits a warning and keeps the fast vectorized path (rather than switching to the slower per-point loop). UseFluid("HEOS::Water", ...)if you need an assumed phase for water.The assumed phase must be correct for the operating domain. Forcing a phase the fluid is not actually in does NOT raise – on HEOS you get either
NaN(deep in the wrong phase) or a finite but non-physical metastable root (near the saturation line). So it cannot be used to detect a wrong phase; for that, evaluate with auto-phase and checkphase(or qualityQ) instead.
Pass
Noneto clear it and restore automatic determination. Mutatesselfand returns it, so it can be chained:Fluid("HEOS::CO2[0.5]&O2[0.5]", P=P, T=T).assume_phase("gas").D
- Parameters:
phase (
Optional[Literal['gas','liquid','supercritical','supercritical_gas','supercritical_liquid','twophase']]) – One of"gas","liquid","supercritical","supercritical_gas","supercritical_liquid","twophase", orNoneto clear.- Return type:
Self
- property phase: Literal['Liquid', 'Gas', 'Two-phase', 'Supercritical liquid', 'Supercritical gas', 'Supercritical fluid', 'Critical point', 'Unknown', 'Not imposed', 'Variable', 'N/A']¶
- point_1: tuple[Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity', 'B', 'CV', 'CVha', 'Cha', 'Conductivity', 'DewPoint', 'Enthalpy', 'Entropy', 'Hda', 'Hha', 'HumRat', 'K', 'Omega', 'P_w', 'R', 'RH', 'RelHum', 'Sda', 'Sha', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w'], Quantity[UnknownDimensionality] | Quantity[UnknownDimensionality, float]]¶
- point_2: tuple[Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity', 'B', 'CV', 'CVha', 'Cha', 'Conductivity', 'DewPoint', 'Enthalpy', 'Entropy', 'Hda', 'Hha', 'HumRat', 'K', 'Omega', 'P_w', 'R', 'RH', 'RelHum', 'Sda', 'Sha', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w'], Quantity[UnknownDimensionality] | Quantity[UnknownDimensionality, float]]¶
- class FluidState[source]¶
Bases:
TypedDict,Generic[MT]Valid CoolProp fluid state-input property names for
Fluid/Water.Used with
Unpackto statically check the**kwargskeys at the call site. TheQuantity[Any, float]arm of each value type lets one fixed point be a plain scalar while another is vectorised, so a mixedfloat+MTcall still infers the magnitude type correctly.
- class HumidAir(**kwargs)[source]¶
Bases:
CoolPropFluid[MT]Humid-air wrapper around CoolProp’s
HAPropsSIfunction.HumidAir.Mfollows CoolProp’s humid-air naming and returns dynamic viscosity. This differs fromFluid.M, which returns molar mass.Interface to the CoolProp function for humid air,
CoolProp.CoolProp.HAPropsSI. Needs three fixed points instead of two.- Parameters:
kwargs (
Unpack[HumidAirState[TypeVar(MT,float,ndarray[tuple[int],dtype[float64]],Series,Expr)]]) – Values for the three fixed points. The name of the keyword argument is the CoolProp property name.
- ALL_PROPERTIES: set[Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity', 'B', 'CV', 'CVha', 'Cha', 'Conductivity', 'DewPoint', 'Enthalpy', 'Entropy', 'Hda', 'Hha', 'HumRat', 'K', 'Omega', 'P_w', 'R', 'RH', 'RelHum', 'Sda', 'Sha', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w']] = {'B', 'C', 'CV', 'CVha', 'Cha', 'Conductivity', 'D', 'DewPoint', 'Enthalpy', 'Entropy', 'H', 'Hda', 'Hha', 'HumRat', 'K', 'M', 'Omega', 'P', 'P_w', 'R', 'RH', 'RelHum', 'S', 'Sda', 'Sha', 'T', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'V', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'Z', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w'}¶
- BACKEND: ClassVar[dict[Literal['backend'], Callable[[...], float | ndarray[tuple[int], dtype[float64]]]]] = {'backend': <nanobind.nb_func object>}¶
- PROPERTY_MAP: dict[tuple[Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity', 'B', 'CV', 'CVha', 'Cha', 'Conductivity', 'DewPoint', 'Enthalpy', 'Entropy', 'Hda', 'Hha', 'HumRat', 'K', 'Omega', 'P_w', 'R', 'RH', 'RelHum', 'Sda', 'Sha', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w'], ...], tuple[str, str]] = {('B', 'Twb', 'T_wb', 'WetBulb'): ('K', 'Wet-Bulb Temperature'), ('C', 'cp'): ('J/kg/K', 'Mixture specific heat per unit dry air'), ('CV',): ('J/kg/K', 'Mixture specific heat at constant volume per unit dry air'), ('CVha', 'cv_ha'): ('J/kg/K', 'Mixture specific heat at constant volume per unit humid air'), ('Cha', 'cp_ha'): ('J/kg/K', 'Mixture specific heat per unit humid air'), ('D', 'Tdp', 'DewPoint', 'T_dp'): ('K', 'Dew-Point Temperature'), ('H', 'Hda', 'Enthalpy'): ('J/kg', 'Mixture enthalpy per dry air'), ('Hha',): ('J/kg', 'Mixture enthalpy per humid air'), ('K', 'k', 'Conductivity'): ('W/m/K', 'Mixture thermal conductivity'), ('M', 'Visc', 'mu'): ('Pa*s', 'Mixture viscosity'), ('P',): ('Pa', 'Pressure'), ('P_w',): ('Pa', 'Partial pressure of water vapor'), ('R', 'RH', 'RelHum'): ('dimensionless', 'Relative humidity in [0, 1]'), ('S', 'Sda', 'Entropy'): ('J/kg/K', 'Mixture entropy per unit dry air'), ('Sha',): ('J/kg/K', 'Mixture entropy per unit humid air'), ('T', 'Tdb', 'T_db'): ('K', 'Dry-Bulb Temperature'), ('V', 'Vda'): ('m³/kg', 'Mixture volume per unit dry air'), ('Vha',): ('m³/kg', 'Mixture volume per unit humid air'), ('W', 'Omega', 'HumRat'): ('dimensionless', 'Humidity Ratio mass water per mass dry air'), ('Z',): ('dimensionless', 'Compressibility factor'), ('psi_w', 'Y'): ('dimensionless', 'Water mole fraction')}¶
- REPR_PROPERTIES: tuple[tuple[Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity', 'B', 'CV', 'CVha', 'Cha', 'Conductivity', 'DewPoint', 'Enthalpy', 'Entropy', 'Hda', 'Hha', 'HumRat', 'K', 'Omega', 'P_w', 'R', 'RH', 'RelHum', 'Sda', 'Sha', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w'], str], ...] = (('P', '.0f'), ('T', '.1f'), ('R', '.2f'), ('Vda', '.1f'), ('Vha', '.1f'), ('M', '.2g'))¶
- RETURN_UNITS: dict[Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity', 'B', 'CV', 'CVha', 'Cha', 'Conductivity', 'DewPoint', 'Enthalpy', 'Entropy', 'Hda', 'Hha', 'HumRat', 'K', 'Omega', 'P_w', 'R', 'RH', 'RelHum', 'Sda', 'Sha', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w'], str] = {'B': '°C', 'D': '°C', 'M': 'cP', 'P': 'kPa', 'P_w': 'kPa', 'T': '°C'}¶
- STATE_INPUTS: ClassVar[frozenset[str]] = frozenset({'B', 'D', 'DewPoint', 'Enthalpy', 'Entropy', 'H', 'Hda', 'Hha', 'HumRat', 'Omega', 'P', 'P_w', 'R', 'RH', 'RelHum', 'S', 'Sda', 'Sha', 'T', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'V', 'Vda', 'Vha', 'W', 'WetBulb', 'Y', 'psi_w'})¶
- point_1: tuple[Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity', 'B', 'CV', 'CVha', 'Cha', 'Conductivity', 'DewPoint', 'Enthalpy', 'Entropy', 'Hda', 'Hha', 'HumRat', 'K', 'Omega', 'P_w', 'R', 'RH', 'RelHum', 'Sda', 'Sha', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w'], Quantity[UnknownDimensionality] | Quantity[UnknownDimensionality, float]]¶
- point_2: tuple[Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity', 'B', 'CV', 'CVha', 'Cha', 'Conductivity', 'DewPoint', 'Enthalpy', 'Entropy', 'Hda', 'Hha', 'HumRat', 'K', 'Omega', 'P_w', 'R', 'RH', 'RelHum', 'Sda', 'Sha', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w'], Quantity[UnknownDimensionality] | Quantity[UnknownDimensionality, float]]¶
- point_3: tuple[Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity', 'B', 'CV', 'CVha', 'Cha', 'Conductivity', 'DewPoint', 'Enthalpy', 'Entropy', 'Hda', 'Hha', 'HumRat', 'K', 'Omega', 'P_w', 'R', 'RH', 'RelHum', 'Sda', 'Sha', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w'], Quantity[UnknownDimensionality] | Quantity[UnknownDimensionality, float]]¶
- class HumidAirState[source]¶
Bases:
TypedDict,Generic[MT]Valid CoolProp humid-air (
HAPropsSI) STATE-INPUT parameter names forHumidAir– the subset that can fix a state (matchesencomp.coolprop.HUMID_AIR_INPUTS; output-only properties likeVisc/Conductivity/ heat capacities are excluded). Used withUnpackto statically check the**kwargskeys at the call site.
- class Water(**kwargs)[source]¶
Bases:
Fluid[MT]Convenience class to access water and steam properties via CoolProp.
- Parameters:
kwargs (
Unpack[FluidState[TypeVar(MT,float,ndarray[tuple[int],dtype[float64]],Series,Expr)]]) – Values for the two fixed points. The name of the keyword argument is the CoolProp property name.
- clear_expr_evaluation_cache()[source]¶
Drop the cache of constructed CoolProp
pl.Exprnodes.Repeated evaluations of the same property, on the same fluid and inputs, return the identical expression object, so callers that deduplicate expressions by
id()see one node instead of many. Clearing the cache never changes a result; it only releases the cached nodes. Useful when benchmarking expression construction, or to free the (bounded) cache in a long-lived process that builds many distinct fluids.- Return type:
None
encomp.polars¶
Polars integration: a unit-carrying extension data type.
Importing this module registers the "encomp.unit" extension type with polars.
After that, plain polars I/O (pl.read_parquet, pl.scan_parquet,
pl.sink_parquet, …) round-trips unit-typed columns with no encomp-specific
read/write functions: the unit is column-level Arrow field metadata
(ARROW:extension:name / ARROW:extension:metadata) in the file. Metadata-aware
Arrow consumers can inspect those standard field keys with their ordinary schema APIs.
Unregistered Polars 1.x readers warn and load storage values by default; readers using
POLARS_UNKNOWN_EXTENSION_TYPE_BEHAVIOR=load_as_extension preserve a generic
extension (the planned Polars 2.0 default).
Polars refuses arithmetic on extension-typed columns (there is no third-party kernel
or supertype resolution), so the dtype is deliberately only a persistence and
guardrail layer: unit algebra lives in encomp.units.Quantity, which is
exposed by validated QuantityFrame descriptors and written back through
QuantityFrame.derive(). The with_units() and units_of() helpers
remain available for explicit low-level ingestion and metadata inspection.
Warning
The underlying polars extension-type API is marked unstable by polars. encomp pins the observed behavior in its test suite so a breaking polars bump fails loudly rather than silently.
- class Assignment(column, value)[source]¶
Bases:
GenericA dimension-checked output binding created by
Column.assign().- Parameters:
column (Column[DT])
value (Quantity[DT, pl.Expr])
- class Column(value, dimensionality, *, name=None)[source]¶
Bases:
GenericA unit-bearing column declaration on a
QuantityFrame.Access through the schema class returns the declaration. Access through a validated schema instance returns a
Quantity[DT, pl.Expr].- Parameters:
value (str | Unit[Any])
dimensionality (type[DT])
name (str | None)
- assign(value)[source]¶
Bind a typed expression quantity to this declared output column.
- Return type:
Assignment[TypeVar(DT, bound=Dimensionality)]- Parameters:
value (Quantity[DT, pl.Expr])
- property name: str¶
Physical Polars column name, defaulting to the schema attribute name.
- class QuantityFrame(frame)[source]¶
Bases:
objectValidated, lazy Polars frame with typed quantity-column descriptors.
- Parameters:
frame (pl.DataFrame | pl.LazyFrame)
- classmethod derive(frame, *assignments)[source]¶
Derive declared quantity columns from typed expression assignments.
- Return type:
Self- Parameters:
frame (QuantityFrame | DataFrame | LazyFrame)
assignments (Assignment[Any])
- classmethod from_untyped(frame)[source]¶
Assign the declared units to bare numeric columns, then validate.
- Return type:
Self- Parameters:
frame (DataFrame | LazyFrame)
- lf: LazyFrame¶
- class UnitDType(unit, storage=None)[source]¶
Bases:
BaseExtensionPolars extension dtype carrying a physical unit as column metadata.
A dtype instance consists of the stable extension name
"encomp.unit", a numeric storage dtype, and a canonical unit string. Polars refuses value-producing arithmetic on extension columns; validatedencomp.polars.QuantityFramedescriptors enter Quantity unit algebra andQuantityFrame.derivereturns results to a frame.- Parameters:
unit (str | Unit[Any])
storage (pl.DataType | None)
- unit(value, *, name=None, asdim=None)[source]¶
- Overloads:
value (_ut.DimensionlessUnits), name (str | None) → Column[_ut.Dimensionless]
value (_ut.CurrencyUnits), name (str | None) → Column[_ut.Currency]
value (_ut.CurrencyPerEnergyUnits), name (str | None) → Column[_ut.CurrencyPerEnergy]
value (_ut.CurrencyPerMassUnits), name (str | None) → Column[_ut.CurrencyPerMass]
value (_ut.CurrencyPerVolumeUnits), name (str | None) → Column[_ut.CurrencyPerVolume]
value (_ut.CurrencyPerTimeUnits), name (str | None) → Column[_ut.CurrencyPerTime]
value (_ut.LengthUnits), name (str | None) → Column[_ut.Length]
value (_ut.MassUnits), name (str | None) → Column[_ut.Mass]
value (_ut.TimeUnits), name (str | None) → Column[_ut.Time]
value (_ut.FrequencyUnits), name (str | None) → Column[_ut.Frequency]
value (_ut.TemperatureUnits), name (str | None) → Column[_ut.Temperature]
value (_ut.TemperatureDifferenceUnits), name (str | None) → Column[_ut.TemperatureDifference]
value (_ut.SubstanceUnits), name (str | None) → Column[_ut.Substance]
value (_ut.MolarMassUnits), name (str | None) → Column[_ut.MolarMass]
value (_ut.SubstancePerMassUnits), name (str | None) → Column[_ut.SubstancePerMass]
value (_ut.CurrentUnits), name (str | None) → Column[_ut.Current]
value (_ut.LuminosityUnits), name (str | None) → Column[_ut.Luminosity]
value (_ut.AreaUnits), name (str | None) → Column[_ut.Area]
value (_ut.VolumeUnits), name (str | None) → Column[_ut.Volume]
value (_ut.NormalVolumeUnits), name (str | None) → Column[_ut.NormalVolume]
value (_ut.PressureUnits), name (str | None) → Column[_ut.Pressure]
value (_ut.MassFlowUnits), name (str | None) → Column[_ut.MassFlow]
value (_ut.VolumeFlowUnits), name (str | None) → Column[_ut.VolumeFlow]
value (_ut.NormalVolumeFlowUnits), name (str | None) → Column[_ut.NormalVolumeFlow]
value (_ut.DensityUnits), name (str | None) → Column[_ut.Density]
value (_ut.MolarDensityUnits), name (str | None) → Column[_ut.MolarDensity]
value (_ut.SpecificVolumeUnits), name (str | None) → Column[_ut.SpecificVolume]
value (_ut.NormalVolumePerMassUnits), name (str | None) → Column[_ut.NormalVolumePerMass]
value (_ut.MassPerNormalVolumeUnits), name (str | None) → Column[_ut.MassPerNormalVolume]
value (_ut.EnergyUnits), name (str | None) → Column[_ut.Energy]
value (_ut.PowerUnits), name (str | None) → Column[_ut.Power]
value (_ut.VelocityUnits), name (str | None) → Column[_ut.Velocity]
value (_ut.ForceUnits), name (str | None) → Column[_ut.Force]
value (_ut.DynamicViscosityUnits), name (str | None) → Column[_ut.DynamicViscosity]
value (_ut.KinematicViscosityUnits), name (str | None) → Column[_ut.KinematicViscosity]
value (_ut.EnergyPerMassUnits), name (str | None) → Column[_ut.EnergyPerMass]
value (_ut.MolarSpecificEnthalpyUnits), name (str | None) → Column[_ut.MolarSpecificEnthalpy]
value (_ut.SpecificHeatCapacityUnits), name (str | None) → Column[_ut.SpecificHeatCapacity]
value (_ut.ThermalConductivityUnits), name (str | None) → Column[_ut.ThermalConductivity]
value (_ut.PowerPerAreaUnits), name (str | None) → Column[_ut.PowerPerArea]
value (_ut.HeatTransferCoefficientUnits), name (str | None) → Column[_ut.HeatTransferCoefficient]
value (Unit[DT]), name (str | None) → Column[DT]
value (str | Unit[Any]), name (str | None), asdim (type[DT]) → Column[DT]
value (str | Unit[Any]), name (str | None), asdim (None) → Column[UnknownDimensionality]
- Parameters:
value (str | Unit[Any])
name (str | None)
asdim (type[Dimensionality] | None)
- Return type:
Column[Any]
Declare a quantity column, inferring dimensionality from its unit.
Registered literal spellings are also inferred by static type checkers. Any other valid Pint unit is inferred at runtime and is statically
UnknownDimensionalityunlessasdim=is supplied. The override is validated; it never performs an unchecked cast.
- units_of(frame)[source]¶
Units of every unit-typed column in the frame, read from the schema.
Reads only schema metadata: no data pass, and a
LazyFrame(e.g. apl.scan_parquet) is not collected. Columns without a unit dtype are omitted.- Return type:
dict[str,Unit[Any]]- Parameters:
frame (DataFrame | LazyFrame)
- with_units(frame, units)[source]¶
- Overloads:
frame (pl.DataFrame), units (Mapping[str, str | Unit[Any]]) → pl.DataFrame
frame (pl.LazyFrame), units (Mapping[str, str | Unit[Any]]) → pl.LazyFrame
- Parameters:
frame (DataFrame | LazyFrame)
units (Mapping[str, str | Unit[Any]])
- Return type:
DataFrame | LazyFrame
Attach unit dtypes to existing numeric columns.
The magnitudes are not touched and the storage dtype is preserved (
Float32staysFloat32). The unit schema is always spelled explicitly by the caller — it is never inferred from data. A key that is not a column, a non-numeric column, or an unknown unit string raises.
encomp.coolprop¶
Parallel CoolProp property evaluation as Polars expression plugins.
The fluid / water / humid_air API mirrors encomp.fluids: fluid
requires the fluid name (with the backend folded in, e.g. "HEOS::CarbonDioxide")
exactly as encomp.fluids.Fluid does, water fixes it to IF97 water/steam like
encomp.fluids.Water, a mixture is given by a composition dict, and a fixed
phase by assume_phase.
import polars as pl
from encomp import coolprop as cp
df.select(
cp.water("DMASS", "P", "T").alias("rho"), # IF97 water/steam
cp.water("HMASS", "P", "T").alias("h"),
) # independent properties run in PARALLEL (no GIL)
df.select(cp.fluid("DMASS", "P", "H", name="HEOS::Water")) # any input pair (named by inputs)
df.select(cp.fluid("DMASS", "P", "T", name="HEOS::CO2&O2", # mixture, mole fractions
composition={"CO2": 0.7, "O2": 0.3}))
df.select(cp.humid_air("W", "P", "T", "R")) # humid air
# for differently-named columns, alias them: cp.water("DMASS", pl.col("p").alias("P"), "T")
- ASSUMED_PHASES: frozenset[Literal['gas', 'liquid', 'supercritical', 'supercritical_gas', 'supercritical_liquid', 'twophase']] = frozenset({'gas', 'liquid', 'supercritical', 'supercritical_gas', 'supercritical_liquid', 'twophase'})¶
Runtime set of the user-facing assumed-phase names in
AssumedPhase.
- BACKENDS: frozenset[Literal['HEOS', 'IF97', 'REFPROP', 'SRK', 'PR', 'PCSAFT', 'VTPR', 'INCOMP', 'BICUBIC&HEOS', 'TTSE&HEOS']] = frozenset({'BICUBIC&HEOS', 'HEOS', 'IF97', 'INCOMP', 'PCSAFT', 'PR', 'REFPROP', 'SRK', 'TTSE&HEOS', 'VTPR'})¶
Runtime set of the CoolProp
AbstractStatebackend names inBackend.
- FLUID_INPUTS: frozenset[Literal['P', 'T', 'Q', 'D', 'DMASS', 'DMOLAR', 'Dmass', 'Dmolar', 'H', 'HMASS', 'HMOLAR', 'Hmass', 'Hmolar', 'S', 'SMASS', 'SMOLAR', 'Smass', 'Smolar', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar']] = frozenset({'D', 'DMASS', 'DMOLAR', 'Dmass', 'Dmolar', 'H', 'HMASS', 'HMOLAR', 'Hmass', 'Hmolar', 'P', 'Q', 'S', 'SMASS', 'SMOLAR', 'Smass', 'Smolar', 'T', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar'})¶
Runtime set of the fluid state-input names in
FluidInput– the subset ofFluidParamthat can fix a state.
- FLUID_PARAMS: frozenset[Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity']] = frozenset({'A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GAS_CONSTANT', 'GMASS', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity'})¶
Runtime set of the CoolProp fluid parameter names in
FluidParam.
- HUMID_AIR_INPUTS: frozenset[Literal['T', 'Tdb', 'T_db', 'B', 'Twb', 'T_wb', 'WetBulb', 'D', 'Tdp', 'T_dp', 'DewPoint', 'W', 'Omega', 'HumRat', 'psi_w', 'R', 'RH', 'RelHum', 'H', 'Hda', 'Hha', 'Enthalpy', 'S', 'Sda', 'Sha', 'Entropy', 'V', 'Vda', 'Vha', 'P', 'P_w', 'Y']] = frozenset({'B', 'D', 'DewPoint', 'Enthalpy', 'Entropy', 'H', 'Hda', 'Hha', 'HumRat', 'Omega', 'P', 'P_w', 'R', 'RH', 'RelHum', 'S', 'Sda', 'Sha', 'T', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'V', 'Vda', 'Vha', 'W', 'WetBulb', 'Y', 'psi_w'})¶
Runtime set of the
HAPropsSIstate-input names inHumidAirInput– the subset ofHumidAirParamthat can fix a state.
- HUMID_AIR_PARAMS: frozenset[Literal['B', 'C', 'CV', 'CVha', 'Cha', 'Conductivity', 'D', 'DewPoint', 'Enthalpy', 'Entropy', 'H', 'Hda', 'Hha', 'HumRat', 'K', 'M', 'Omega', 'P', 'P_w', 'R', 'RH', 'RelHum', 'S', 'Sda', 'Sha', 'T', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'V', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'Z', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w']] = frozenset({'B', 'C', 'CV', 'CVha', 'Cha', 'Conductivity', 'D', 'DewPoint', 'Enthalpy', 'Entropy', 'H', 'Hda', 'Hha', 'HumRat', 'K', 'M', 'Omega', 'P', 'P_w', 'R', 'RH', 'RelHum', 'S', 'Sda', 'Sha', 'T', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'V', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'Z', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w'})¶
Runtime set of the
HAPropsSIparameter names inHumidAirParam.
- PHASES: frozenset[Literal['phase_liquid', 'phase_gas', 'phase_twophase', 'phase_supercritical', 'phase_supercritical_gas', 'phase_supercritical_liquid', 'phase_critical_point']] = frozenset({'phase_critical_point', 'phase_gas', 'phase_liquid', 'phase_supercritical', 'phase_supercritical_gas', 'phase_supercritical_liquid', 'phase_twophase'})¶
Runtime set of the low-level CoolProp
phase_*strings inPhase.
- PHASE_IGNORING_BACKENDS: frozenset[str] = frozenset({'IF97'})¶
assuming a phase has no effect there, so
fluid()logs a warning whenassume_phasenames one of these. Mirrors the setencomp.fluids.Fluiduses.- Type:
Region-explicit backends that ignore
AbstractState.specify_phase
- WATER_NAME: Literal['Water', 'IF97::Water', 'HEOS::Water', 'HEOS', 'Air', 'Nitrogen', 'Oxygen', 'CarbonDioxide', 'Hydrogen', 'Methane', 'Ammonia', 'Argon', 'R134a'] = 'IF97::Water'¶
The fluid name behind
encomp.fluids.Water, and the onewater()evaluates.
- fluid(output, input1, input2, *, name, assume_phase=None, composition=None)[source]¶
A CoolProp fluid property (
output) as a parallel Polars expression.Mirrors
encomp.fluids.Fluid, including thatnameis required. Usewater()for the IF97 water/steam shorthand, asencomp.fluids.Watermirrorsencomp.fluids.Fluid.The fluid is identified by
namewith the backend folded in ("HEOS::CarbonDioxide","IF97::Water"; a bare"Water"defaults to HEOS/IAPWS-95). A mixture is given either by fractions in the name ("HEOS::CO2[0.5]&O2[0.5]") or acomposition={species: mole fraction}dict; mole fractions must sum to 1 (an off-by-more-than-rounding sum is an error). An incompressible mixture instead carries a single concentration in the name ("INCOMP::MEG[0.5]"), on the fluid’s own basis (seeresolve_fluid_spec()).assume_phasepins the phase, skipping CoolProp’s phase-stability search (a speed tool; honoured by HEOS/GERG, ignored by region-explicit backends like IF97, which log a warning).Each input identifies its property by NAME – a string is the property and the column read from it; an expression by its output name (
pl.col("P")orpl.col("p").alias("P")). Both must be CoolProp state inputs (P/T/Q/D/H/S/U, any pair: PT, PH, PQ, …).Inputs are numeric columns holding SI magnitudes. A unit-carrying extension dtype (
encomp.polars) is accepted when its unit is already the SI unit CoolProp expects for that input (verified against CoolProp’s own parameter metadata); any other unit is refused at schema-resolution time with the expected unit named – convert first (e.g.encomp.polars.quantities+.to(...)), or pass raw SI values via.ext.storage().- Return type:
Expr- Parameters:
output (Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity'])
input1 (Literal['P', 'T', 'Q', 'D', 'DMASS', 'DMOLAR', 'Dmass', 'Dmolar', 'H', 'HMASS', 'HMOLAR', 'Hmass', 'Hmolar', 'S', 'SMASS', 'SMOLAR', 'Smass', 'Smolar', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar'] | ~polars.expr.expr.Expr)
input2 (Literal['P', 'T', 'Q', 'D', 'DMASS', 'DMOLAR', 'Dmass', 'Dmolar', 'H', 'HMASS', 'HMOLAR', 'Hmass', 'Hmolar', 'S', 'SMASS', 'SMOLAR', 'Smass', 'Smolar', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar'] | ~polars.expr.expr.Expr)
name (Literal['Water', 'IF97::Water', 'HEOS::Water', 'HEOS', 'Air', 'Nitrogen', 'Oxygen', 'CarbonDioxide', 'Hydrogen', 'Methane', 'Ammonia', 'Argon', 'R134a'] | str)
assume_phase (Literal['gas', 'liquid', 'supercritical', 'supercritical_gas', 'supercritical_liquid', 'twophase'] | None)
composition (dict[Literal['Water', 'IF97::Water', 'HEOS::Water', 'HEOS', 'Air', 'Nitrogen', 'Oxygen', 'CarbonDioxide', 'Hydrogen', 'Methane', 'Ammonia', 'Argon', 'R134a'] | str, float | int] | None)
- humid_air(output, input1, input2, input3)[source]¶
A humid-air (HAPropsSI) property as a Polars expression.
Each input identifies its property by name (the string, or the expression’s output name); all three must be HAPropsSI state inputs (T, P, R, W, B, …). Like
fluid(), inputs hold SI magnitudes: a unit-carrying extension dtype is accepted only when its unit is already the expected SI unit, and refused with the expected unit named otherwise.- Return type:
Expr- Parameters:
output (Literal['B', 'C', 'CV', 'CVha', 'Cha', 'Conductivity', 'D', 'DewPoint', 'Enthalpy', 'Entropy', 'H', 'Hda', 'Hha', 'HumRat', 'K', 'M', 'Omega', 'P', 'P_w', 'R', 'RH', 'RelHum', 'S', 'Sda', 'Sha', 'T', 'T_db', 'T_dp', 'T_wb', 'Tdb', 'Tdp', 'Twb', 'V', 'Vda', 'Vha', 'Visc', 'W', 'WetBulb', 'Y', 'Z', 'cp', 'cp_ha', 'cv_ha', 'k', 'mu', 'psi_w'])
input1 (Literal['T', 'Tdb', 'T_db', 'B', 'Twb', 'T_wb', 'WetBulb', 'D', 'Tdp', 'T_dp', 'DewPoint', 'W', 'Omega', 'HumRat', 'psi_w', 'R', 'RH', 'RelHum', 'H', 'Hda', 'Hha', 'Enthalpy', 'S', 'Sda', 'Sha', 'Entropy', 'V', 'Vda', 'Vha', 'P', 'P_w', 'Y'] | ~polars.expr.expr.Expr)
input2 (Literal['T', 'Tdb', 'T_db', 'B', 'Twb', 'T_wb', 'WetBulb', 'D', 'Tdp', 'T_dp', 'DewPoint', 'W', 'Omega', 'HumRat', 'psi_w', 'R', 'RH', 'RelHum', 'H', 'Hda', 'Hha', 'Enthalpy', 'S', 'Sda', 'Sha', 'Entropy', 'V', 'Vda', 'Vha', 'P', 'P_w', 'Y'] | ~polars.expr.expr.Expr)
input3 (Literal['T', 'Tdb', 'T_db', 'B', 'Twb', 'T_wb', 'WetBulb', 'D', 'Tdp', 'T_dp', 'DewPoint', 'W', 'Omega', 'HumRat', 'psi_w', 'R', 'RH', 'RelHum', 'H', 'Hda', 'Hha', 'Enthalpy', 'S', 'Sda', 'Sha', 'Entropy', 'V', 'Vda', 'Vha', 'P', 'P_w', 'Y'] | ~polars.expr.expr.Expr)
- is_assumed_phase(name)[source]¶
- Return type:
TypeIs[Literal['gas','liquid','supercritical','supercritical_gas','supercritical_liquid','twophase']]- Parameters:
name (str)
- is_backend(name)[source]¶
- Return type:
TypeIs[Literal['HEOS','IF97','REFPROP','SRK','PR','PCSAFT','VTPR','INCOMP','BICUBIC&HEOS','TTSE&HEOS']]- Parameters:
name (str)
- is_fluid_input(name)[source]¶
- Return type:
TypeIs[Literal['P','T','Q','D','DMASS','DMOLAR','Dmass','Dmolar','H','HMASS','HMOLAR','Hmass','Hmolar','S','SMASS','SMOLAR','Smass','Smolar','U','UMASS','UMOLAR','Umass','Umolar']]- Parameters:
name (str)
- is_fluid_param(name)[source]¶
- Return type:
TypeIs[Literal['A','C','CONDUCTIVITY','CP0MASS','CP0MOLAR','CPMASS','CPMOLAR','CVMASS','CVMOLAR','Cp0mass','Cp0molar','Cpmass','Cpmolar','Cvmass','Cvmolar','D','DELTA','DIPOLE_MOMENT','DMASS','DMOLAR','Delta','Dmass','Dmolar','G','GMASS','GAS_CONSTANT','GMOLAR','GMOLAR_RESIDUAL','Gmass','Gmolar','Gmolar_residual','H','HELMHOLTZMASS','HELMHOLTZMOLAR','HMASS','HMOLAR','HMOLAR_RESIDUAL','Helmholtzmass','Helmholtzmolar','Hmass','Hmolar','Hmolar_residual','I','ISENTROPIC_EXPANSION_COEFFICIENT','ISOBARIC_EXPANSION_COEFFICIENT','ISOTHERMAL_COMPRESSIBILITY','L','M','MOLARMASS','MOLAR_MASS','MOLEMASS','O','P','PCRIT','PHASE','PMAX','PMIN','PRANDTL','PTRIPLE','P_CRITICAL','P_MAX','P_MIN','P_REDUCING','P_TRIPLE','P_max','P_min','Pcrit','Phase','Prandtl','Q','RHOCRIT','RHOMASS_CRITICAL','RHOMASS_REDUCING','RHOMOLAR_CRITICAL','RHOMOLAR_REDUCING','S','SMASS','SMOLAR','SMOLAR_RESIDUAL','SPEED_OF_SOUND','SURFACE_TENSION','Smass','Smolar','Smolar_residual','T','TAU','TCRIT','TMAX','TMIN','TTRIPLE','T_CRITICAL','T_FREEZE','T_MAX','T_MIN','T_REDUCING','T_TRIPLE','T_critical','T_freeze','T_max','T_min','T_reducing','T_triple','Tau','Tcrit','Tmax','Tmin','Ttriple','U','UMASS','UMOLAR','Umass','Umolar','V','VISCOSITY','Z','conductivity','dipole_moment','gas_constant','isentropic_expansion_coefficient','isobaric_expansion_coefficient','isothermal_compressibility','molar_mass','molarmass','molemass','p_critical','p_reducing','p_triple','pcrit','pmax','pmin','ptriple','rhocrit','rhomass_critical','rhomass_reducing','rhomolar_critical','rhomolar_reducing','speed_of_sound','surface_tension','viscosity']]- Parameters:
name (str)
- is_humid_air_input(name)[source]¶
- Return type:
TypeIs[Literal['T','Tdb','T_db','B','Twb','T_wb','WetBulb','D','Tdp','T_dp','DewPoint','W','Omega','HumRat','psi_w','R','RH','RelHum','H','Hda','Hha','Enthalpy','S','Sda','Sha','Entropy','V','Vda','Vha','P','P_w','Y']]- Parameters:
name (str)
- is_humid_air_param(name)[source]¶
- Return type:
TypeIs[Literal['B','C','CV','CVha','Cha','Conductivity','D','DewPoint','Enthalpy','Entropy','H','Hda','Hha','HumRat','K','M','Omega','P','P_w','R','RH','RelHum','S','Sda','Sha','T','T_db','T_dp','T_wb','Tdb','Tdp','Twb','V','Vda','Vha','Visc','W','WetBulb','Y','Z','cp','cp_ha','cv_ha','k','mu','psi_w']]- Parameters:
name (str)
- is_phase(name)[source]¶
- Return type:
TypeIs[Literal['phase_liquid','phase_gas','phase_twophase','phase_supercritical','phase_supercritical_gas','phase_supercritical_liquid','phase_critical_point']]- Parameters:
name (str)
- lib_path()[source]¶
Absolute path to the bundled CoolProp dynamic library for this platform.
- Return type:
str
- lib_version()[source]¶
CoolProp version of the bundled library (cached; the bundled lib never changes).
- Return type:
str
- resolve_fluid_spec(name, composition=None)[source]¶
Resolve a CoolProp
name(+ optionalcompositiondict) into the(backend, fluids, fractions)anAbstractStateneeds. The single place that parses and validates a fluid name + composition;encomp.fluids.Fluiddelegates here.The backend may be folded into
name("IF97::Water","HEOS::CO2&O2") or, with acompositiondict, passed as the bare backend ("HEOS"); no backend defaults to HEOS.fractionsisNonefor a pure fluid. Otherwise its basis is FLUID-SPECIFIC (CoolProp’sset_fractionsselects it, the caller never does):a multi-species mixture (HEOS/PR/…) is mole fractions that must sum to 1 (a small tolerance absorbs float rounding); a sum further off is an error, not a silent renormalise.
a single-species incompressible concentration (
"INCOMP::MEG[0.5]") is an absolute fraction on the fluid’s own basis – mass for aqueous solutions (glycols, brines, seawater), volume for the volume-specified antifreezes – and is NOT normalised.
- Return type:
tuple[str,str,list[float] |None]- Parameters:
name (Literal['Water', 'IF97::Water', 'HEOS::Water', 'HEOS', 'Air', 'Nitrogen', 'Oxygen', 'CarbonDioxide', 'Hydrogen', 'Methane', 'Ammonia', 'Argon', 'R134a'] | str)
composition (dict[Literal['Water', 'IF97::Water', 'HEOS::Water', 'HEOS', 'Air', 'Nitrogen', 'Oxygen', 'CarbonDioxide', 'Hydrogen', 'Methane', 'Ammonia', 'Argon', 'R134a'] | str, float | int] | None)
- self_check()[source]¶
True if the plugin loads and evaluates one known value correctly (cached).
- Return type:
bool
- water(output, input1, input2)[source]¶
A water/steam property as a parallel Polars expression, using IAPWS-IF97.
Mirrors
encomp.fluids.Water: the fluid is fixed to"IF97::Water", so there is noname. Equivalent tofluid(output, input1, input2, name="IF97::Water").compositionandassume_phaseare not accepted: water is a pure fluid, and IF97 is region-explicit so an assumed phase would be ignored. Usefluid(..., name="HEOS::Water")for the IAPWS-95 reference formulation, which does honour an assumed phase.- Return type:
Expr- Parameters:
output (Literal['A', 'C', 'CONDUCTIVITY', 'CP0MASS', 'CP0MOLAR', 'CPMASS', 'CPMOLAR', 'CVMASS', 'CVMOLAR', 'Cp0mass', 'Cp0molar', 'Cpmass', 'Cpmolar', 'Cvmass', 'Cvmolar', 'D', 'DELTA', 'DIPOLE_MOMENT', 'DMASS', 'DMOLAR', 'Delta', 'Dmass', 'Dmolar', 'G', 'GMASS', 'GAS_CONSTANT', 'GMOLAR', 'GMOLAR_RESIDUAL', 'Gmass', 'Gmolar', 'Gmolar_residual', 'H', 'HELMHOLTZMASS', 'HELMHOLTZMOLAR', 'HMASS', 'HMOLAR', 'HMOLAR_RESIDUAL', 'Helmholtzmass', 'Helmholtzmolar', 'Hmass', 'Hmolar', 'Hmolar_residual', 'I', 'ISENTROPIC_EXPANSION_COEFFICIENT', 'ISOBARIC_EXPANSION_COEFFICIENT', 'ISOTHERMAL_COMPRESSIBILITY', 'L', 'M', 'MOLARMASS', 'MOLAR_MASS', 'MOLEMASS', 'O', 'P', 'PCRIT', 'PHASE', 'PMAX', 'PMIN', 'PRANDTL', 'PTRIPLE', 'P_CRITICAL', 'P_MAX', 'P_MIN', 'P_REDUCING', 'P_TRIPLE', 'P_max', 'P_min', 'Pcrit', 'Phase', 'Prandtl', 'Q', 'RHOCRIT', 'RHOMASS_CRITICAL', 'RHOMASS_REDUCING', 'RHOMOLAR_CRITICAL', 'RHOMOLAR_REDUCING', 'S', 'SMASS', 'SMOLAR', 'SMOLAR_RESIDUAL', 'SPEED_OF_SOUND', 'SURFACE_TENSION', 'Smass', 'Smolar', 'Smolar_residual', 'T', 'TAU', 'TCRIT', 'TMAX', 'TMIN', 'TTRIPLE', 'T_CRITICAL', 'T_FREEZE', 'T_MAX', 'T_MIN', 'T_REDUCING', 'T_TRIPLE', 'T_critical', 'T_freeze', 'T_max', 'T_min', 'T_reducing', 'T_triple', 'Tau', 'Tcrit', 'Tmax', 'Tmin', 'Ttriple', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar', 'V', 'VISCOSITY', 'Z', 'conductivity', 'dipole_moment', 'gas_constant', 'isentropic_expansion_coefficient', 'isobaric_expansion_coefficient', 'isothermal_compressibility', 'molar_mass', 'molarmass', 'molemass', 'p_critical', 'p_reducing', 'p_triple', 'pcrit', 'pmax', 'pmin', 'ptriple', 'rhocrit', 'rhomass_critical', 'rhomass_reducing', 'rhomolar_critical', 'rhomolar_reducing', 'speed_of_sound', 'surface_tension', 'viscosity'])
input1 (Literal['P', 'T', 'Q', 'D', 'DMASS', 'DMOLAR', 'Dmass', 'Dmolar', 'H', 'HMASS', 'HMOLAR', 'Hmass', 'Hmolar', 'S', 'SMASS', 'SMOLAR', 'Smass', 'Smolar', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar'] | ~polars.expr.expr.Expr)
input2 (Literal['P', 'T', 'Q', 'D', 'DMASS', 'DMOLAR', 'Dmass', 'Dmolar', 'H', 'HMASS', 'HMOLAR', 'Hmass', 'Hmolar', 'S', 'SMASS', 'SMOLAR', 'Smass', 'Smolar', 'U', 'UMASS', 'UMOLAR', 'Umass', 'Umolar'] | ~polars.expr.expr.Expr)
encomp.sympy¶
Imports and extends the sympy library for symbolic mathematics.
Contains tools for converting SymPy expressions to Python modules and functions.
- class Symbol(name, **assumptions)[source]¶
Bases:
SymbolA
sympy.Symbolextended with convenience methods for typeset sub- and superscripts (_(),__(),decorate()). Each method returns a new symbol with the same assumptions as the original.Symbols are identified by name and assumptions:
>>> from sympy import Symbol >>> Symbol("x") == Symbol("x")
True >>> Symbol(“x”, real=True) == Symbol(“x”, real=False) False
- append(s, where='sub')[source]¶
Adds the input
sto an existing sub- or superscript. Does not append to prefixes. Creates the sub- or superscript if it does not exist.- Parameters:
s (
str|int) – Text or index to be addedwhere (
Literal['sub','sup']) – Whether to append to the subscript or superscript, by default ‘sub’
- Returns:
A new symbol with the same assumptions as the input, with updated sub- or superscript
- Return type:
Self
- decorate(prefix=None, suffix=None, prefix_sub=None, prefix_sup=None, suffix_sub=None, suffix_sup=None)[source]¶
Method that decorates a symbol with subscripts and/or superscripts before or after the symbol. Returns a new symbol object with the same assumptions (i.e. real, positive, complex, etc…) as the input.
Using LaTeX syntax supported by
sympy:{prefix}^{prefix_sup}_{prefix_sub}{symbol}_{suffix_sub}^{suffix_sup}{suffix}symbolis the input symbol. Theprefixandsuffixparts are added without_or^. Each of the parts (exceptsymbol) can be empty.The decorations can be string or integer, floats are not allowed. In case the input symbol already contains sub- or superscripts, the decorations are not appended to those. Instead, a new level is introduced. To keep things simple, make sure that the input symbol is a simple symbol.
Use the
appendmethod to append to an existing sub- or superscript in the suffix.- Parameters:
prefix (
str|int|None) – Prefix added before the symbol, by default Nonesuffix (
str|int|None) – Suffix added after the symbol, by default Noneprefix_sub (
str|int|None) – Subscript prefix before the symbol and afterprefix, by default Noneprefix_sup (
str|int|None) – Superscript prefix before the symbol and afterprefix, by default Nonesuffix_sub (
str|int|None) – Subscript suffix after the symbol and beforesuffix, by default Nonesuffix_sup (
str|int|None) – Superscript suffix after the symbol and beforesuffix, by default None
- Returns:
A new symbol with the same assumptions as the input, with added decorations
- Return type:
Self
- default_assumptions = {}¶
- name¶
- evaluate(e, value_map, *, units=False)[source]¶
Evaluates the input expression, given the mapping of symbol to value in
value_map.- Parameters:
e (
Basic) – Input expression to evaluatevalue_map (
dict[Symbol,Quantity|ndarray]) – Mapping from symbol to value for all required symbols ine, additional symbols may be presentunits (
bool) – Whether to keep the units, if False Quantity is converted to float (after callingto_base_units()), by default False
- Returns:
Value of the expression. Returns a
Quantityifunits=True; otherwise returns the numeric magnitude asfloatornp.ndarray.- Return type:
Quantity|ndarray|float
- get_args(e)[source]¶
Returns a sorted list of identifiers for each free symbol in the input expression. The sort order is according to the string outputs from
encomp.sympy.to_identifier().- Parameters:
e (
Basic) – Input expression- Returns:
Sorted list of identifiers for each free symbol
- Return type:
list[str]
- get_function(e, *, units=False)[source]¶
Wrapper around
encomp.sympy.get_lambda()that handles inputs and potential units.- Parameters:
e (
Basic) – Input expressionunits (
bool) – Whether to keep the units, if False Quantity is converted to float (after callingto_base_units()), by default False
- Returns:
Function that evaluates the input expression from a mapping of symbols to values.
- Return type:
Callable[[dict[Any,Any]],Any]
- get_lambda(e, *, to_str=False)[source]¶
- Overloads:
e (sp.Basic), to_str (Literal[True]) → tuple[str, list[str]]
e (sp.Basic), to_str (Literal[False]) → tuple[Callable[…, Any], list[str]]
e (sp.Basic) → tuple[Callable[…, Any], list[str]]
- Parameters:
e (Basic)
to_str (bool)
- Return type:
tuple[Callable[[…], Any] | str, list[str]]
Converts the input expression to a lambda function with valid identifiers as parameter names.
- Parameters:
e (
Basic) – Input expressionto_str (
bool) – Whether to return the string representation of the lambda function, by default False
- Returns:
The lambda function (or string representation) and the list of parameters to the function
- Return type:
tuple[Callable[…, Any] | str, list[str]]
- get_lambda_kwargs(value_map, include=None, *, units=False)[source]¶
Returns a mapping from identifier to value (Quantity or float) based on the input value map (Symbol to value). If
includeis a list, only these symbols will be included.- Parameters:
value_map (
dict[Symbol|str,Quantity|ndarray]) – Mapping from symbol or symbol identifier to valueinclude (
Sequence[Symbol|str] |None) – Optional sequence of symbols or symbol identifiers to include, by default Noneunits (
bool) – Whether to keep the units, if False Quantity is converted to float (after callingto_base_units()), by default False
- Returns:
Mapping from identifier to value
- Return type:
dict[str,Quantity|ndarray|float]
- get_lambda_matrix(M)[source]¶
Converts the input matrix into a lambda function that returns an array. Converts the matrix to Python source, it is not possible to use in-memory lambda functions for this. Use
eval(src)on the output from this function to create a function object.- Parameters:
M (
MutableDenseMatrix) – Input matrix- Returns:
Python source code for the function and a list of parameters
- Return type:
tuple[str,list[str]]
- get_sol_expr(equations, symbol, avoid=None)[source]¶
Wrapper around
sp.solvethat returns the solution expression for a single symbol, or None in case SymPy could not solve for the specified symbol. Only considers equations in the input list that actually contains the symbol. Prefers to use equations that containsymbolon the LHS.- Parameters:
equations (
Equality|list[Equality]) – List of equations or a single equationsymbol (
Symbol) – Symbol to solve for (isolate)avoid (
set[Symbol] |None) – Set of symbols to avoid in the substitution expressions, by default None
- Returns:
Expression that equals
symbol, or None in case the equation(s) could not be solved- Return type:
Basic|None
- recursive_subs(e, replacements)[source]¶
Substitute the expressions in
replacementsrecursively. This might not be necessary in all cases, SymPy’s builtinsubs()method should also do this recursively.Note
The order of the tuples in
replacementsmight matter, make sure to order these sensibly in case the expression contains a lot of nested substitutions.- Parameters:
e (
Basic) – Input expressionreplacements (
list[tuple[Symbol,Basic]]) – List of replacements:symbol, replace
- Returns:
Substituted expression
- Return type:
Basic
- simplify_exponents(e)[source]¶
Simplifies an expression by combining float and int exponents. This is not done automatically by SymPy.
Adapted from https://stackoverflow.com/questions/54243832/sympy-wont-simplify-or-expand-exponential-with-decimals
- Parameters:
e (
Basic) – A SymPy expression, potentially containing mixed float and int exponents- Returns:
Simplified expression with float and int exponents combined
- Return type:
Basic
- substitute_unknowns(e, knowns, eqns, avoid=None)[source]¶
Uses the equations
eqnsto substitute the unknown symbols in the input expression. Uses recursion to deal with nested substitutions.- Parameters:
e (
Basic) – Input expression that potentially contains unknown symbolsknowns (
set[Symbol]) – Set of known symbolseqns (
list[Equality]) – List of equations that define the unknown symbols in terms of known onesavoid (
set[Symbol] |None) – Set of symbols to avoid in the substitution expressions, by default None
- Returns:
The substituted expression without any unknown symbols
- Return type:
Basic
- symbols(inp, **kwargs)[source]¶
Like
sympy.symbols, but typed as a list and always returning more than one symbol.kwargsare SymPy assumptions (positive=True,integer=True, …).- Return type:
list[Symbol]- Parameters:
inp (str)
kwargs (Any)
- to_identifier(s)[source]¶
Converts a SymPy symbol to a valid Python identifier. This function will only remove special characters.
The Latex command
\text{}is replaced withT. This is done to differentiate between symbols\text{kg}(returnsTkg) andkg(returnskg).- Parameters:
s (
object) – Input symbol or string representation- Returns:
Valid Python identifier created from the input symbol
- Return type:
str
- typeset(x)[source]¶
Does some additional typesetting for the input Latex string, for example
\text{}around strings and upper-case characters.Use comma
,to separate parts of the input, for exampleinput,i
will be typeset as
\text{input},i: theiis a separate part and is typeset with a math font. Spaces around commas will be removed to make sub- and superscripts more compact. Use~before a single upper-case letter to typeset it with a math font.Uses flags from
encomp.settingsto determine how to typeset the input.- Parameters:
x (
str|int) – Input string or int (will be converted to str)- Returns:
Output Latex string
- Return type:
str
encomp.gases¶
Functions related to gases: normal volume to mass conversion, compressibility, etc…
A normal volume (Nm³, at 0 °C and 1 atm) is a distinct dimensionality
(NormalVolume, dimensions [normal] * [length]³), so it can
never be confused with an actual volume at process conditions. The functions here
convert between mass, actual volume and normal volume; the normal-volume side is
typed (and returned) as NormalVolume / NormalVolumeFlow with Nm³-based
units.
Gas-condition literals use the values in encomp.constants.CONSTANTS:
"N" means normal conditions (0 °C, 1 atm) and "S" means standard
conditions (15 °C, 1 atm).
The functions here name their fluid parameter fluid_name, whereas
encomp.fluids.Fluid names it name. That is intentional, not an
inconsistency: name is unambiguous on a fluid object, while a free function that
also takes volumes, masses and conditions has to say whose name it is.
Note
Humid-air-specific conversions are not implemented here; use
encomp.fluids.HumidAir for humid-air properties.
- type GasConditionInput = GasCondition | Literal['N', 'S']¶
- actual_volume_to_normal_volume(volume, condition, fluid_name='Air')[source]¶
- Overloads:
volume (Quantity[Volume, Any]), condition (GasConditionInput), fluid_name (str) → Quantity[NormalVolume, Any]
volume (Quantity[VolumeFlow, Any]), condition (GasConditionInput), fluid_name (str) → Quantity[NormalVolumeFlow, Any]
- Parameters:
condition (GasConditionInput)
fluid_name (str)
- Return type:
Convert actual volume to normal volume.
- Parameters:
volume (
Quantity[Volume]|Quantity[VolumeFlow]) – Input actual volume or actual volume flowcondition (
Union[tuple[Quantity[Pressure],Quantity[Temperature]],Literal['N','S']]) – Condition at which the input volume is evaluatedfluid_name (
str) – Name of the fluid, by default ‘Air’
- Returns:
Corresponding normal volume (Nm³) or normal volume flow (Nm³/h)
- Return type:
Quantity[NormalVolume, Any] | Quantity[NormalVolumeFlow, Any]
- convert_gas_volume(V1, condition_1='N', condition_2='N', fluid_name='Air')[source]¶
- Overloads:
V1 (Quantity[Volume, MT]), condition_1 (GasConditionInput), condition_2 (GasConditionInput), fluid_name (str) → Quantity[Volume, MT]
V1 (Quantity[VolumeFlow, MT]), condition_1 (GasConditionInput), condition_2 (GasConditionInput), fluid_name (str) → Quantity[VolumeFlow, MT]
- Parameters:
condition_1 (GasConditionInput)
condition_2 (GasConditionInput)
fluid_name (str)
- Return type:
Converts the volume \(V_1\) (at \(T_1, P_1\)) to \(V_2\) (at \(T_2, P_2\)); the dimensionality (volume or volume flow) and the units of the input are preserved. Uses compressibility factors from CoolProp.
The values for \(P_i, T_i\) are passed as a tuple
(P, T)(pressure first) using the parameterscondition_1andcondition_2. Optionally, the literals"N"and"S"can be passed to indicate normal and standard conditions."N"is 0 °C and 1 atm (CONSTANTS.normal_conditions_*);"S"is 15 °C and 1 atm (CONSTANTS.standard_conditions_*).Both conditions default to
"N", so calling this with onlyV1converts nothing (it still evaluates \(Z\) twice, at the same state). Pass at least one ofcondition_1/condition_2for a conversion to take place.- Parameters:
V1 (
Quantity[Volume]|Quantity[VolumeFlow]) – Volume or volume flow \(V_1\) at condition 1condition_1 (
Union[tuple[Quantity[Pressure],Quantity[Temperature]],Literal['N','S']]) – Literal[‘N’, ‘S’], optional Pressure and temperature at condition 1, by default ‘N’condition_2 (
Union[tuple[Quantity[Pressure],Quantity[Temperature]],Literal['N','S']]) – Literal[‘N’, ‘S’], optional Pressure and temperature at condition 2, by default ‘N’fluid_name (
str) – CoolProp name of the fluid, by default ‘Air’
- Returns:
Volume or volume flow \(V_2\) at condition 2, in the units of
V1- Return type:
Quantity[Volume, MT] | Quantity[VolumeFlow, MT]
- ideal_gas_density(P, T, M)[source]¶
Returns the density \(\rho\) of an ideal gas.
For an ideal gas, density is calculated from the ideal gas law:
\[\rho = \frac{p M}{R T}\]The gas constant \(R\) is \(8.31446261815324 \; \frac{\text{kg} \, \text{m}^2}{\text{s}^2 \, \text{K} \, \text{mol}}\) (exact by the 2019 SI definition).
The magnitude type of the result follows
P;TandMmay be scalars alongside a vectorP(a scalar molar mass is the common case).- Parameters:
P (
Quantity[Pressure]) – Absolute pressure of the gasT (
Quantity[Temperature]|Quantity[Temperature, float]) – Temperature of the gasM (
Quantity[MolarMass]|Quantity[MolarMass, float]) – Molar mass of the gas
- Returns:
Density of the ideal gas at the specified temperature and pressure
- Return type:
Quantity[Density]
- mass_from_actual_volume(volume, condition, fluid_name='Air')[source]¶
- Overloads:
volume (Quantity[Volume, MT]), condition (GasConditionInput), fluid_name (str) → Quantity[Mass, MT]
volume (Quantity[VolumeFlow, MT]), condition (GasConditionInput), fluid_name (str) → Quantity[MassFlow, MT]
- Parameters:
condition (GasConditionInput)
fluid_name (str)
- Return type:
Convert actual volume to mass.
- Parameters:
volume (
Quantity[Volume]|Quantity[VolumeFlow]) – Input actual volume or actual volume flowcondition (
Union[tuple[Quantity[Pressure],Quantity[Temperature]],Literal['N','S']]) – Condition at which to calculate the massfluid_name (
str) – Name of the fluid, by default ‘Air’
- Returns:
Corresponding mass or mass flow
- Return type:
Quantity[Mass, MT] | Quantity[MassFlow, MT]
- mass_from_normal_volume(volume, fluid_name='Air')[source]¶
- Overloads:
volume (Quantity[NormalVolume, MT]), fluid_name (str) → Quantity[Mass, MT]
volume (Quantity[NormalVolumeFlow, MT]), fluid_name (str) → Quantity[MassFlow, MT]
- Parameters:
- Return type:
Convert normal volume to mass.
A plain
Volume/VolumeFlowinput is also accepted at runtime (the legacy calling convention) and is interpreted as a volume at normal conditions; new code should pass aNormalVolume/NormalVolumeFlow(Nm³-based units).- Parameters:
volume (
Quantity[NormalVolume]|Quantity[NormalVolumeFlow]|Quantity[Volume]|Quantity[VolumeFlow]) – Input normal volume or normal volume flowfluid_name (
str) – Name of the fluid, by default ‘Air’
- Returns:
Corresponding mass or mass flow
- Return type:
Quantity[Mass, MT] | Quantity[MassFlow, MT]
- mass_to_actual_volume(mass, condition, fluid_name='Air')[source]¶
- Overloads:
mass (Quantity[Mass, MT]), condition (GasConditionInput), fluid_name (str) → Quantity[Volume, MT]
mass (Quantity[MassFlow, MT]), condition (GasConditionInput), fluid_name (str) → Quantity[VolumeFlow, MT]
- Parameters:
condition (GasConditionInput)
fluid_name (str)
- Return type:
Convert mass to actual volume.
- Parameters:
mass (
Quantity[Mass]|Quantity[MassFlow]) – Input mass or mass flowcondition (
Union[tuple[Quantity[Pressure],Quantity[Temperature]],Literal['N','S']]) – Condition at which to calculate the actual volumefluid_name (
str) – Name of the fluid, by default ‘Air’
- Returns:
Corresponding actual volume or actual volume flow
- Return type:
Quantity[Volume, MT] | Quantity[VolumeFlow, MT]
- mass_to_normal_volume(mass, fluid_name='Air')[source]¶
- Overloads:
mass (Quantity[Mass, MT]), fluid_name (str) → Quantity[NormalVolume, MT]
mass (Quantity[MassFlow, MT]), fluid_name (str) → Quantity[NormalVolumeFlow, MT]
- Parameters:
- Return type:
Convert mass to normal volume.
- Parameters:
mass (
Quantity[Mass]|Quantity[MassFlow]) – Input mass or mass flowfluid_name (
str) – Name of the fluid, by default ‘Air’
- Returns:
Corresponding normal volume (Nm³) or normal volume flow (Nm³/h)
- Return type:
Quantity[NormalVolume, MT] | Quantity[NormalVolumeFlow, MT]
- normal_volume_to_actual_volume(volume, condition, fluid_name='Air')[source]¶
- Overloads:
volume (Quantity[NormalVolume, Any]), condition (GasConditionInput), fluid_name (str) → Quantity[Volume, Any]
volume (Quantity[NormalVolumeFlow, Any]), condition (GasConditionInput), fluid_name (str) → Quantity[VolumeFlow, Any]
- Parameters:
volume (Quantity[NormalVolume] | Quantity[NormalVolumeFlow] | Quantity[Volume] | Quantity[VolumeFlow])
condition (GasConditionInput)
fluid_name (str)
- Return type:
Convert normal volume to actual volume.
A plain
Volume/VolumeFlowinput is also accepted at runtime (the legacy calling convention) and is interpreted as a volume at normal conditions; new code should pass aNormalVolume/NormalVolumeFlow(Nm³-based units).- Parameters:
volume (
Quantity[NormalVolume]|Quantity[NormalVolumeFlow]|Quantity[Volume]|Quantity[VolumeFlow]) – Input normal volume or normal volume flowcondition (
Union[tuple[Quantity[Pressure],Quantity[Temperature]],Literal['N','S']]) – Condition at which to calculate the actual volumefluid_name (
str) – Name of the fluid, by default ‘Air’
- Returns:
Corresponding actual volume or actual volume flow
- Return type:
Quantity[Volume, Any] | Quantity[VolumeFlow, Any]
encomp.conversion¶
Conversions between related engineering quantity dimensionalities.
- convert_volume_mass(inp, rho)[source]¶
- Overloads:
inp (Quantity[Mass, MT]), rho (Quantity[Density, Any]) → Quantity[Volume, MT]
inp (Quantity[MassFlow, MT]), rho (Quantity[Density, Any]) → Quantity[VolumeFlow, MT]
inp (Quantity[Volume, MT]), rho (Quantity[Density, Any]) → Quantity[Mass, MT]
inp (Quantity[VolumeFlow, MT]), rho (Quantity[Density, Any]) → Quantity[MassFlow, MT]
inp (Quantity[Mass, MT] | Quantity[MassFlow, MT] | Quantity[Volume, MT] | Quantity[VolumeFlow, MT]), rho (Quantity[Density, Any]) → Quantity[Mass, MT] | Quantity[MassFlow, MT] | Quantity[Volume, MT] | Quantity[VolumeFlow, MT]
- Parameters:
- Return type:
Quantity[Mass] | Quantity[MassFlow] | Quantity[Volume] | Quantity[VolumeFlow]
Converts mass to volume or vice versa.
- Parameters:
inp (
Quantity[Mass]|Quantity[MassFlow]|Quantity[Volume]|Quantity[VolumeFlow]) – Input mass or volume (or flow)rho (
Quantity[Density]) – Density of the substance. A missing density is allowed and yields a missing result at that position, exactly as a missinginpdoes:NaNfor float and numpy magnitudes,nullfor a Polars Series. A Polars result carries null (never NaN), so with a Polarsinpa NaN density is rejected – spell the missing density as a null in apl.Series. Every present value must be finite and strictly positive. Polars Expr inputs are deferred and cannot be data-validated here.
- Returns:
Calculated volume or mass (or flow)
- Return type:
M | V
encomp.context¶
Context managers for process-local filesystem and formatting changes.
Two unrelated groups share this module:
process utilities –
working_dir(),temp_dir()andsilence_stdout()temporarily change the working directory or redirectstdout; they have nothing to do with units.quantity formatting –
quantity_format()scopes the process-wide default format used when rendering quantities and units.
- quantity_format(fmt='compact')[source]¶
Context manager version of
encomp.units.set_quantity_format()that resets to the previous value afterwards.- Parameters:
fmt (
str) – Unit format string: one of'~P', '~L', '~H', '~Lx'. Also accepts the aliases'compact': '~P','normal': '~P'and'siunitx': '~Lx'.- Return type:
Generator[None]
- silence_stdout()[source]¶
Context manager that redirects
stdouttoos.devnull. This is used to suppress functions that print tostdout.- Return type:
Generator[None]
encomp.constants¶
Physical constants and reference conditions used by encomp helpers.
- CONSTANTS = <encomp.constants.Constants object>¶
Singleton
Constantsinstance; every attribute access returns a freshQuantity.
- class Constants[source]¶
Bases:
objectNamespace of constants exposed through the
CONSTANTSsingleton.Every attribute returns a fresh
Quantity. AQuantityis mutable –ito()converts in place and themsetter replaces the magnitude – so handing out one shared instance would let a caller alter the constant for the whole process.- property R: Quantity[UnknownDimensionality, float]¶
Molar gas constant, exact by the 2019 SI definition.
- property normal_conditions_temperature: Quantity[Temperature, float]¶
Normal-condition temperature, 0 degC.
encomp.misc¶
Small runtime typing and source-inspection helpers used by encomp.
- isinstance_types(obj, expected)[source]¶
Return whether
objconforms to a runtime type form.This is the project-wide replacement for
isinstancewhen the expected type may be parameterized, such aslist[Quantity[Pressure]]orQuantity[Mass, float]. It delegates general type forms totypeguard.check_type()and handlesQuantitysubclasses directly so dimensionality and magnitude parameters are both respected.Every element of a collection is checked, not just the first: a
list[Quantity[Pressure]]holding aQuantity[Length]at any position is rejected. (typeguard.typecheckedkeeps typeguard’s own default of checking only the first element.)- Return type:
TypeIs[TypeVar(T)]- Parameters:
obj (Any)
expected (TypeForm)
encomp.settings¶
Contains settings used elsewhere in the library.
- SETTINGS = Settings(units=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/encomp/checkouts/latest/encomp/defs/units.txt'), typeset_symbol_scripts=True, ignore_ndarray_unit_stripped_warning=True, ignore_coolprop_warnings=True, autoconvert_offset_to_baseunit=False, default_unit_format='~P')¶
Singleton
Settingsinstance, initialized the first time the library loads. Some consumers read values during their own import/initialization, so attribute assignment on this instance is not a general runtime-configuration API.
- class Settings(_case_sensitive=None, _nested_model_default_partial_update=None, _env_prefix=None, _env_prefix_target=None, _env_file=PosixPath('.'), _env_file_encoding=None, _env_ignore_empty=None, _env_nested_delimiter=None, _env_nested_max_split=None, _env_parse_none_str=None, _env_parse_enums=None, _cli_prog_name=None, _cli_parse_args=None, _cli_settings_source=None, _cli_parse_none_str=None, _cli_hide_none_type=None, _cli_avoid_json=None, _cli_enforce_required=None, _cli_use_class_docs_for_groups=None, _cli_exit_on_error=None, _cli_prefix=None, _cli_flag_prefix_char=None, _cli_implicit_flags=None, _cli_ignore_unknown_args=None, _cli_kebab_case=None, _cli_shortcuts=None, _secrets_dir=None, _build_sources=None, **values)[source]¶
Bases:
BaseSettingsSettings class.
Use an
.env-file in the current working directory to override the defaults;pydantic-settingsloads it automatically when this module is first imported (no manual loading needed).The variables in the
.env-file have the same names (not case-sensitive) as the attributes of this class, with the additional prefixENCOMP_. In case of invalid values in the.env-file or environment variables, aValidationErroris raised.Note
Names that are defined as global environment variables (either on the system or user level) take precedence over names in the
.env-file. The global environment variables are loaded even if no.env-file was found.Warning
Because the
.env-file is resolved relative to the current working directory, a stray.envcontaining an invalidENCOMP_*value (e.g.ENCOMP_UNITSpointing to a missing file) makesimport encompfail with aValidationError– even in an unrelated project.UNITS: path to a file with unit definitions forpintTYPESET_SYMBOL_SCRIPTS: whether to typeset SymPy symbol sub- and superscriptsIGNORE_NDARRAY_UNIT_STRIPPED_WARNING: whether to suppress thepintwarning when converting Quantity to NumPy array.IGNORE_COOLPROP_WARNINGS: whether to suppress warnings from the CoolProp backendAUTOCONVERT_OFFSET_TO_BASEUNIT: whether to automatically convert offset units in computations. If this is False, °C must be converted to K before multiplication (for example)DEFAULT_UNIT_FORMAT: default unit format forQuantityobjects: one of~P(compact),~L(Latex),~H(HTML),~Lx(Latex with SIUNITX package)
Note
All names are case-insensitive.
Environment-backed settings are loaded once when this module is imported. Some values are consumed during registry initialization, so assigning new values to
SETTINGSis not a general runtime configuration API. Useencomp.units.set_quantity_format()to change quantity/unit rendering for the current process.Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
_case_sensitive (bool | None)
_nested_model_default_partial_update (bool | None)
_env_prefix (str | None)
_env_prefix_target (EnvPrefixTarget | None)
_env_file (DotenvType | None)
_env_file_encoding (str | None)
_env_ignore_empty (bool | None)
_env_nested_delimiter (str | None)
_env_nested_max_split (int | None)
_env_parse_none_str (str | None)
_env_parse_enums (bool | None)
_cli_prog_name (str | None)
_cli_parse_args (bool | list[str] | tuple[str, ...] | None)
_cli_settings_source (CliSettingsSource[Any] | None)
_cli_parse_none_str (str | None)
_cli_hide_none_type (bool | None)
_cli_avoid_json (bool | None)
_cli_enforce_required (bool | None)
_cli_use_class_docs_for_groups (bool | None)
_cli_exit_on_error (bool | None)
_cli_prefix (str | None)
_cli_flag_prefix_char (str | None)
_cli_implicit_flags (bool | Literal['dual', 'toggle'] | None)
_cli_ignore_unknown_args (bool | None)
_cli_kebab_case (bool | Literal['all', 'no_enums'] | None)
_cli_shortcuts (Mapping[str, str | list[str]] | None)
_secrets_dir (PathType | None)
_build_sources (tuple[tuple[PydanticBaseSettingsSource, ...], dict[str, Any]] | None)
units (Annotated[Path, PathType(path_type=file)])
typeset_symbol_scripts (bool)
ignore_ndarray_unit_stripped_warning (bool)
ignore_coolprop_warnings (bool)
autoconvert_offset_to_baseunit (bool)
default_unit_format (Literal['~P', '~L', '~H', '~Lx'])
- autoconvert_offset_to_baseunit: bool¶
- default_unit_format: Literal['~P', '~L', '~H', '~Lx']¶
- ignore_coolprop_warnings: bool¶
- ignore_ndarray_unit_stripped_warning: bool¶
- model_config = {'arbitrary_types_allowed': True, 'case_sensitive': False, 'cli_avoid_json': False, 'cli_enforce_required': False, 'cli_exit_on_error': True, 'cli_flag_prefix_char': '-', 'cli_hide_none_type': False, 'cli_ignore_unknown_args': False, 'cli_implicit_flags': False, 'cli_kebab_case': False, 'cli_parse_args': None, 'cli_parse_none_str': None, 'cli_prefix': '', 'cli_prog_name': None, 'cli_shortcuts': None, 'cli_use_class_docs_for_groups': False, 'enable_decoding': True, 'env_file': '.env', 'env_file_encoding': 'utf-8', 'env_ignore_empty': False, 'env_nested_delimiter': None, 'env_nested_max_split': None, 'env_parse_enums': None, 'env_parse_none_str': None, 'env_prefix': 'ENCOMP_', 'env_prefix_target': 'variable', 'extra': 'ignore', 'json_file': None, 'json_file_encoding': None, 'nested_model_default_partial_update': False, 'protected_namespaces': ('model_validate', 'model_dump', 'settings_customise_sources'), 'secrets_dir': None, 'toml_file': None, 'validate_default': True, 'yaml_config_section': None, 'yaml_file': None, 'yaml_file_encoding': None}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- typeset_symbol_scripts: bool¶
- units: Annotated[Path, PathType(path_type=file)]¶
encomp.structures¶
Helpers for chunking and flattening common Python containers.
- divide_chunks(container, N)[source]¶
- Overloads:
container (list[T]), N (int) → Iterator[list[T]]
container (tuple[T, …]), N (int) → Iterator[tuple[T, …]]
container (Sequence[T]), N (int) → Iterator[Sequence[T]]
container (np.ndarray), N (int) → Iterator[np.ndarray]
- Parameters:
container (Any)
N (int)
- Return type:
Any
Yield slices of
containerwith at mostNelements each.Empty containers yield no chunks.
Nmust be positive. The returned chunks preserve the container’s slicing behavior, so lists produce lists, tuples produce tuples, and numpy arrays produce arrays.
- flatten(container, max_depth=None)[source]¶
Yield nested iterable contents as a flat stream.
Strings, bytes, dictionaries,
Quantityinstances, numpy arrays and Polars objects are treated as atomic values rather than recursively iterated.- Return type:
Iterator[Any]- Parameters:
container (Iterable[Any])
max_depth (int | None)