How to use the chempy.util.pyutil.deprecated function in chempy

To help you get started, we’ve selected a few chempy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bjodah / chempy / chempy / chemistry.py View on Github external
    @deprecated(use_instead=equilibrium_constant)
    def K(self, *args, **kwargs):
        return self.equilibrium_constant(*args, **kwargs)
github bjodah / chempy / chempy / util / _expr.py View on Github external
cur *= x0
        return res

    if shift is None:
        argument_names = None
    else:
        argument_names = (shift, Ellipsis)
    if name is not None:
        _poly.__name__ = name
    return Expr.from_callback(_poly, parameter_keys=(parameter_name,), argument_names=argument_names,
                              **kwargs)

from ._expr_deprecated import _mk_PiecewisePoly, _mk_Poly  # noqa

mk_PiecewisePoly = deprecated(use_instead=create_Piecewise)(_mk_PiecewisePoly)
mk_Poly = deprecated(use_instead=create_Poly)(_mk_Poly)
github bjodah / chempy / chempy / util / _expr.py View on Github external
else:
                cur *= x0
        return res

    if shift is None:
        argument_names = None
    else:
        argument_names = (shift, Ellipsis)
    if name is not None:
        _poly.__name__ = name
    return Expr.from_callback(_poly, parameter_keys=(parameter_name,), argument_names=argument_names)

from ._expr_deprecated import _mk_PiecewisePoly, _mk_Poly  # noqa

mk_PiecewisePoly = deprecated(use_instead=create_Piecewise)(_mk_PiecewisePoly)
mk_Poly = deprecated(use_instead=create_Poly)(_mk_Poly)
github bjodah / chempy / chempy / henry.py View on Github external
    @deprecated('0.3.1', '0.5.0', __call__)
    def get_kH_at_T(self, *args, **kwargs):
        return self(*args, **kwargs)
github bjodah / chempy / chempy / kinetics / rates.py View on Github external
        @deprecated(use_instead='Radiolytic.all_args')
        def g_value(self, variables, backend=math, **kwargs):
            g_val, = self.all_args(variables, backend=backend, **kwargs)
            return g_val
github bjodah / chempy / chempy / equilibria.py View on Github external
    @deprecated(last_supported_version='0.3.1', will_be_missing_in='0.8.0',
                use_instead=phase_transfer_reaction_idxs)
    def precipitate_rxn_idxs(self):
        return [idx for idx, rxn in enumerate(self.rxns)
                if rxn.has_precipitates(self.substances)]
github bjodah / chempy / chempy / reactionsystem.py View on Github external
    @deprecated(last_supported_version='0.5.7', will_be_missing_in='0.8.0',
                use_instead='chempy.printing.tables.UnimolecularTable')
    def unimolecular_html_table(self, *args, **kwargs):
        from .printing.tables import UnimolecularTable
        return UnimolecularTable.from_ReactionSystem(self)
github bjodah / chempy / chempy / chemistry.py View on Github external
from .util.arithmeticdict import ArithmeticDict
from .util._expr import Expr
from .util.periodic import mass_from_composition
from .util.parsing import (
    formula_to_composition, to_reaction,
    formula_to_latex, formula_to_unicode, formula_to_html
)

from .units import default_units, is_quantity, unit_of, to_unitless
from ._util import intdiv
from .util.pyutil import deprecated, DeferredImport, ChemPyDeprecationWarning


ReactionSystem = DeferredImport('chempy.reactionsystem', 'ReactionSystem',
                                [deprecated(use_instead='chempy.ReactionSystem')])


class Substance(object):
    """ Class representing a chemical substance

    Parameters
    ----------
    name : str
    charge : int (optional, default: None)
        Will be stored in composition[0], prefer composition when possible.
    latex_name : str
    unicode_name : str
    html_name : str
    composition : dict or None (default)
        Dictionary (int -> number) e.g. {atomic number: count}, zero has special
        meaning (net charge). Avoid using the key 0 unless you specifically mean
github bjodah / chempy / chempy / chemistry.py View on Github external
    @deprecated(last_supported_version='0.3.0', will_be_missing_in='0.8.0')
    def precipitate(self):
        """ deprecated attribute, provided for compatibility for now """
        return self.phase_idx > 0