You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Option to specify the arg --config-path, -cp as an absolute path.
Motivation
We are working on a new package for local motion planning research. There is a lot of complex configuration required in this project and I think it's a perfect candidate to integrate hydra.
The problem is, it's a package. We would like potential users to be able to install the package (through pypi) and put their configuration files in an arbitrary location. However, currently the config_path arg is relative to the Python file declaring @hydra.main(). In our application @hydra.main() is called within the package, which makes relative paths tricky.
Pitch
Describe the solution you'd like
Would it be possible to check if the specified path in --config-path is absolute or relative, using for instance os.path.isabs(config_path)? If it's an absolute path, we could simply set the search_path to be equal to the config_path. Otherwise we could keep the current behavior.
Describe alternatives you've considered
Alternatively, it could be done using an additional arg specifically for paths relative to the current working directory (or absolute paths).
Are you willing to open a pull request?
Yes
The text was updated successfully, but these errors were encountered:
This was actually already supported as
os.path.join("/blah", "/abs/config"), just returns "/abs/config",
but we've made this explicit in code and docs now.
This was actually already supported as
os.path.join("/blah", "/abs/config"), just returns "/abs/config",
but we've made this explicit in code and docs now.
This was actually already supported as
os.path.join("/blah", "/abs/config"), just returns "/abs/config",
but we've made this explicit in code and docs now.
How does one pass the absolute path to config_path in the hydra decorator?
When using @hydra.main(config_path='/content/configs/', config_name="config", version_base=None)
raises error
Primary config module 'package.directory.configs' not found.
Check that it's correct and contains an __init__.py file
Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
馃殌 Feature Request
Option to specify the arg
--config-path, -cp
as an absolute path.Motivation
We are working on a new package for local motion planning research. There is a lot of complex configuration required in this project and I think it's a perfect candidate to integrate hydra.
The problem is, it's a package. We would like potential users to be able to install the package (through pypi) and put their configuration files in an arbitrary location. However, currently the config_path arg is relative to the Python file declaring @hydra.main(). In our application @hydra.main() is called within the package, which makes relative paths tricky.
Pitch
Describe the solution you'd like
Would it be possible to check if the specified path in
--config-path
is absolute or relative, using for instanceos.path.isabs(config_path)
? If it's an absolute path, we could simply set the search_path to be equal to the config_path. Otherwise we could keep the current behavior.Describe alternatives you've considered
Alternatively, it could be done using an additional arg specifically for paths relative to the current working directory (or absolute paths).
Are you willing to open a pull request?
Yes
The text was updated successfully, but these errors were encountered: