Description
I am running the LephareInformer stage from rail.estimation.algos.lephare in a JupyterLab environment on a remote cluster (CCIN2P3). The pipeline fails during the prepare step due to missing filter files, even though the default cache directories are automatically set and detected.
The error suggests that required LSST filter files (e.g. total_u.pb) are not present in the expected LEPHAREDIR directory.
Full notebook (reproducible example)
from rail.utils import catalog_utils
from rail.estimation.algos import lephare
from rail.core.data import TableHandle
# Load catalog config
catalog_utils.load_yaml("catalogs.yaml")
catalog_utils.apply("cardinal_roman_rubin")
# Create informer
informer = lephare.LephareInformer.make_stage(
name="inform",
output_mode="return",
hdf5_groupname="",
do_prepare=True,
)
# Remove env variables to rely on default cache behavior
import os
os.environ.pop("LEPHAREDIR")
os.environ.pop("LEPHAREWORK")
# Load data
train_data = TableHandle(
"train", path="public/pz_challenge_taskset_1_cardinal_training_10yr.hdf5"
)
test_data = TableHandle(
"test", path="public/pz_challenge_taskset_1_cardinal_test_10yr.hdf5"
)
# Run informer
model = informer.inform(train_data)
Console output
LEPHAREDIR is being set to the default cache directory:
/pbs/home/a/adesouhant/.cache/lephare/data
More than 1Gb may be written there.
LEPHAREWORK is being set to the default cache directory:
/pbs/home/a/adesouhant/.cache/lephare/work
Default work cache is already linked.
This is linked to the run directory:
/pbs/home/a/adesouhant/.cache/lephare/runs/20260415T192106
Then later:
User defined LEPHAREDIR is set. Code runs depend on all required
auxiliary data being present at /pbs/home/a/adesouhant/.cache/lephare/data.
User defined LEPHAREWORK is set. All intermediate files will be written to:
/pbs/home/a/adesouhant/.cache/lephare/runs/inform
Error
ValueError: Can't open filter file
/pbs/home/a/adesouhant/.cache/lephare/data/filt/lsst/total_u.pb
Traceback points to:
lephare.prepare
FilterSvc.from_keymap
Observations
-
The cache directory is correctly created and detected
-
However, the directory:
/pbs/home/a/adesouhant/.cache/lephare/data/filt/lsst/
does not contain the required .pb files
-
do_prepare=True does not seem to generate these filter files automatically
-
Removing LEPHAREDIR and LEPHAREWORK does not fix the issue (they are reset internally)
Expected behavior
Either:
- Required auxiliary data (filters, templates, etc.) should be automatically downloaded/initialized
or
- A clear error message should indicate that manual setup is required
Actual behavior
The pipeline fails with a low-level error:
ValueError: Can't open filter file ...
without guidance on how to obtain or generate the missing files.
Questions
- Is there a recommended way to install/download LePhare auxiliary data when using RAIL?
- Should LSST filter files (
total_u.pb, etc.) be generated by prepare, or provided beforehand?
- Is there a script or helper function to initialize
$LEPHAREDIR properly?
- Is this expected behavior when using
catalog_utils.apply("cardinal_roman_rubin")?
Environment
Additional note
The issue might be related to missing initialization of LePhare data (filters/templates), rather than a runtime bug in RAIL itself.
Thanks for your help!
Description
I am running the
LephareInformerstage fromrail.estimation.algos.lepharein a JupyterLab environment on a remote cluster (CCIN2P3). The pipeline fails during thepreparestep due to missing filter files, even though the default cache directories are automatically set and detected.The error suggests that required LSST filter files (e.g.
total_u.pb) are not present in the expectedLEPHAREDIRdirectory.Full notebook (reproducible example)
Console output
Then later:
Error
Traceback points to:
lephare.prepareFilterSvc.from_keymapObservations
The cache directory is correctly created and detected
However, the directory:
does not contain the required
.pbfilesdo_prepare=Truedoes not seem to generate these filter files automaticallyRemoving
LEPHAREDIRandLEPHAREWORKdoes not fix the issue (they are reset internally)Expected behavior
Either:
or
Actual behavior
The pipeline fails with a low-level error:
without guidance on how to obtain or generate the missing files.
Questions
total_u.pb, etc.) be generated byprepare, or provided beforehand?$LEPHAREDIRproperly?catalog_utils.apply("cardinal_roman_rubin")?Environment
Platform: CCIN2P3 cluster (remote JupyterLab)
Python: 3.11 (conda env)
Packages:
raillephareAdditional note
The issue might be related to missing initialization of LePhare data (filters/templates), rather than a runtime bug in RAIL itself.
Thanks for your help!