By default, it appears pyroSAR doesn't log errors when calling GAMMA commands. Some recent setup work uncovered this when a workflow failed, but didn't crash until a downstream component failed due to missing files. The lack of logs hid the error source in the workflow, which isn't ideal if debugging is required.
Logging should be enabled for pyroSAR operations, particularly for capturing errors.
The docs for pyroSAR are incomplete & don't provide an obvious example a preferred method for logging (in the usage context of sar-pipeline).
GAMMA Context
During install, pyroSAR creates the ~/.pyrosar/gammaparse directory before generating thousands of lines of Python code to interface with GAMMA.
Example generated function from ~/.pyrosar/gammaparse/diff.py:
def base_add(base_1,
base_2,
base_out,
mode='-',
logpath=None, # NB: no logging by default
outdir=None,
shellscript=None):
# skip docstring
cmd = ['/g/data/dg9/GAMMA/GAMMA_SOFTWARE-20230712/DIFF/bin/base_add', base_1, base_2, base_out, mode]
process(cmd, logpath=logpath, outdir=outdir, shellscript=shellscript)
The process() func is defined in pyroSAR/gamma/auxil.py:
def process(
cmd: list[str],
outdir: str | None = None,
logfile: str | None = None,
logpath: str | None = None, # NB: no logging by default
inlist: list[str] | None = None,
void: bool = True,
shellscript: str | None = None
) -> tuple[str, str] | None:
... # rest of body
By default, errors will be silenced.
Potential solutions
- Ensure logging params are specified for any operations called from
sar-pipeline (problem: some ops are missing logging)
- Uglier: modify the
~/.pyrosar/gammaparse/<file>.py code with logfile params
- Monkeypatch (not for production, only for debugging)
By default, it appears
pyroSARdoesn't log errors when callingGAMMAcommands. Some recent setup work uncovered this when a workflow failed, but didn't crash until a downstream component failed due to missing files. The lack of logs hid the error source in the workflow, which isn't ideal if debugging is required.Logging should be enabled for
pyroSARoperations, particularly for capturing errors.The docs for
pyroSARare incomplete & don't provide an obvious example a preferred method for logging (in the usage context ofsar-pipeline).GAMMA Context
During install,
pyroSARcreates the~/.pyrosar/gammaparsedirectory before generating thousands of lines of Python code to interface with GAMMA.Example generated function from
~/.pyrosar/gammaparse/diff.py:The
process()func is defined inpyroSAR/gamma/auxil.py:By default, errors will be silenced.
Potential solutions
sar-pipeline(problem: some ops are missing logging)~/.pyrosar/gammaparse/<file>.pycode with logfile params