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 produces()[source]

Return the type of the object that this definition produces.

values(inherited=False) → Dict[str, Any][source]

Return all the attribute values on this definition.

class arlunio.DefnAttribute(name: str, default: t.Any, inherited: bool, dtype: t.Optional[t.Any] = None)[source]

A definition attribute

classmethod copy(existing)[source]

Copy an existing attribute definition.

classmethod fromparam(parameter: inspect.Parameter, dtype: Any)[source]

Given a parameter and type hints, construct an attribute.

to_attr()[source]

Convert our representation of an attribute into an attrs attribute.

default: t.Any

The default value of the attrbute.

dtype: t.Optional[t.Any]

The type of the attribute.

inherited: bool

Indicates whether this attribute is inherited.

name: str

The name of the attribute.

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.

name: str

The name of the base.

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

inherited: bool

Flag to indicate if the input has been inherited from another definition.

name: str

The name of the input.

sources: ‘t.Optional[t.List[Defn]]’

List of definitions to indicate which definitions an input has been inherited from.

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

Import Utilities

Extensions to Python’s import machinery to support more than just regular Python files. Currently includes support for the following formats.

  • .ipynb: Jupyter Notebooks

class arlunio.imp.NotebookFinder[source]

Responsible for checking a path to see if it “looks like a notebook”.

class arlunio.imp.NotebookLoader(path=None)[source]

This does the legwork of importing a notebook.

classmethod fromfile(filepath: str)[source]

Import a Jupyter Notebook directly from a filepath.