specsr.paths

Filesystem locations used by specsr.

Nothing here is hard-coded to one machine. Every location can be overridden by an environment variable, which is what makes the package usable outside the original development checkout:

SPECSR_JADES_ROOT

Root of the raw JWST/JADES release tree (the directory containing DR3/, DR4/, DR5/). Raw data is large and is deliberately kept outside the repository; only derived products are built here.

SPECSR_DATA_DIR

Where derived products (paired/augmented .npz datasets) are written. Defaults to ./data relative to the current working directory.

SPECSR_CACHE_DIR

Scratch space for downloaded checkpoints and intermediate caches. Defaults to the platform cache directory.

SPECSR_OUTPUT_DIR

Where anything a user might want to keep is written – figures, predictions, evaluation tables. Defaults to ./outputs relative to the current working directory.

The distinction between the last two is deliberate. A cache may be deleted at any time without losing anything; an output is a result. Scattering results across the working directory is how they get mixed up with the code and then committed by accident, which is a large part of why this repository’s git history is twenty times the size of its contents.

Functions

cache_dir()

Scratch/cache directory.

data_dir()

Where derived datasets are written.

jades_root()

Root of the raw JADES release tree, or None if unset.

output_dir([subdir])

Where the package writes results, created on demand.

release_dir([release])

Directory for a specific data release, e.g. release_dir('DR4').

require_jades_root()

Like jades_root() but raises with an actionable message.

specsr.paths.jades_root()[source]

Root of the raw JADES release tree, or None if unset.

Return type:

Path | None

specsr.paths.data_dir()[source]

Where derived datasets are written. Created on demand.

Return type:

Path

specsr.paths.cache_dir()[source]

Scratch/cache directory. Created on demand.

Return type:

Path

specsr.paths.output_dir(subdir=None)[source]

Where the package writes results, created on demand.

Everything a user might want to keep goes here: figures, prediction caches, evaluation tables. Resolved from SPECSR_OUTPUT_DIR, defaulting to ./outputs.

subdir names a category, e.g. output_dir("figures"). Categories are created lazily, so an installation that never makes a figure never grows a figures/ directory.

Point SPECSR_OUTPUT_DIR somewhere outside the checkout to keep results entirely separate from the source tree.

Parameters:

subdir (str | None)

Return type:

Path

specsr.paths.release_dir(release='DR4')[source]

Directory for a specific data release, e.g. release_dir('DR4').

Parameters:

release (str)

Return type:

Path

specsr.paths.require_jades_root()[source]

Like jades_root() but raises with an actionable message.

Return type:

Path