Using sacred without the CLI?
See original GitHub issueI really love the idea of sacred, but I already have a CLI interface for my application, which I’m unwilling to change. Would it be possible to disentangle the guts of Experiment from the main-hijacking semantics?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:6
Top Results From Across the Web
Command-Line Interface — Sacred 0.8.3 documentation
Sacred provides a powerful command-line interface for every experiment out of box. All you have to do to use it is to either...
Read more >Experiencing Shiva with A Sacred Fire
Importantly, there was to be no small talk around the sacred fire, ... The fire resonated with the divinity that our tradition teaches...
Read more >Sacred - neptune.ai documentation
Sacred is a tool to configure, organize, log, and reproduce computational experiments. With the Neptune–Sacred integration, you can log the following metadata ...
Read more >Nothing that is not sacred - eJewish Philanthropy
CLI is directed by Rabbi Sid Schwarz and is fiscally sponsored by Hazon ... It was the anchoring element of the Judaism I...
Read more >1.7 Integration with Sacred - signac documentation
Here we demonstrate how to integrate a sacred experiment with signac-flow. Assuming the following sacred experiment defined in a experiment.py module:.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I think what you can do is just define your experiment in a separate file. There you might just declare the function that runs your experiment as a command.
experiment.pyThen in the file that contains the cli you can import the experiment object and update the config that you parsed with your cli parser. For example assuming that you get the number of epochs from your cli, it could look something like this
cli.pyThen you can run this from the command line just as usual, e.g.
python cli.py --epoch 5You probably don’t even have to use a separate command. Using
should work equally well. Hope that helps!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.