Skip to content

pylint silently skipped generative_processes: missing __init__.py removed a whole subpackage from scope #199

Description

@ealt

Surfaced by #198.

What happened

simplexity/generative_processes/ had no __init__.py — it was an implicit namespace package.
As a result pylint simplexity (the CI command) never walked into it: the whole subpackage, 21
modules and ~3,750 lines, was silently outside pylint's scope. Confirmed by comparison:

# at main (4075750)
$ pylint simplexity tests                                            # 10.00/10, 0 messages
$ grep -c factored_generative_process <output>                        # 0  <- never analyzed
$ pylint simplexity/generative_processes/factored_generative_process.py   # 3 messages

#198 adds __init__.py to carry the pending-deprecation warning, which brought the subpackage into
scope and surfaced 11 pre-existing messages:

Code Count Files
too-many-locals (R0914) 5 factored_generative_process.py, structures/{fully_conditional,conditional_transitions,sequential_conditional}.py
too-many-arguments (R0913) 2 factored_generative_process.py, independent_factored_generative_process.py
unused-argument (W0613) 2 structures/{fully_conditional,conditional_transitions}.py (both the context parameter, required by the ConditionalStructure protocol)
too-many-instance-attributes (R0902) 1 factored_generative_process.py
invalid-name (C0103) 1 independent_factored_generative_process.py (T_i, notation-faithful)

#198 suppresses these via per-file-ignores rather than fixing them, because the package is pending
deprecation and refactoring code slated for removal is poor value. That is a deliberate deferral, not
a claim they are wrong.

Why it is worth a ticket rather than just leaving the ignore

Two separate things, and the second is the more interesting one:

  1. The messages themselves. Mostly benign for numerical code — too-many-locals in a scan over
    per-factor tensors is not really a smell, and T_i is deliberate notation. The two
    unused-argument hits are protocol-required parameters, which is a legitimate case for a narrow
    inline disable. If this package survives (see Decide the home of mixed-state presentation before deprecating generative_processes #194 / Decide whether transition_matrices.py is deprecated alongside generative_processes #195 on which parts do), the ignore should be
    narrowed to what is genuinely intended and the rest fixed.

  2. The scoping gap is the real bug. A missing __init__.py silently removed a large subpackage
    from linting, and nothing surfaced that — the score stayed a clean 10.00/10, which reads as "fully
    linted" when it was not. Worth checking whether anything else is invisible for the same reason:

    $ find simplexity -type d -not -path '*/__pycache__*' -exec test ! -e {}/__init__.py \; -print
    

    A CI check that pylint's analysed-module count matches the file count would prevent a recurrence.
    This is the detection gap, and it is the part that generalises beyond this package.

Suggested resolution

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions