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

Method test_write_hdf

test/python/test_composite.py:667–681  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

665 @pytest.mark.skipif("native" not in ct.hdf_support(),
666 reason="Cantera compiled without HDF support")
667 def test_write_hdf(self):
668 outfile = self.test_work_path / "solutionarray_fancy.h5"
669 outfile.unlink(missing_ok=True)
670
671 extra = {'foo': range(7), 'bar': range(7)}
672 meta = {'spam': 'eggs', 'hello': 'world'}
673 states = ct.SolutionArray(self.gas, 7, extra=extra, meta=meta)
674 states.TPX = np.linspace(300, 1000, 7), 2e5, 'H2:0.5, O2:0.4'
675 states.equilibrate('HP')
676
677 states.save(outfile, "group0")
678
679 b = ct.SolutionArray(self.gas)
680 attr = b.restore(outfile, "group0")
681 self.check_arrays(states, b)
682
683 @pytest.mark.skipif("native" not in ct.hdf_support(),
684 reason="Cantera compiled without HDF support")

Callers

nothing calls this directly

Calls 5

equilibrateMethod · 0.95
saveMethod · 0.95
restoreMethod · 0.95
check_arraysMethod · 0.95
SolutionArrayMethod · 0.80

Tested by

no test coverage detected