MCPcopy Create free account
hub / github.com/Cantera/cantera / yield_dimensions

Function yield_dimensions

test/python/test_units.py:145–184  ·  view source on GitHub ↗

Yield pytest.param instances with the dimensions

()

Source from the content-addressed store, hash-verified

143
144
145def yield_dimensions():
146 """Yield pytest.param instances with the dimensions"""
147 # This dictionary maps the dimensions to the relevant property names
148 dims: Dict[Dimensions, Tuple[str, ...]] = {
149 temperature: ("T", "max_temp", "min_temp"),
150 inverse_temperature: ("thermal_expansion_coeff",),
151 pressure: ("P", "reference_pressure"),
152 isothermal_compressiblity: ("isothermal_compressibility",),
153 atomic_molecular_weights: (
154 "atomic_weight",
155 "molecular_weights",
156 "mean_molecular_weight",
157 ),
158 mole_mass_fractions: ("X", "Y"),
159 chemical_potential: ("chemical_potentials", "electrochemical_potentials"),
160 electric_potential: ("electric_potential",),
161 concentrations_like: ("concentrations", "density_mole"),
162 molar_volume: ("volume_mole", "partial_molar_volumes"),
163 volume_mass: ("volume_mass",),
164 density_mass: ("density_mass",),
165 mass_basis_energy_like: ("enthalpy_mass", "int_energy_mass", "gibbs_mass"),
166 mass_basis_entropy_like: ("entropy_mass", "cp_mass", "cv_mass"),
167 molar_basis_energy_like: (
168 "enthalpy_mole",
169 "int_energy_mole",
170 "gibbs_mole",
171 "partial_molar_enthalpies",
172 "partial_molar_int_energies",
173 ),
174 molar_basis_entropy_like: (
175 "entropy_mole",
176 "cp_mole",
177 "cv_mole",
178 "partial_molar_cp",
179 "partial_molar_entropies",
180 ),
181 }
182 for dimension, props in dims.items():
183 for prop in props:
184 yield pytest.param(prop, dimension.as_dict(), id=f"{dimension}-{prop}")
185
186
187@pytest.mark.parametrize("prop,dimensions", yield_dimensions())

Callers

nothing calls this directly

Calls 2

paramMethod · 0.80
as_dictMethod · 0.80

Tested by

no test coverage detected