Skip to content

Commit

Permalink
[Python] Disable FlameBase.from_pandas
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
ischoegl committed Apr 6, 2022
1 parent b4616ef commit 01b1a4b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions interfaces/cython/cantera/onedim.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit 01b1a4b

Please sign in to comment.