mathxlab.experiments¶
Registry and discovery for mathematical experiments.
Stability
Status: Experimental.
This project treats the documented names as the public surface, but details may still evolve.
If you need strict API guarantees, add __all__ = [...] to each module and version releases accordingly.
Design notes¶
Keep helpers small, explicit, and reproducible.
Examples¶
Resolve experiment metadata¶
from mathxlab.experiments import get_experiment_module, list_experiment_ids
print(list_experiment_ids()[:5])
print(get_experiment_module("e001"))
Public API¶
Name |
Kind |
Summary |
|---|---|---|
|
class |
Lightweight metadata about an experiment. |
|
function |
Iterate over known experiments. |
|
function |
Return all known experiment ids. |
|
function |
Return the module import path for a given experiment id. |
Reference¶
Classes¶
- class mathxlab.experiments.ExperimentSpec(experiment_id, title, module)[source]¶
Bases:
objectLightweight metadata about an experiment.
- Parameters:
experiment_id – The experiment id, e.g. “e001”.
title – Human-readable title (used in listings).
module – Import path of the experiment entry point module.
Examples
>>> from mathxlab.experiments.__init__ import ExperimentSpec >>> ExperimentSpec
Functions¶
- mathxlab.experiments.iter_experiments()[source]¶
Iterate over known experiments.
- Returns:
An iterable of ExperimentSpec items in ascending experiment id order.
Examples
>>> from mathxlab.experiments.__init__ import iter_experiments >>> iter_experiments
- mathxlab.experiments.list_experiment_ids()[source]¶
Return all known experiment ids.
- Returns:
Tuple of ids like (“e001”, “e002”, …).
Examples
>>> from mathxlab.experiments import list_experiment_ids >>> ids = list_experiment_ids() >>> ids[0].startswith("e") True
- mathxlab.experiments.get_experiment_module(experiment_id)[source]¶
Return the module import path for a given experiment id.
- Parameters:
experiment_id – The experiment id, e.g. “e003”.
- Returns:
The module import path, e.g. “mathxlab.experiments.e003”.
- Raises:
KeyError – If the experiment id is unknown.
Examples
>>> from mathxlab.experiments.__init__ import get_experiment_module >>> get_experiment_module