vice.singlezone.func ==================== Type : ```` Default : vice._globals._DEFAULT_FUNC_ A callable object which must accept time in Gyr as the only parameter. The value returned by this function will represent either the gas infall history in :math:`M_\odot\ yr^{-1}` (``mode`` == "ifr"), the star formation history in :math:`M_\odot\ yr^{-1}` (``mode`` == "sfr"), or the ISM gas supply in :math:`M_\odot` (``mode`` == "gas). .. note:: The default function returns the value of 9.1 always. With a default ``mode`` of "ifr", this corresponds to an infall rate of 9.1 :math:`M_\odot\ yr^{-1}` at all times. .. note:: Saving this functional attribute with VICE outputs requires the package dill_, an extension to ``pickle`` in the Python_ standard library. It is recommended that VICE user's install dill_ >= 0.2.0. .. _dill: https://pypi.org/project/dill/ .. _Python: https://docs.python.org/library/ .. note:: This attribute will always be expected to accept time in Gyr as the only parameter. However, infall and star formation rates will be interpreted as having units of :math:`M_\odot\ yr^{-1}` according to convention. .. seealso:: vice.singlezone.mode Example Code ------------ >>> import math as m >>> import vice >>> sz = vice.singlezone(name = "example") >>> def f(t): if t <= 1: return 10 else: return 10 * m.exp(-(t - 1) / 3) >>> sz.func = f >>> sz.func = lambda t: 10. * m.exp(-t / 3)