[Python] Deprecate Sim1D.write_hdf

This commit is contained in:
Ingmar Schoegl
2022-12-05 17:23:53 -06:00
committed by Ray Speth
parent 85efbc1bdd
commit df3d6f96fc
2 changed files with 11 additions and 0 deletions

View File

@@ -563,7 +563,14 @@ class FlameBase(Sim1D):
`SolutionArray.collect_data`. The method exports data using
`SolutionArray.write_hdf` via `to_solution_array` and requires a working
installation of *h5py* (``h5py`` can be installed using pip or conda).
.. deprecated:: 3.0
Method to be removed after Cantera 3.0; replaceable by 'Sim1D.save'.
"""
warnings.warn(
"Method to be removed after Cantera 3.0; use 'Sim1D.save' instead.",
DeprecationWarning)
cols = ('extra', 'T', 'P', species)
meta = self.settings
meta['date'] = formatdate(localtime=True)

View File

@@ -730,10 +730,12 @@ class TestFreeFlame(utilities.CanteraTest):
k = self.gas.species_index('H2')
self.assertArrayNear(data.X[:, k], self.sim.X[k, :])
@pytest.mark.usefixtures("allow_deprecated")
@utilities.unittest.skipIf("h5py" not in ct.hdf_support(), "h5py not installed")
def test_write_hdf_legacy(self):
self.run_freeflame_write_hdf("legacy")
@pytest.mark.usefixtures("allow_deprecated")
@utilities.unittest.skipIf(ct.hdf_support() != {"h5py", "native"}, "h5py and/or HighFive not installed")
def test_write_hdf_transition(self):
self.run_freeflame_write_hdf("transition")
@@ -1313,10 +1315,12 @@ class TestImpingingJet(utilities.CanteraTest):
def test_reacting_surface_case3(self):
self.run_reacting_surface(xch4=0.2, tsurf=800.0, mdot=0.1, width=0.2)
@pytest.mark.usefixtures("allow_deprecated")
@utilities.unittest.skipIf("h5py" not in ct.hdf_support(), "h5py not installed")
def test_write_hdf_legacy(self):
self.run_impingingjet_write("legacy")
@pytest.mark.usefixtures("allow_deprecated")
@utilities.unittest.skipIf(ct.hdf_support() != {"h5py", "native"}, "h5py and/or HighFive not installed")
def test_write_hdf_transition(self):
self.run_impingingjet_write("transition")