methodcard.registry
The registry of every method card, filled on import and keyed by qualified name.
Classes
| Name | Description |
|---|---|
Entry | A registered method: the object, its card and what only exists at runtime. |
Functions
| Name | Description |
|---|---|
card | The card of a registered class or function (it renders in Jupyter). |
entries | The registered entries, of one top-level package or of all. |
load | Import a package and all its submodules, so that every card is registered. |
qualified_name | <module>.<qualname> of a class or function. |
register | Add an entry; a name registered twice (a module reloaded) is replaced. |
registry | The registered classes and functions, of one top-level package or of all. |
summary | The first line of the object's own docstring. |
Entryclassdataclass#
class Entry(obj: Any, card: MethodCard, symbolic: Mapping[str, Any] | Callable[[], Mapping[str, Any]] = dict(), problem: Callable[[], Any] | None = None)A registered method: the object, its card and what only exists at runtime.
Attributes
| Name | Type | Description |
|---|---|---|
obj | Any | The class or function. |
card | MethodCard | Its card. |
symbolic | Mapping[str, Any] | Callable[[], Mapping[str, Any]] | SymPy rules by equation key (:class:~methodcard.Rule or bare
expressions), or a function returning them. |
problem | Callable[[], Any] | None | Returns the :class:~methodcard.ConvergenceProblem of the method. |
cardattributeinstance attribute#
card: MethodCardobjattributeinstance attribute#
obj: Anyproblemattributeclass attributeinstance attribute#
problem: Callable[[], Any] | None = Nonesymbolicattributeclass attributeinstance attribute#
symbolic: Mapping[str, Any] | Callable[[], Mapping[str, Any]] = field(default_factory=dict)cardfunction#
def card(obj: Any) -> MethodCardThe card of a registered class or function (it renders in Jupyter).
Raises
LookupError- If the object has no card.
entriesfunction#
def entries(package: str | None = None) -> dict[str, Entry]The registered entries, of one top-level package or of all.
Parameters
loadfunction#
def load(package: str) -> dict[str, BaseException]Import a package and all its submodules, so that every card is registered.
Modules in a tests subpackage are skipped.
Parameters
| Name | Type | Description |
|---|---|---|
package | str | The top-level package. |
Returns
dict[str, BaseException]- The modules that failed to import, with their errors.
qualified_namefunction#
def qualified_name(obj: Any) -> str<module>.<qualname> of a class or function.
registerfunction#
def register(entry: Entry) -> NoneAdd an entry; a name registered twice (a module reloaded) is replaced.
registryfunction#
def registry(package: str | None = None) -> dict[str, Any]The registered classes and functions, of one top-level package or of all.
summaryfunction#
def summary(obj: Any) -> strThe first line of the object’s own docstring.