TimePar#

class TimePar(v=None, *args, **kwargs)[source]#

Bases: BaseArr

Base class for time-aware parameters, durations and rates

NB, because the factor needs to be recalculated, do not set values directly.

Attributes

isarray

Check if the value is an array

Methods

validate_units()[source]#

Check that the units entered are valid

init(parent=None, parent_unit=None, parent_dt=None, update_values=True, die=True)[source]#

Link to the sim and/or module units

property isarray#

Check if the value is an array

set(v=None, unit=None, parent_unit=None, parent_dt=None, self_dt=None, force=False)[source]#

Set the specified parameter values (ignoring None values) and update stored values

update_cached(update_values=True, die=True)[source]#

Update the cached factor and values

update_factor()[source]#

Set factor used to multiply the value to get the output

update_values()[source]#

Convert from self.v to self.values based on self.factor – must be implemented by derived classes

to(unit=None, dt=None)[source]#

Create a new timepar based on the current one but with a different unit and/or dt

to_parent()[source]#

Create a new timepar with the same units as the parent

to_json()[source]#

Export to JSON