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

Global parameters #5

Closed
varvara-l opened this issue Jan 15, 2015 · 2 comments
Closed

Global parameters #5

varvara-l opened this issue Jan 15, 2015 · 2 comments

Comments

@varvara-l
Copy link
Contributor

There are some configuration parameters in the system that different functions and classes can require any time (for example, a special directory for temporary files, the number of processors the system can use).
It's sometimes inconvenient to pass them to functions, so there should be a list of global variables which are seen from everywhere. But I don't know what is a good way to do it in python.

@chrishokamp
Copy link
Contributor

for now we should use the conf.yaml file for this. That's already what
we're doing with the workers: param in yaml.

I think we want to avoid globals because that's a code smell (especially in
python). If a component needs a parameter from the config, like the tmp/
directory path, then it needs to be initialized with that parameter,
probably with a sensible default in most cases.

So, for the alignment model, it should be initialized with a tmp/ dir
location, and it should probably delete the alignment files by default once
we're finished using them.

In the future, the user should be able to name the tmp/ dir after the
experiment, so that different experiment configurations can be stored in
different directories.

On Thu, Jan 15, 2015 at 3:26 PM, varvara-l notifications@github.com wrote:

There are some configuration parameters in the system that different
functions and classes can require any time (for example, a special
directory for temporary files, the number of processors the system can
use).
It's sometimes inconvenient to pass them to functions, so there should be
a list of global variables which are seen from everywhere. But I don't know
what is a good way to do it in python.


Reply to this email directly or view it on GitHub
#5.

@varvara-l
Copy link
Contributor Author

All global parameters should be defined in the config and passed to functions that need them. There won't be any global parameters seen from everywhere.

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