diff --git a/interfaces/cython/cantera/_onedim.pyx b/interfaces/cython/cantera/_onedim.pyx index c54e92bdd9..e1337732e8 100644 --- a/interfaces/cython/cantera/_onedim.pyx +++ b/interfaces/cython/cantera/_onedim.pyx @@ -438,8 +438,8 @@ cdef class ReactingSurface1D(Boundary1D): def __init__(self, _SolutionBase phase, name=None): self._weakref_proxy = _WeakrefProxy() if phase.phase_of_matter == "gas": - warnings.warn("Starting in Cantera 3.0, parameter 'phase' should " - "reference surface instead of gas phase.", DeprecationWarning) + warnings.warn("ReactingSurface1D: Starting in Cantera 3.0, parameter 'phase'" + " should reference surface instead of gas phase.", DeprecationWarning) super().__init__(phase) if name is not None: self.name = name @@ -477,8 +477,9 @@ cdef class ReactingSurface1D(Boundary1D): Method to be removed after Cantera 3.0; set `Kinetics` when instantiating `ReactingSurface1D` instead. """ - warnings.warn("Method to be removed after Cantera 3.0; set 'Kinetics' when " - "instantiating 'ReactingSurface1D' instead.", DeprecationWarning) + warnings.warn("ReactingSurface1D.set_kinetics: Method to be removed after " + "Cantera 3.0; set 'Kinetics' when instantiating 'ReactingSurface1D' " + "instead.", DeprecationWarning) if pystr(kin.kinetics.kineticsType()) not in ("surface", "edge"): raise TypeError('Kinetics object must be derived from ' 'InterfaceKinetics.') @@ -535,8 +536,8 @@ cdef class _FlowBase(Domain1D): Method to be removed after Cantera 3.0. Replaceable by `transport_model` """ - warnings.warn("Method to be removed after Cantera 3.0; use property " - "'transport_model' instead.", DeprecationWarning) + warnings.warn("_FlowBase.set_transport: Method to be removed after Cantera 3.0;" + " use property 'transport_model' instead.", DeprecationWarning) self._weakref_proxy = _WeakrefProxy() self.gas._references[self._weakref_proxy] = True self.gas = phase @@ -623,8 +624,8 @@ cdef class _FlowBase(Domain1D): """ def __get__(self): warnings.warn( - "Property getter to change after Cantera 3.0.\nFor new behavior, use " - "'get_settings3'.", DeprecationWarning) + "_FlowBase.settings: Property getter to change after Cantera 3.0.\n" + "For new behavior, use 'get_settings3'.", DeprecationWarning) out = { 'Domain1D_type': type(self).__name__, @@ -653,8 +654,8 @@ cdef class _FlowBase(Domain1D): return out def __set__(self, meta): - warnings.warn("Property setter to be removed after Cantera 3.0. " - "Replaceable by individual setters.", DeprecationWarning) + warnings.warn("_FlowBase.settings: Property setter to be removed after " + "Cantera 3.0. Replaceable by individual setters.", DeprecationWarning) # boundary emissivities if 'emissivity_left' in meta or 'emissivity_right' in meta: @@ -875,8 +876,8 @@ cdef class IdealGasFlow(_FlowBase): _domain_type = "gas-flow" def __init__(self, *args, **kwargs): - warnings.warn("Class to be removed after Cantera 3.0; use 'FreeFlow', " - "'AxisymmetricFlow' or 'UnstrainedFlow' instead.", + warnings.warn("Class 'IdealGasFlow' to be removed after Cantera 3.0; use " + "'FreeFlow', 'AxisymmetricFlow' or 'UnstrainedFlow' instead.", DeprecationWarning) super().__init__(*args, **kwargs) @@ -895,8 +896,8 @@ cdef class IonFlow(_FlowBase): _domain_type = "ion-flow" def __init__(self, *args, **kwargs): - warnings.warn("Class to be removed after Cantera 3.0; use 'FreeFlow', " - "'AxisymmetricFlow' or 'UnstrainedFlow' instead.", + warnings.warn("Class 'IonFlow' to be removed after Cantera 3.0; use 'FreeFlow'," + " 'AxisymmetricFlow' or 'UnstrainedFlow' instead.", DeprecationWarning) super().__init__(*args, **kwargs) @@ -908,8 +909,8 @@ cdef class IonFlow(_FlowBase): - ``stage == 2``: the electric field equation is solved, and the drift flux for ionized species is evaluated """ - warnings.warn("Method to be removed after Cantera 3.0; use " - "'solving_stage' property instead.", DeprecationWarning) + warnings.warn("IonFlow.set_solving_stage: Method to be removed after Cantera " + "3.0; use 'solving_stage' property instead.", DeprecationWarning) self.solving_stage = stage @@ -1173,7 +1174,8 @@ cdef class Sim1D: interface to the C++ core, except for `FlameBase.from_solution_array`, which itself is deprecated due to a pending removal of ``h5py`` support. """ - warnings.warn("Method to be removed after Cantera 3.0.", DeprecationWarning) + warnings.warn("Sim1D.restore_data: Method to be removed after Cantera 3.0.", + DeprecationWarning) idom = self.domain_index(domain) dom = self.domains[idom] T, P, Y = states @@ -1629,8 +1631,8 @@ cdef class Sim1D: Argument loglevel is no longer supported """ if loglevel is not None: - warnings.warn("Argument 'loglevel' is deprecated and will be ignored.", - DeprecationWarning) + warnings.warn("Sim1D.save: Argument 'loglevel' is deprecated and will be " + "ignored.", DeprecationWarning) self.sim.save(stringify(str(filename)), stringify(name), stringify(description), overwrite, compression, stringify(basis)) @@ -1657,8 +1659,8 @@ cdef class Sim1D: Implemented return value for meta data; loglevel is no longer supported """ if loglevel is not None: - warnings.warn("Argument 'loglevel' is deprecated and will be ignored.", - DeprecationWarning) + warnings.warn("Sim1D.restore: Argument 'loglevel' is deprecated and will be" + " ignored.", DeprecationWarning) cdef CxxAnyMap header header = self.sim.restore(stringify(str(filename)), stringify(name)) self._initialized = True diff --git a/interfaces/cython/cantera/composite.py b/interfaces/cython/cantera/composite.py index fc6ad2a9b0..e62cc51386 100644 --- a/interfaces/cython/cantera/composite.py +++ b/interfaces/cython/cantera/composite.py @@ -1202,7 +1202,7 @@ def write_csv(self, filename, cols=None, *args, **kwargs): Method to be removed after Cantera 3.0; superseded by `save`. Note that `write_csv` does not support escaping of commas within string entries. """ - warnings.warn("'write_csv' is superseded by 'save' and will be removed " + warnings.warn("SolutionArray.write_csv: Superseded by 'save' and will be removed " "after Cantera 3.0.", DeprecationWarning) data_dict = self.collect_data(*args, cols=cols, tabular=True, **kwargs) data = np.hstack([d[:, np.newaxis] for d in data_dict.values()]) @@ -1430,9 +1430,9 @@ def write_hdf(self, filename, *args, cols=None, group=None, subgroup=None, the call is redirected to `save` in order to prevent the creation of a file with legacy HDF format. """ - warnings.warn("Method to be removed after Cantera 3.0; use 'save' instead.\n" - "Note that the call is redirected to 'save' in order to prevent the " - "creation of a file with legacy HDF format;\nas a consequence, " + warnings.warn("SolutionArray.write_hdf: To be removed after Cantera 3.0; use " + "'save' instead.\n Note that the call is redirected to 'save' in order to " + "prevent the creation of a file with legacy HDF format;\nas a consequence, " "some options are no longer supported.", DeprecationWarning) if group is None: @@ -1476,8 +1476,8 @@ def read_hdf(self, filename, group=None, subgroup=None, force=False, normalize=T if _h5py is None: _import_h5py() - warnings.warn("Method to be removed after Cantera 3.0; use 'restore' instead.", - DeprecationWarning) + warnings.warn("SolutionArray.read_hdf: Method to be removed after Cantera 3.0; " + "use 'restore' instead.", DeprecationWarning) with _h5py.File(filename, 'r') as hdf: diff --git a/interfaces/cython/cantera/kinetics.pyx b/interfaces/cython/cantera/kinetics.pyx index bb0f49b47b..535b254650 100644 --- a/interfaces/cython/cantera/kinetics.pyx +++ b/interfaces/cython/cantera/kinetics.pyx @@ -299,8 +299,9 @@ cdef class Kinetics(_SolutionBase): `Kinetics.reactant_stoich_coeffs` """ def __get__(self): - warnings.warn("Method to be removed after Cantera 3.0; use property " - "'reactant_stoich_coeffs' instead.", DeprecationWarning) + warnings.warn("Kinetics.reactant_stoich_coeffs3: To be removed after " + "Cantera 3.0; use property 'reactant_stoich_coeffs' instead.", + DeprecationWarning) return self.reactant_stoich_coeffs property product_stoich_coeffs: @@ -333,8 +334,9 @@ cdef class Kinetics(_SolutionBase): `Kinetics.product_stoich_coeffs` """ def __get__(self): - warnings.warn("Method to be removed after Cantera 3.0; use property " - "'product_stoich_coeffs' instead.", DeprecationWarning) + warnings.warn("Kinetics.product_stoich_coeffs3: Method to be removed after " + "Cantera 3.0; use property 'product_stoich_coeffs' instead.", + DeprecationWarning) return self.product_stoich_coeffs property product_stoich_coeffs_reversible: diff --git a/interfaces/cython/cantera/onedim.py b/interfaces/cython/cantera/onedim.py index 2ffd47f35b..a89c5b4ab2 100644 --- a/interfaces/cython/cantera/onedim.py +++ b/interfaces/cython/cantera/onedim.py @@ -54,8 +54,8 @@ def other_components(self, domain=None): Method to be removed after Cantera 3.0. After moving SolutionArray HDF export to the C++ core, this method is unused. """ - warnings.warn("Method to be removed after Cantera 3.0 (unused).", - DeprecationWarning) + warnings.warn("FlameBase.other_components: Method to be removed after " + "Cantera 3.0 (unused).", DeprecationWarning) if domain is None: return self._other @@ -384,8 +384,8 @@ def solution(self, component, point=None): To be removed after Cantera 3.0 to avoid conflation with `Solution`. Replaceable by `profile` or `value`. """ - warnings.warn("Method 'solution' to be removed after Cantera 3.0. " - "Replaceable by 'profile' or 'value'.") + warnings.warn("FlameBase.solution: To be removed after Cantera 3.0. " + "Replaceable by 'profile' or 'value'.", DeprecationWarning) if point is None: return self.profile(self.flame, component) else: @@ -421,7 +421,7 @@ def write_csv(self, filename, species='X', quiet=True, normalize=True): Method to be removed after Cantera 3.0; superseded by `save`. """ - warnings.warn("'write_csv' is superseded by 'save' and will be removed " + warnings.warn("FlameBase.write_csv: Superseded by 'save'. To be removed " "after Cantera 3.0.", DeprecationWarning) # save data @@ -465,9 +465,8 @@ def to_solution_array(self, domain=None, normalize=True): Method to be removed after Cantera 3.0; superseded by `to_array`. """ - warnings.warn( - "Method to be removed after Cantera 3.0. Replaceable by 'to_array'.", - DeprecationWarning) + warnings.warn("FlameBase.to_solution_array: To be removed after Cantera 3.0. " + "Replaceable by 'to_array'.", DeprecationWarning) return self.to_array(domain, normalize) def from_array(self, arr, domain=None): @@ -497,9 +496,8 @@ def from_solution_array(self, arr, domain=None): Method to be removed after Cantera 3.0; replaced by `from_array`. """ - warnings.warn( - "Method to be removed after Cantera 3.0. Replaced by 'from_array'.", - DeprecationWarning) + warnings.warn("FlameBase.from_solution_array: To be removed after Cantera 3.0. " + "Replaced by 'from_array'.", DeprecationWarning) if domain is None: domain = self.flame else: @@ -635,9 +633,10 @@ def write_hdf(self, filename, *args, group=None, species='X', mode='a', the call is redirected to `save` in order to prevent the creation of a file with deprecated HDF format. """ - warnings.warn("Method to be removed after Cantera 3.0; use 'save' instead.\n" - "Note that the call is redirected to 'save' in order to prevent the " - "creation of a file with deprecated HDF format.", DeprecationWarning) + warnings.warn("FlameBase.write_hdf: To be removed after Cantera 3.0; use " + "'save' instead.\nNote that the call is redirected to 'save' in order to " + "prevent the creation of a file with deprecated HDF format.", + DeprecationWarning) self.save(filename, name=group, description=description, compression=compression_opts) @@ -665,9 +664,8 @@ def read_hdf(self, filename, group=None, restore_boundaries=True, normalize=True Method to be removed after Cantera 3.0; superseded by `restore`. """ - warnings.warn( - "Method to be removed after Cantera 3.0; use 'restore' instead.", - DeprecationWarning) + warnings.warn("FlameBase.read_hdf: To be removed after Cantera 3.0; use " + "'restore' instead.", DeprecationWarning) if restore_boundaries: domains = range(3) @@ -694,9 +692,8 @@ def settings(self): To be removed after Cantera 3.0. The getter is replaceable by `Domain1D.settings`; for the setter, use setters for individual settings. """ - warnings.warn( - "Property 'settings' to be removed after Cantera 3.0. Access settings from " - "domains instead.", DeprecationWarning) + warnings.warn("FlameBase.settings: to be removed after Cantera 3.0. Access " + "settings from domains instead.", DeprecationWarning) out = {'Sim1D_type': type(self).__name__} out['transport_model'] = self.transport_model out['energy_enabled'] = self.energy_enabled @@ -711,9 +708,8 @@ def settings(self): @settings.setter def settings(self, s): - warnings.warn( - "Property 'settings' to be removed after Cantera 3.0. Use individual " - "setters instead.", DeprecationWarning) + warnings.warn("FlameBase.settings: To be removed after Cantera 3.0. Use " + "individual setters instead.", DeprecationWarning) # simple setters attr = {'transport_model', 'energy_enabled', 'soret_enabled', 'radiation_enabled', diff --git a/interfaces/cython/cantera/reaction.pyx b/interfaces/cython/cantera/reaction.pyx index f814efb8e5..b4a4a4aee2 100644 --- a/interfaces/cython/cantera/reaction.pyx +++ b/interfaces/cython/cantera/reaction.pyx @@ -1307,9 +1307,8 @@ cdef class Reaction: equation=None, init=True, efficiencies=None, Kinetics kinetics=None, third_body=None): if kinetics: - warnings.warn( - "Parameter 'kinetics' is no longer used and will be removed after " - "Cantera 3.0.", DeprecationWarning) + warnings.warn("Reaction: Parameter 'kinetics' is no longer used and will " + "be removed after Cantera 3.0.", DeprecationWarning) if not init: return @@ -1349,8 +1348,8 @@ cdef class Reaction: _third_body = ThirdBody(third_body) elif efficiencies: warnings.warn( - "Argument 'efficiencies' is deprecated and will be removed after " - "Cantera 3.0. Use ThirdBody instead.", DeprecationWarning) + "Reaction: Argument 'efficiencies' is deprecated and will be removed " + "after Cantera 3.0. Use ThirdBody instead.", DeprecationWarning) third_body = "M" _third_body = ThirdBody(third_body) _third_body.efficiencies = efficiencies @@ -1668,15 +1667,15 @@ cdef class Reaction: """ def __get__(self): warnings.warn( - "Property 'efficiencies' is deprecated and will be removed after " - "Cantera 3.0. Use ThirdBody instead.", DeprecationWarning) + "Reaction.efficiencies: Property is deprecated and will be removed " + "after Cantera 3.0. Access via ThirdBody instead.", DeprecationWarning) if self.third_body is None: raise ValueError("Reaction does not involve third body collider") return self.third_body.efficiencies def __set__(self, eff): warnings.warn( - "Property 'efficiencies' is deprecated and will be removed after " - "Cantera 3.0. Use ThirdBody instead.", DeprecationWarning) + "Reaction.efficiencies: Property is deprecated and will be removed " + "after Cantera 3.0. Access via ThirdBody instead.", DeprecationWarning) if self.third_body is None: raise ValueError("Reaction does not involve third body collider") self.third_body.efficiencies = comp_map(eff) @@ -1693,15 +1692,15 @@ cdef class Reaction: """ def __get__(self): warnings.warn( - "Property 'default_efficiency' is deprecated and will be removed after " - "Cantera 3.0. Use ThirdBody instead.", DeprecationWarning) + "Reaction.default_efficiency: Property is deprecated and will be " + "removed after Cantera 3.0. Use ThirdBody instead.", DeprecationWarning) if self.third_body is None: raise ValueError("Reaction does not involve third body collider") return self.third_body.default_efficiency def __set__(self, default_eff): warnings.warn( - "Property 'default_efficiency' is deprecated and will be removed after " - "Cantera 3.0. Use ThirdBody instead.", DeprecationWarning) + "Reaction.default_efficiency: Property is deprecated and will be " + "removed after Cantera 3.0. Use ThirdBody instead.", DeprecationWarning) if self.third_body is None: raise ValueError("Reaction does not involve third body collider") self.third_body.default_efficiency = default_eff @@ -1717,7 +1716,7 @@ cdef class Reaction: `ThirdBody` object instead. """ warnings.warn( - "Method 'efficiency' is deprecated and will be removed after " + "Reaction.efficiency: Method is deprecated and will be removed after " "Cantera 3.0. Use ThirdBody instead.", DeprecationWarning) if self.third_body is None: raise ValueError("Reaction does not involve third body collider") @@ -1818,8 +1817,8 @@ cdef class ThreeBodyReaction(Reaction): """ def __init__(self, *args, **kwargs): - warnings.warn("Class to be removed after Cantera 3.0; no specialization " - "necessary.", DeprecationWarning) + warnings.warn("ThreeBodyReaction: Class to be removed after Cantera 3.0; " + "no specialization necessary.", DeprecationWarning) cdef class FalloffReaction(Reaction): @@ -1852,8 +1851,8 @@ cdef class FalloffReaction(Reaction): """ def __init__(self, *args, **kwargs): - warnings.warn("Class to be removed after Cantera 3.0; no specialization " - "necessary.", DeprecationWarning) + warnings.warn("FalloffReaction: Class to be removed after Cantera 3.0; " + "no specialization necessary.", DeprecationWarning) cdef class ChemicallyActivatedReaction(FalloffReaction): """ @@ -1864,8 +1863,8 @@ cdef class ChemicallyActivatedReaction(FalloffReaction): """ def __init__(self, *args, **kwargs): - warnings.warn("Class to be removed after Cantera 3.0; no specialization " - "necessary.", DeprecationWarning) + warnings.warn("ChemicallyActivatedReaction: Class to be removed after Cantera " + "3.0; no specialization necessary.", DeprecationWarning) cdef class CustomReaction(Reaction): """ @@ -1884,5 +1883,5 @@ cdef class CustomReaction(Reaction): """ def __init__(self, *args, **kwargs): - warnings.warn("Class to be removed after Cantera 3.0; no specialization " - "necessary.", DeprecationWarning) + warnings.warn("CustomReaction: Class to be removed after Cantera 3.0; no " + "specialization necessary.", DeprecationWarning) diff --git a/interfaces/cython/cantera/solutionbase.pyx b/interfaces/cython/cantera/solutionbase.pyx index 56378bb319..b45878c039 100644 --- a/interfaces/cython/cantera/solutionbase.pyx +++ b/interfaces/cython/cantera/solutionbase.pyx @@ -60,8 +60,8 @@ cdef class _SolutionBase: raise AttributeError('duplicate specification of phase name') warnings.warn( - "Support for keyword 'phaseid' to be removed after Cantera 3.0. " - "Replaceable by keyword 'name'.", DeprecationWarning) + "_SolutionBase: Support for keyword 'phaseid' to be removed after " + "Cantera 3.0. Replaceable by keyword 'name'.", DeprecationWarning) name = kwargs['phaseid'] if 'phases' in kwargs: @@ -70,8 +70,8 @@ cdef class _SolutionBase: 'duplicate specification of adjacent phases') warnings.warn( - "Support for keyword 'phases' to be removed after Cantera 3.0. " - "Replaceable by keyword 'adjacent'.", DeprecationWarning) + "_SolutionBase: Support for keyword 'phases' to be removed after " + "Cantera 3.0. Replaceable by keyword 'adjacent'.", DeprecationWarning) adjacent = kwargs['phases'] # Shallow copy of an existing Solution (for slicing support)