Skip to content

Commit 8230321

Browse files
committed
update tests for coverage-dependence data as_dict
The on-disk/YAML format for enthalpy-coefficients/entropy-coefficients changed: Old: {'class': 'np_array', 'object': [<Enthalpy>, ...]} New: [{'class': 'ScalarQuantity', 'value': ..., 'units': '...'}, ...]
1 parent e99ad61 commit 8230321

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

test/rmgpy/thermo/nasaTest.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,10 +378,10 @@ def test_nasa_as_dict_full(self):
378378
assert nasa_dict["thermo_coverage_dependence"].keys() == self.thermo_coverage_dependence.keys()
379379
sp_name = list(self.thermo_coverage_dependence.keys())[0]
380380
assert nasa_dict['thermo_coverage_dependence'][sp_name]['model'] == self.thermo_coverage_dependence[sp_name]['model']
381-
enthalpy_list = nasa_dict['thermo_coverage_dependence'][sp_name]['enthalpy-coefficients']['object']
382-
assert [(int(coeff.value), str(coeff.units)) for coeff in enthalpy_list] == self.thermo_coverage_dependence[sp_name]['enthalpy-coefficients']
383-
entropy_list = nasa_dict['thermo_coverage_dependence'][sp_name]['entropy-coefficients']['object']
384-
assert [(int(coeff.value), str(coeff.units)) for coeff in entropy_list] == self.thermo_coverage_dependence[sp_name]['entropy-coefficients']
381+
enthalpy_list = nasa_dict['thermo_coverage_dependence'][sp_name]['enthalpy-coefficients']
382+
assert [(int(coeff['value']), str(coeff['units'])) for coeff in enthalpy_list] == self.thermo_coverage_dependence[sp_name]['enthalpy-coefficients']
383+
entropy_list = nasa_dict['thermo_coverage_dependence'][sp_name]['entropy-coefficients']
384+
assert [(int(coeff['value']), str(coeff['units'])) for coeff in entropy_list] == self.thermo_coverage_dependence[sp_name]['entropy-coefficients']
385385
assert nasa_dict["comment"] == self.comment
386386
assert tuple(nasa_dict["polynomials"]["polynomial1"]["coeffs"]["object"]) == tuple(self.coeffs_low)
387387
assert tuple(nasa_dict["polynomials"]["polynomial2"]["coeffs"]["object"]) == tuple(self.coeffs_high)
@@ -403,6 +403,7 @@ def test_nasa_as_dict_minimal(self):
403403
assert "CpInf" not in keys
404404
assert "label" not in keys
405405
assert "comment" not in keys
406+
assert "thermo_coverage_dependence" not in keys
406407

407408
def test_nasa_polynomial_as_dict(self):
408409
"""

test/rmgpy/thermo/wilhoitTest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,10 +432,10 @@ def test_wilhoit_as_dict(self):
432432
assert wilhoit_dict["thermo_coverage_dependence"].keys() == self.thermo_coverage_dependence.keys()
433433
sp_name = list(self.thermo_coverage_dependence.keys())[0]
434434
assert wilhoit_dict['thermo_coverage_dependence'][sp_name]['model'] == self.thermo_coverage_dependence[sp_name]['model']
435-
enthalpy_list = wilhoit_dict['thermo_coverage_dependence'][sp_name]['enthalpy-coefficients']['object']
436-
assert [(int(coeff.value), str(coeff.units)) for coeff in enthalpy_list] == self.thermo_coverage_dependence[sp_name]['enthalpy-coefficients']
437-
entropy_list = wilhoit_dict['thermo_coverage_dependence'][sp_name]['entropy-coefficients']['object']
438-
assert [(int(coeff.value), str(coeff.units)) for coeff in entropy_list] == self.thermo_coverage_dependence[sp_name]['entropy-coefficients']
435+
enthalpy_list = wilhoit_dict['thermo_coverage_dependence'][sp_name]['enthalpy-coefficients']
436+
assert [(int(coeff['value']), str(coeff['units'])) for coeff in enthalpy_list] == self.thermo_coverage_dependence[sp_name]['enthalpy-coefficients']
437+
entropy_list = wilhoit_dict['thermo_coverage_dependence'][sp_name]['entropy-coefficients']
438+
assert [(int(coeff['value']), str(coeff['units'])) for coeff in entropy_list] == self.thermo_coverage_dependence[sp_name]['entropy-coefficients']
439439

440440
wilhoit_dict = {k: wilhoit_dict[k] for k in wilhoit_dict.keys() - {'thermo_coverage_dependence'}}
441441
assert wilhoit_dict == {

0 commit comments

Comments
 (0)