Skip to content

pipda.reference

module

pipda.reference

Provides Symbolic and Reference classes

Classes
  • Reference(parent, ref) — The Reference class, used to define how it should be evaluatedaccording to the context for references, for example, f.A, f['A'] or the references of them (i.e. f.A.B, f.A['b'], etc) </>
  • ReferenceAttr — Attribute references, for example: f.A, f.A.B etc.</>
  • ReferenceItem — Subscript references, for example: f['A'], f.A['B'] etc</>
abstract class

pipda.reference.Reference(parent, ref)

The Reference class, used to define how it should be evaluatedaccording to the context for references, for example, f.A, f['A'] or the references of them (i.e. f.A.B, f.A['b'], etc)

Parameters
  • parent (Any) — The parent of this reference. For example: f.A for f.A.B
  • ref (Any) — The reference. For example: B for f.A.B
Methods
  • __array_ufunc__(ufunc, method, *inputs, **kwargs) (FunctionCall) — Allow numpy ufunc to work on Expression objects</>
  • __getattr__(name) (ReferenceAttr) — Whenever expr.attr is encountered,return a ReferenceAttr object </>
  • __getitem__(item) (ReferenceItem) — Whenever expr[item] is encountered,return a ReferenceAttr object </>
  • __hash__() (int) — Make it hashable</>
  • __index__() — Allow Expression object to work as index or part of slice</>
  • __iter__() — Forbiden iterating on Expression objects</>
  • __str__() (str) — Used for stringify the whole expression</>
method

__array_ufunc__(ufunc, method, *inputs, **kwargs) → FunctionCall

Allow numpy ufunc to work on Expression objects

method

__hash__() → int

Make it hashable

method

__getattr__(name) → ReferenceAttr

Whenever expr.attr is encountered,return a ReferenceAttr object

method

__getitem__(item) → ReferenceItem

Whenever expr[item] is encountered,return a ReferenceAttr object

method

__index__()

Allow Expression object to work as index or part of slice

method

__iter__()

Forbiden iterating on Expression objects

If it is happening, probably wrong usage of functions/verbs

abstract method

__str__() → str

Used for stringify the whole expression

class

pipda.reference.ReferenceAttr(parent, ref)

Attribute references, for example: f.A, f.A.B etc.

Parameters
  • parent (Any) — The parent of this reference. For example: f.A for f.A.B
  • ref (Any) — The reference. For example: B for f.A.B
Methods
  • __array_ufunc__(ufunc, method, *inputs, **kwargs) (FunctionCall) — Allow numpy ufunc to work on Expression objects</>
  • __getattr__(name) (ReferenceAttr) — Whenever expr.attr is encountered,return a ReferenceAttr object </>
  • __getitem__(item) (ReferenceItem) — Whenever expr[item] is encountered,return a ReferenceAttr object </>
  • __hash__() (int) — Make it hashable</>
  • __index__() — Allow Expression object to work as index or part of slice</>
  • __iter__() — Forbiden iterating on Expression objects</>
  • __str__() (str) — Used for stringify the whole expression</>
method

__array_ufunc__(ufunc, method, *inputs, **kwargs) → FunctionCall

Allow numpy ufunc to work on Expression objects

method

__hash__() → int

Make it hashable

method

__getattr__(name) → ReferenceAttr

Whenever expr.attr is encountered,return a ReferenceAttr object

method

__getitem__(item) → ReferenceItem

Whenever expr[item] is encountered,return a ReferenceAttr object

method

__index__()

Allow Expression object to work as index or part of slice

method

__iter__()

Forbiden iterating on Expression objects

If it is happening, probably wrong usage of functions/verbs

method

__str__() → str

Used for stringify the whole expression

class

pipda.reference.ReferenceItem(parent, ref)

Subscript references, for example: f['A'], f.A['B'] etc

Parameters
  • parent (Any) — The parent of this reference. For example: f.A for f.A.B
  • ref (Any) — The reference. For example: B for f.A.B
Methods
  • __array_ufunc__(ufunc, method, *inputs, **kwargs) (FunctionCall) — Allow numpy ufunc to work on Expression objects</>
  • __getattr__(name) (ReferenceAttr) — Whenever expr.attr is encountered,return a ReferenceAttr object </>
  • __getitem__(item) (ReferenceItem) — Whenever expr[item] is encountered,return a ReferenceAttr object </>
  • __hash__() (int) — Make it hashable</>
  • __index__() — Allow Expression object to work as index or part of slice</>
  • __iter__() — Forbiden iterating on Expression objects</>
  • __str__() (str) — Used for stringify the whole expression</>
method

__array_ufunc__(ufunc, method, *inputs, **kwargs) → FunctionCall

Allow numpy ufunc to work on Expression objects

method

__hash__() → int

Make it hashable

method

__getattr__(name) → ReferenceAttr

Whenever expr.attr is encountered,return a ReferenceAttr object

method

__getitem__(item) → ReferenceItem

Whenever expr[item] is encountered,return a ReferenceAttr object

method

__index__()

Allow Expression object to work as index or part of slice

method

__iter__()

Forbiden iterating on Expression objects

If it is happening, probably wrong usage of functions/verbs

method

__str__() → str

Used for stringify the whole expression