You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
#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 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
Audit for other directories missing __init__.py and fix them, expecting more surfaced messages.
Add a guard so linter scope silently shrinking is visible.
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, 21modules and ~3,750 lines, was silently outside pylint's scope. Confirmed by comparison:
#198 adds
__init__.pyto carry the pending-deprecation warning, which brought the subpackage intoscope and surfaced 11 pre-existing messages:
too-many-locals(R0914)factored_generative_process.py,structures/{fully_conditional,conditional_transitions,sequential_conditional}.pytoo-many-arguments(R0913)factored_generative_process.py,independent_factored_generative_process.pyunused-argument(W0613)structures/{fully_conditional,conditional_transitions}.py(both thecontextparameter, required by theConditionalStructureprotocol)too-many-instance-attributes(R0902)factored_generative_process.pyinvalid-name(C0103)independent_factored_generative_process.py(T_i, notation-faithful)#198 suppresses these via
per-file-ignoresrather than fixing them, because the package is pendingdeprecation 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 overper-factor tensors is not really a smell, and
T_iis deliberate notation. The twounused-argumenthits are protocol-required parameters, which is a legitimate case for a narrowinline 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 subpackagefrom 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:
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
__init__.pyand fix them, expecting more surfaced messages.generative_processessurvive, narrow or remove theper-file-ignoresentry accordingly — the surviving code should be lint-clean on its merits, andthe deleted code makes the question moot.