API¶
pypagate Package¶
Functions¶
|
Given an object and a field name, you can "bind" it to a Formula (or Term). |
|
Add dunder methods based on the fields defined in the class. |
|
Creates a new function with name |
|
Given a Term or Formula get the current value it contains. |
|
Return an object to identify dataclass fields. |
|
Use as a decorator: If a Formula's truthiness is True, call the decorated function. |
|
Raw Evaluation: Bypasses the cache and queries the Universe directly. |
|
Use as a decorator: If some specialization of a Law's truthiness is True, call the decorated function. |
|
Raw Evaluation: Bypasses the cache and queries the Universe directly. |
|
Use as a decorator: If a Formula's truthiness is True, call the decorated function. |
|
Use as a decorator: If a Formula's truthiness is True, allow the decorated function to be called, otherwise calling the decorated function does nothing. |
|
Apply a function of two arguments cumulatively to the items of an iterable, from left to right. |
|
|
|
Classes¶
|
Special type indicating an unconstrained type. |
|
A linear-time spatial partition to restrict O(N^k) Law searches. |
|
|
|
A Well-Formed-Formula that consists of Term objects (i.e. variables) and operators. |
|
|
|
All numbers inherit from this class. |
|
Essentially a variable that may be updated by the user. |
|
|
|
|
|
Cartesian product of input iterables. |
pypagate.source Package¶
Functions¶
|
Use as a decorator: Every time source.listen(...) is called, evaluate this function. |
|
Either executes |
|
Use as a decorator: Every time source.listen(...) is called and the formula evaluates to True, execute this function. |
Classes¶
|
|
|
A Well-Formed-Formula that consists of Term objects (i.e. variables) and operators. |
|
All numbers inherit from this class. |
|
A collection of Terms (with starting values) where Terms can be updated with the listen method. |
|
Essentially a variable that may be updated by the user. |