FormingWorlds / JANUS

1-D prescribed atmosphere model of planetary atmospheres that makes use of the SOCRATES radiative transfer code.
https://fwl-janus.readthedocs.io
Apache License 2.0
1 stars 0 forks source link

Save data to standard directory #53

Closed stefsmeets closed 3 months ago

stefsmeets commented 3 months ago

This PR adds a standard data directory for JANUS. You can still set FWL_DATA, but instead of crashing, JANUS will use a default directory instead.

I single-sourced the FWL data directory to janus.utils.data.FWL_DATA_DIR, so you can do from janus.utils.data import FWL_DATA_DIR. This avoids checking the env var in multiple places.

I also added a small CLI command to check the current data locations:

$ janus env
RAD_DIR location: /home/stef/.local/share/socrates/SOCRATES
FWL_DATA location: /home/stef/.local/share/fwl_data
$ FWL_DATA=~/some/other/path/fwl_data janus env
RAD_DIR location: /home/stef/.local/share/socrates/SOCRATES
FWL_DATA location: /home/stef/some/other/path/fwl_data

Closes #36

stefsmeets commented 3 months ago

Hi @nichollsh Could you have a look at this PR and let me know what you think?

timlichtenberg commented 3 months ago

FYI, Harrison is on vacation this week.

stefsmeets commented 3 months ago

Ah, good to know, seems like Laurent as well. I was wondering why it was so quiet on all my PRs 😅

timlichtenberg commented 3 months ago

I can see that I can get some reviewed during the week, but I will probably not be able to do all of them.

stefsmeets commented 3 months ago

No worries, there is no rush!