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
Currently if you include other gin files with a statement include path/to/file the path can be either absolute or relative to the folder the code is running in.
The config file however should be - in my opinion - agnostic to the folder from which you are calling the code. It makes more sense to me if all gin-config files are stored in a config folder and their relative paths are fixed (or whoever is maintaining the code is keeping track of it).
In other words, take the example in which there are two config files (config.gin and base.gin) in the same folder. Let's say that config.gin has the following line of code:
...
include 'base.gin'
...
Now let's say that main.py (located wherever you want) is calling the gin.parse_config_files_and_bindings(...) on config.gin having been given the appropriate path to it (absolute or relative). This scenario will raise an error if the terminal from which you are calling main.py is not located in the same folder in which the two config files are.
The text was updated successfully, but these errors were encountered:
You can use gin.add_config_file_search_path('path/to/config.gin') to add folders that you want gin to use when doing gin.parse_config_files_and_bindings(...)
You can use gin.add_config_file_search_path('path/to/config.gin') to add folders that you want gin to use when doing gin.parse_config_files_and_bindings(...)
Thanks for sharing this. The problem can definitely be solved by automatically add the directory of config.gin to the search path with gin.add_config_file_search_path(). However, based on my limited experience I think people tend to cluster configurations files together, and IMHO having the directory of config.gin (or whatever the top-level configuration file is) in the search path is probably a better default behavior.
Also Ideally we probably want something like with_config_file_search_paths to avoid having to use add_config_file_search_path which has side effects that can potentially pollute the other modules who also imports gin.
Currently if you include other gin files with a statement
include path/to/file
the path can be either absolute or relative to the folder the code is running in.The config file however should be - in my opinion - agnostic to the folder from which you are calling the code. It makes more sense to me if all gin-config files are stored in a
config
folder and their relative paths are fixed (or whoever is maintaining the code is keeping track of it).In other words, take the example in which there are two config files (
config.gin
andbase.gin
) in the same folder. Let's say thatconfig.gin
has the following line of code:Now let's say that
main.py
(located wherever you want) is calling thegin.parse_config_files_and_bindings(...)
onconfig.gin
having been given the appropriate path to it (absolute or relative). This scenario will raise an error if the terminal from which you are callingmain.py
is not located in the same folder in which the two config files are.The text was updated successfully, but these errors were encountered: