Symptom
shapepipe.canfar.canfar_monitor fails to parse:
File "src/shapepipe/canfar/canfar_monitor.py", line 60
self._params = {
IndentationError: unexpected indent
Downstream: shapepipe.canfar_run (which imports canfar_monitor), and the three entry points canfar_submit_job, canfar_monitor, canfar_monitor_log all fail at startup with the same traceback.
Root cause
canfar_monitor.py:55 — the docstring opener is at 7 spaces while the rest of the method body (including line 60) is at 8 spaces:
def params_default(self):
"""Params Default. ← 7 spaces
Set default parameters. ← 8 spaces
"""
self._params = { ← 8 spaces ← IndentationError raised here
Python tokenises the 7-space docstring as the body indent, then rejects the 8-space continuation.
Repro
$ python -c "import shapepipe.canfar.canfar_monitor"
IndentationError: unexpected indent (canfar_monitor.py, line 60)
$ canfar_submit_job -h
[...]
IndentationError: unexpected indent
Fix
Add one space to line 55 so """ aligns with the method body (8 spaces).
Caught by
tests/unit/test_imports.py::test_module_imports[shapepipe.canfar.canfar_monitor] (currently xfailed) in #708.
Symptom
shapepipe.canfar.canfar_monitorfails to parse:Downstream:
shapepipe.canfar_run(which importscanfar_monitor), and the three entry pointscanfar_submit_job,canfar_monitor,canfar_monitor_logall fail at startup with the same traceback.Root cause
canfar_monitor.py:55— the docstring opener is at 7 spaces while the rest of the method body (including line 60) is at 8 spaces:Python tokenises the 7-space docstring as the body indent, then rejects the 8-space continuation.
Repro
Fix
Add one space to line 55 so
"""aligns with the method body (8 spaces).Caught by
tests/unit/test_imports.py::test_module_imports[shapepipe.canfar.canfar_monitor](currently xfailed) in #708.