Skip to content

canfar_monitor.py: IndentationError at line 55 breaks canfar_run and 3 entry points #709

@cailmdaley

Description

@cailmdaley

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 spacesIndentationError 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions