1.7 Integration with Sacred

NOTE: These cells are not executable code, but are meant to serve as a guideline for setting up a Sacred project with signac

Here we demonstrate how to integrate a sacred experiment with signac-flow. Assuming the following sacred experiment defined in a experiment.py module:

from sacred import Experiment

ex = Experiment('jupyter_ex', interactive=True)

def hello(foo):
    print("hello", foo)

Then we can integrate that experiment on a per job basis as defined in project.py :

from flow import FlowProject
class SacredProject(FlowProject):

def run_experiment(job):
    ex.observers[:] = [FileStorageObserver.create(job.fn("my_runs"))]