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

Config Module #27

Closed
lewisjared opened this issue Jun 1, 2018 · 3 comments
Closed

Config Module #27

lewisjared opened this issue Jun 1, 2018 · 3 comments

Comments

@lewisjared
Copy link
Collaborator

lewisjared commented Jun 1, 2018

We need a way of accessing configuration from anywhere within pymagicc in a consistent manner. This state should not be stored in the root __init__.py as that would cause lots of circular dependencies (Module A imports Module B which imports Module A). There is a need to define default config, long-lived somewhat static config and to be able to override these values dynamically. Having a separate module with a simple interface will hide the complexity of this.

Here is how I propose that we lookup configuration variables in other parts of the library. The config object looks like a dict, but it knows how to find the appropriate parameter value.

from  pymagicc.config import config
executable = config['MAGICC6_EXECUTABLE']

Any feedback on the API?

@rgieseke
Copy link
Member

rgieseke commented Jun 1, 2018

settings should be the imported config in the example?

@lewisjared
Copy link
Collaborator Author

That is what I meant!. Edited

lewisjared added a commit to lewisjared/pymagicc that referenced this issue Jun 4, 2018
lewisjared added a commit to lewisjared/pymagicc that referenced this issue Jun 4, 2018
lewisjared added a commit to lewisjared/pymagicc that referenced this issue Jun 12, 2018
@rgieseke
Copy link
Member

Done in #32

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

2 participants