dessn / Pippin

Pipeline for photometric SN analysis
MIT License
9 stars 10 forks source link

Improve error message #164

Closed benjaminrose closed 7 months ago

benjaminrose commented 7 months ago

I am getting the python error and not the Pippin configuration error on this check. This is failing from a python error in https://github.com/dessn/Pippin/blob/55862c6a98863fc566ea510e2b25e7222cd5dae0/pippin/snana_sim.py#L143 but it is not giving me the simulation it is parsing.

[brose3@midway2-login2 roman]$ pippin.sh -c PIPPIN_ROMAN_TRANS.yml
Loaded in cfg from /project2/rkessler/PRODUCTS/pippin/cfg.yml
Logging streaming out, also saving to /scratch/midway2/rkessler/PIPPIN_OUTPUT/PIPPIN_ROMAN_TRANS/PIPPIN_ROMAN_TRANS.log
Running on: midway2-login2.rcc.local login node.
Executing pipeline for prefix PIP_PIPPIN_ROMAN_TRANS
Output will be located in /scratch/midway2/rkessler/PIPPIN_OUTPUT/PIPPIN_ROMAN_TRANS
Only verifying config, not launching anything
'GLOBAL'
Traceback (most recent call last):
  File "/project2/rkessler/PRODUCTS/pippin/run.py", line 261, in <module>
    manager = run(args)
  File "/project2/rkessler/PRODUCTS/pippin/run.py", line 183, in run
    num_errs = manager.execute(args.check, args.compress, args.uncompress)
  File "/project2/rkessler/PRODUCTS/pippin/pippin/manager.py", line 321, in execute
    self.tasks = self.get_tasks(c)
  File "/project2/rkessler/PRODUCTS/pippin/pippin/manager.py", line 147, in get_tasks
    raise e
  File "/project2/rkessler/PRODUCTS/pippin/pippin/manager.py", line 142, in get_tasks
    new_tasks = task.get_tasks(config, total_tasks, self.output_dir, i, self.prefix, self.global_config)
  File "/project2/rkessler/PRODUCTS/pippin/pippin/snana_sim.py", line 516, in get_tasks
    s = SNANASimulation(sim_name, sim_output_dir, task_config, global_config)
  File "/project2/rkessler/PRODUCTS/pippin/pippin/snana_sim.py", line 143, in __init__
    rankeys = [r for r in self.config["GLOBAL"].keys() if r.startswith("RANSEED_")]
KeyError: 'GLOBAL'
benjaminrose commented 7 months ago

Maybe wrap L516 with a try-except block?

OmegaLambda1998 commented 7 months ago

Fixed up the line causing the error to no longer assume "GLOBAL" exists