API Reference¶
Definitions¶
-
class
arlunio.
Defn
(*args, **kwds)[source]¶ Defn, short for ‘Definition’ is the object that powers the rest of
arlunio
.-
classmethod
attributes
(inherited=False) → Dict[str, arlunio.DefnAttribute][source]¶ Return all attributes defined on this definition.
- Parameters
inherited – If
True
return all inherited attributes also.
-
classmethod
bases
() → Dict[str, arlunio.DefnBase][source]¶ Return all the definitions this defintion is derived from.
-
classmethod
inputs
(inherited=True) → Dict[str, arlunio.DefnInput][source]¶ Return all the inputs required to evaluate this definition.
- Parameters
inherited – If
True
(default) also return any inherited inputs.
-
classmethod
-
class
arlunio.
DefnAttribute
(name: str, default: t.Any, inherited: bool, dtype: t.Optional[t.Any] = None)[source]¶ A definition attribute
-
classmethod
fromparam
(parameter: inspect.Parameter, dtype: Any)[source]¶ Given a parameter and type hints, construct an attribute.
-
default
: t.Any¶ The default value of the attrbute.
-
dtype
: t.Optional[t.Any]¶ The type of the attribute.
-
classmethod
-
class
arlunio.
DefnBase
(name: str, defn: Defn)[source]¶ A definition base.
-
classmethod
fromparam
(parameter: inspect.Parameter, defn: Defn)[source]¶ Given a parameter and type hint, construct a base
-
defn
: ‘Defn’¶ The actual definition.
-
classmethod
-
class
arlunio.
DefnInput
(name: str, dtype: t.Any, inherited: bool, sources: ‘t.Optional[t.List[Defn]]’ = None)[source]¶ A class that represents an input to a definition
-
classmethod
fromparam
(parameter: inspect.Parameter, dtype: Any)[source]¶ Given a parameter and a type hint, construct an input.
-
dtype
: t.Any¶ The type of the input
-
sources
: ‘t.Optional[t.List[Defn]]’¶ List of definitions to indicate which definitions an input has been inherited from.
-
classmethod
-
arlunio.
definition
(f=None, *, operation: Optional[str] = None, operator_pool=None) → arlunio.Defn[source]¶ Define a new Definition.
- Parameters
f – The function that is the definition
operator – Flag used to indicate if this definition is an operator.
operator_pool – Can be used to override the default operator pool