Repository navigation
pylint silently skipped generative_processes: missing __init__.py removed a whole subpackage from scope #199
Description
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:
-
The messages themselves. Mostly benign for numerical code —
too-many-localsin a scan over
per-factor tensors is not really a smell, andT_iis deliberate notation. The two
unused-argumenthits 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. -
The scoping gap is the real bug. A missing
__init__.pysilently 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 \; -printA 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
- Audit for other directories missing
__init__.pyand fix them, expecting more surfaced messages. - Add a guard so linter scope silently shrinking is visible.
- Once Decide the home of mixed-state presentation before deprecating generative_processes #194 and Decide whether transition_matrices.py is deprecated alongside generative_processes #195 settle which parts of
generative_processessurvive, narrow or remove the
per-file-ignoresentry accordingly — the surviving code should be lint-clean on its merits, and
the deleted code makes the question moot.
Activity
Instantiate generative processes by capability, not by namespace (#198)