engforge.attr_dynamics.Time

class Time(name, default, validator, repr, cmp, hash, init, inherited, metadata=None, type=None, converter=None, kw_only=False, eq=None, eq_key=None, order=None, order_key=None, on_setattr=None, alias=None)[source]

Bases: ATTR_BASE

Transient is a base class for integrators over time

Methods

add_var_constraint

adds a type constraint to the solver.

class_validate

validates onetime A method to validate the kwargs passed to the define method

collect_attr_inst

collects all the attribute instances for a system

collect_cls

collects all the attributes for a system

configure_for_system

add the config class, and perform checks with `class_validate) :returns: [optional] a dictionary of options to be used in the make_attribute method

configure_instance

validates the instance given attr's init routine

constraint_exists

check constraints on the system, return its index position if found, else None.

create_instance

Create an instance of the instance_class

define

taking a component or system class as possible input valid input is later validated as an instance of that class or subclass

define_validate

A method to validate the kwargs passed to the define method

evolve

Copy self and apply changes.

from_counting_attr

handle_instance

handles the instance, override as you wish

integrate

Defines an ODE like integrator that will be integrated over time with the defined integration rule.

make_attribute

makes an attrs.Attribute for the class

make_factory

process_combos

subclasses

return all subclasses of components, including their subclasses :type out: :param out: out is to pass when the middle of a recursive operation, do not use it!

unpack_atrs

Attributes

name

default

validator

repr

eq

eq_key

order

order_key

hash

init

metadata

type

converter

kw_only

inherited

on_setattr

alias

allow_constraint_override

attr_prefix

default_options

none_ok

template_class

mode

var

rate

constraints

config_cls

active

combos

classmethod add_var_constraint(value, kind='min', **kwargs)[source]

adds a type constraint to the solver. If value is numeric it is used as a bound with scipy optimize.

Parameters:

type – str, must be either min or max with var value comparison, or with a function additionally eq,ineq (same as max(0)) can be used

Value:

either a numeric (int,float), or a function, f(system)

classmethod class_validate(instance, **kwargs)[source]

validates onetime A method to validate the kwargs passed to the define method

classmethod collect_attr_inst(system, handle_inst=True)

collects all the attribute instances for a system

Return type:

dict

classmethod collect_cls(system)

collects all the attributes for a system

Return type:

dict

classmethod configure_for_system(name, config_class, cb=None, **kwargs)

add the config class, and perform checks with `class_validate) :returns: [optional] a dictionary of options to be used in the make_attribute method

classmethod configure_instance(instance, attribute, value)

validates the instance given attr’s init routine

classmethod constraint_exists(**kw)[source]

check constraints on the system, return its index position if found, else None.

classmethod create_instance(instance)

Create an instance of the instance_class

Return type:

AttributeInstance

Parameters:

instance (Configuration)

classmethod define(**kwargs)

taking a component or system class as possible input valid input is later validated as an instance of that class or subclass

classmethod define_validate(**kwargs)

A method to validate the kwargs passed to the define method

evolve(**changes)

Copy self and apply changes.

This works similarly to attrs.evolve but that function does not work with Attribute.

It is mainly meant to be used for transform-fields.

Added in version 20.3.0.

classmethod handle_instance(canidate)

handles the instance, override as you wish

instance_class

alias of IntegratorInstance

classmethod integrate(var, rate, mode='euler', active=True, combos='default')[source]

Defines an ODE like integrator that will be integrated over time with the defined integration rule.

Input should be of strings to look up the particular property or field

Parameters:
classmethod make_attribute(name, comp_class, **kwargs)

makes an attrs.Attribute for the class

classmethod subclasses(out=None)

return all subclasses of components, including their subclasses :type out: :param out: out is to pass when the middle of a recursive operation, do not use it!