From 01b1a4b557dfbbec72c29bdcd9653cb7c5b88a82 Mon Sep 17 00:00:00 2001 From: Ingmar Schoegl Date: Tue, 5 Apr 2022 12:15:20 -0500 Subject: [PATCH] [Python] Disable FlameBase.from_pandas FlameBase.from_pandas is a vestigial method that is left over from an earlier HDF interface that built on pandas and was replaced by the current implementation between 2.4 and 2.5.1 (PR #840); the original HDF implementation was never released. There is some merit to allowing import, but further discussion is postponed until after the release of Cantera 2.6 (see #1236). --- interfaces/cython/cantera/onedim.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/interfaces/cython/cantera/onedim.py b/interfaces/cython/cantera/onedim.py index 5864108e6d..8267ec2b2c 100644 --- a/interfaces/cython/cantera/onedim.py +++ b/interfaces/cython/cantera/onedim.py @@ -472,7 +472,8 @@ def to_pandas(self, species='X', normalize=True): def from_pandas(self, df, restore_boundaries=True, settings=None): """ - Restore the solution vector from a `pandas.DataFrame`. + Restore the solution vector from a `pandas.DataFrame`; currently disabled + (`save`/`restore` or `write_hdf`/`read_hdf` should be used as alternatives). :param df: `pandas.DataFrame` containing data to be restored @@ -488,10 +489,9 @@ def from_pandas(self, df, restore_boundaries=True, settings=None): requires a working *pandas* installation. The package ``pandas`` can be installed using pip or conda. """ - arr = SolutionArray(self.gas, extra=self.other_components()) - arr.from_pandas(df) - self.from_solution_array(arr, restore_boundaries=restore_boundaries, - settings=settings) + # @todo: Discuss implementation that allows for restoration of boundaries + raise NotImplementedError( + "Use 'save'/'restore' or 'write_hdf'/'read_hdf' as alternatives.") def write_hdf(self, filename, *args, group=None, species='X', mode='a', description=None, compression=None, compression_opts=None,