Registry / devops / sacred

sacred

JSON →
library0.8.7pypypiunverified

Sacred is a tool to help you configure, organize, log, and reproduce computational experiments. It is designed to introduce the least amount of overhead while making it easy to handle scientific research. The current version is 0.8.7, with a cadence of occasional releases.

pip install sacred
INSTALL
IMPORT
SIG · SACRED
S
sacred
devopspythonv0.8.7
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Experiment
from sacred import Experiment
from sacred import Experiment

Run with `python my_experiment.py` with default config, or `python my_experiment.py with name='universe'` to override config.

from sacred import Experiment ex = Experiment('hello_world') @ex.config def my_config(): name = 'world' @ex.automain def my_main(name): print(f'Hello {name}!')
Debug
Known issues
breakingIn sacred 0.8.0, the MongoDB dependency was removed from the default install. MongoObserver is no longer available without installing `pymongo` separately.
fix
Install `pymongo` manually: `pip install pymongo`. Then import MongoObserver as before.
affects: >=0.8.0
deprecatedThe `ex.main` decorator (with `ex.run()`) is deprecated in favor of `@ex.automain`. For simple scripts, use `@ex.automain`.
fix
Replace `@ex.main` with `@ex.automain` and remove `ex.run()` call.
affects: >=0.8.0
gotchaWhen using `@ex.config` functions, all names defined inside become configuration entries. Accidentally defining a helper variable inside the config function will expose it as a config option, which may cause unexpected overrides.
fix
Keep config functions clean; use `@ex.named_config` for reusable partial configs.
affects: all
gotchaObservers like `FileStorageObserver` or `MongoObserver` must be added before `ex.run()` is called. Adding them inside a captured function or after run will not work.
fix
Add observers immediately after creating the Experiment object.
affects: all
Upgrade
Version history
0.8.7latest on PyPI · released Nov 26, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
10
Resources
sacred — pip install sacred · libregistry