-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make runners configurable from the command-line using hydra
#49
Conversation
…dency of hydra, because we use it directly
…aking in config from input
Codecov ReportAttention:
... and 2 files with indirect coverage changes 📢 Thoughts on this report? Let us know!. |
@NewtonSander have you seen this error before? https://github.com/agencyenterprise/neural-data-simulator/actions/runs/6583346051/job/17886339278?pr=49 On
My PR doesn't touch any actions, so I'm a little confused where this is coming from, unless |
@charlesincharge I wasn't aware of this error, I re-triggered a successful job on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job Charles!
The only thing I am missing is the output we had for each command line script when we were passing the --help
flag.
docs/source/decoders.md
Outdated
@@ -12,7 +12,7 @@ The {class}`decoder.decoders.Decoder` class can also be used with a custom decod | |||
|
|||
## Configuring and running the included decoder | |||
|
|||
To configure the decoder, change the file `settings_decoder.yaml`, which is located by default in the `$HOME/.nds/` folder. You can point the script to use a different configuration file by passing the `--settings-path` argument. | |||
To configure the decoder, change the file `settings_decoder.yaml`, which is located by default in the `$HOME/.nds/` folder. You can point the script to use a different configuration file by passing the `--config` argument. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this parameter --config
correct? Shouldn't it be --config-path
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the catch! Updated to --config-path
and --config-name
docs/source/ephys_generator.md
Outdated
To use a specific config file, specify the config directory (`--config-dir`) and config file-name (`--config-name`) flags. For example: | ||
|
||
``` | ||
ephys_generator --config-dir $HOME/.nds/ --config-name settings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have you tried using a --config-dir different from the default NDS_HOME path (os.path.join(os.path.expanduser("~"), ".nds"))?
I think it won't work as the runtime.py has the NDS_HOME
variable that is used in the hydra decorators but it's not set by the user input
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching that.
Looks like --config-path
is the correct way to overwrite the config, whereas --config-dir
is only appends to the config-search-path. So something like:
streamer --config-path=/Users/charles/Development/nds/src/streamer/config/
still works after removing my ~/.nds/*.yaml
configs.
Unfortunately, it requires an absolute path (or a path-relative to streamer
, which is probably a bit confusing for most users).
Let me see if there is a way to also pass in a config path relative to the current working directory.
Thanks for helping me workaround that test error Newton! |
@charlesincharge it seems like I can't run
after I execute
so i have to execute --hydra-help to get the help docs for
|
After some discussion with Newton and trying to brainstorm workarounds, I have decided that We do want |
@NewtonSander thanks for the feedback here. I made some substantial changes, so I moved it to a different branch and opened a separate PR: #57 I will close this PR. |
#44
Introduction
This PR adds command-line configuration to the
run_*.py
scripts. For example you can now change the logger level with:streamer log_level=DEBUG
.Changes
pydantic-yaml
library tohydra
.hydra
both reads in YAML config files and parses any values from the command-line interfaceYamlStrEnum
bystr, Enum
mix-inheritanceThis hydra/PyDantic integration is based on this blog post: https://suneeta-mall.github.io/2022/03/15/hydra-pydantic-config-management-for-training-application.html#can-pydantic-bridge-the-gaps-in-hydra
Behavior
run_closed_loop
works the same:run_*.py
scripts can now be configured on the command-line, e.g.streamer log_level=DEBUG streamer.stream_indefinitely=false
run_*.py --help
shows the default config, e.g.:outputs
folder, which is mostly unused right now.