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

$COBAYA_MODULES env variable? #32

Closed
timothydmorton opened this issue Jul 5, 2019 · 4 comments
Closed

$COBAYA_MODULES env variable? #32

timothydmorton opened this issue Jul 5, 2019 · 4 comments

Comments

@timothydmorton
Copy link
Contributor

Just another suggestion as you move toward 2.0-- have you considered using a $COBAYA_MODULES environment variable as the default modules directory? That way, if modules isn't passed in an info string, then you can just default to os.getenv('COBAYA_MODULES', None) or something like that as the modules path. This would also make it easier to share .yaml files between machines (e.g., would avoid having to hard-code paths).

If you're interested, I'm happy to give a shot at a PR along these lines.

@JesusTorrado
Copy link
Contributor

JesusTorrado commented Jul 5, 2019

Already there https://github.com/CobayaSampler/cobaya/blob/master/cobaya/run.py#L136

But I see now that it's not documented. Will add to the docs, thanks!

@timothydmorton
Copy link
Contributor Author

Great!

@timothydmorton
Copy link
Contributor Author

Could cobaya-install also default to using $COBAYA_MODULES if -m is not provided?

(cobaya) [tmorton@perseus ~]$ export COBAYA_MODULES=/tigress/tmorton/cosmology/modules
(cobaya) [tmorton@perseus ~]$ cobaya-install cosmo
usage: cobaya-install [-h] -m /install/path [-f] [--no-progress-bars]
                      [-C | -D]
                      input_file.yaml [input_file.yaml ...]
cobaya-install: error: the following arguments are required: -m/--modules

@JesusTorrado
Copy link
Contributor

Added and both documented. I hope you don't mind that it will come with 2.0: cherry-picking is a little dangerous at the moment (quite a few changes). It'll be in <2 weeks anyway.

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