algebraixlib.mathobjects package¶
This package contains the modules that define the classes that represent data.
The modules that contain classes that represent data are:
mathobject
: Contains the abstract base classMathObject
. It is the base class of all other data classes and can’t be instantiated.It also provides the utility functions
raise_if_not_mathobject()
andraise_if_not_mathobjects()
that raise aTypeError
if the argument is not an instance ofMathObject
(resp. is not a collection of such instances).atom
: Contains the classAtom
. Instances of this class represent atoms; that is, values of non-math objects, like numbers, strings or any immutable Python value. All instances ofAtom
are members of set A (\(A\)), or conversely, set A is the set of all instances ofAtom
.It also provides the utility function
auto_convert()
that makes sure that its argument is always an instance ofMathObject
; if it isn’t, it converts it into anAtom
.couplet
: Contains the classCouplet
that represents a couplet.multiset
: Contains the classMultiset
that represents a multiset.
In addition to the modules with classes that represent data, there is a private module
_flags
. It contains the class _flags.Flags
that provides a mechanism to cache
certain properties of MathObject
s. It is used by property accessors like
cached_is_relation
and is not meant to be used by itself. (See also
[PropCache].)
All module-level symbols (functions and classes, except _flags.Flags
) are exposed at the
package level, so if you import mathobjects
(the package), these module-level symbols are
imported. (Similarly, from mathobjects import ...
can be used to import individual symbols
from the package.)