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

Some tutorials hard code paths #102

Closed
akremin opened this issue Jun 11, 2024 · 1 comment
Closed

Some tutorials hard code paths #102

akremin opened this issue Jun 11, 2024 · 1 comment

Comments

@akremin
Copy link
Member

akremin commented Jun 11, 2024

Some tutorials use hard-coded pathnames that only work at NERSC. It would be ideal if we could use the standard environment variables DESI_ROOT, DESI_SPECTRO_REDUX, SPECPROD, etc. to allow users to set up their own environment on their own system without needing to edit lines of code. This is also relevant for the desidocker work, which gets around this with setting up fake directory trees, but it would be ideal if we didn't need to have such workarounds.

E.g. tutorials/getting_started/intro_to_DESI_EDR_files.ipynb hardcodes the following:

specprod = 'fuji'    # Internal name for the EDR
specprod_dir = '/global/cfs/cdirs/desi/public/edr/spectro/redux/fuji/'

But it could check for environment variables first, and only default to the above if the variables aren't set.

@sbailey
Copy link
Collaborator

sbailey commented Mar 6, 2025

In the tutorial updates for DR1 in PR #110 I updated all of the getting started tutorials to be based upon $DESI_ROOT without hardcoding NERSC-specific paths, except for the QuickStart tutorial where I included a NERSC-specific fallback if $DESI_ROOT was not set but $NERSC_HOST was set. These were re-organized and developed on my laptop with the wifi turned off to confirm that they work away from NERSC. I did not retroactively update past meeting tutorials, etc., but I think that is good enough for the spirit of this ticket.

Let's hold ourself to this standard for future 01_getting_started and 02_digging_deeper tutorials — even if they require running at NERSC, it can be useful to swap $DESI_ROOT to other data releases without hardcoding specific NERSC paths.

@sbailey sbailey closed this as completed Mar 6, 2025
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