Systems
Ready-made systems of every science.
They are built from the core and organized by field and subfield.
all_systems(field=None, topics=(), tags=None)
Return the name and the class of every ready-made system.
The systems can be selected by field, by topics, or by capability tags. It takes the role of
sklearn.utils.all_estimators. The field and the topics of every class are read from the sources, so selecting by
them imports the modules of the selected classes alone. Filtering by capability tags builds every selected class
with its default model parameters and reads its tags.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field
|
str | None
|
The field, such as |
None
|
topics
|
str | Sequence[str]
|
The topic, or the topics, that every kept system lists, such as |
()
|
tags
|
Mapping[str, str | Sequence[str]] | None
|
The capability tags to keep, by field of |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
systems |
list[tuple[str, type[BaseSystem]]]
|
The name and the class of every kept system, sorted by name. |
Raises:
| Type | Description |
|---|---|
RegistryError
|
A system class is not named with the suffix |
ValidationError
|
A tag names no field of |
Examples:
>>> from skcomplex.systems import all_systems
>>> [name for name, _ in all_systems(field='chemistry/pattern_formation')]
['BrusselatorSystem', 'GrayScottSystem', 'SchnakenbergSystem']
>>> [name for name, _ in all_systems(field='chemistry', tags={'randomness': 'stochastic'})]
['ChemicalLangevinEquationSystem', 'ChemicalLangevinNetworkSystem']
Source code in src/skcomplex/systems/_catalog.py
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 | |
import_extra(module, system, extra)
Return a module of an optional extra.
When the extra is missing, it raises an error naming the system, the extra, and the install command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
module
|
str
|
The dotted name of the module. |
required |
system
|
str
|
The name of the system that needs the module. |
required |
extra
|
str
|
The name of the optional extra that holds the module. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
module |
ModuleType
|
The imported module. |
Raises:
| Type | Description |
|---|---|
MissingExtraError
|
The module is not installed. |
Examples:
>>> from skcomplex.systems import import_extra
>>> import_extra('math', 'pendulum', 'none').sqrt(4.0)
2.0
Source code in src/skcomplex/systems/_extras.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |