Skip to content
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

Binding to same value from multiple files #163

Open
alexd314 opened this issue Mar 12, 2022 · 1 comment
Open

Binding to same value from multiple files #163

alexd314 opened this issue Mar 12, 2022 · 1 comment

Comments

@alexd314
Copy link

alexd314 commented Mar 12, 2022

I wonder if it is/would be possible to bind multiple values to the same parameter via different config files. For instance:

File main.py

def myfunc(mylist):
    print(mylist)  

Gin-config file config1.gin:

myfunc.mylist += 'apples'

Gin-config file config2.gin:

myfunc.mylist += 'oranges'

Running the app

Then, when running the app, it should print:

['apples', 'oranges']

with the binding order based on the order of including 'config1.gin' and 'config2.gin'

@alexd314
Copy link
Author

Because I find this to be really valuable, I've made an implementation supporting dictionaries and lists here. I can make a PR if interested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant