Sitelet https://github.com/CAIIVS/raitap/issues/317
Skip to content

Dead code sweep: write-only state, identical-branch logic, production-dead loaders #317

Description

@stanlrt

From /simplify codebase sweep (2026-06-10). All confirmed unreferenced in src/ (tests excepted where noted).

  • transparency/explainers/base_explainer.py:85-86,133: AttributionOnlyExplainer.attributions is write-only; nothing reads it (all consumers use ExplanationResult.attributions). Pins the full attribution tensor on the explainer instance after the run -- the module otherwise fights exactly this with gc.collect()/empty_cache(). Delete the attribute and the now-empty __init__.
  • models/backend.py:384-389: OnnxBackend._select_primary_output (torch-tensor variant) has zero callers; the call path went numpy-only (forward_numpy -> _select_primary_numpy_output). Delete.
  • reporting/view_model.py:455-463 + :25-32: the elif key.startswith((...)) or key in _TECHNICAL_KEYS: branch and the else have identical bodies, so the condition and the _TECHNICAL_KEYS frozenset (no other users) are dead logic implying a classification that never happens. Collapse to else; delete the frozenset.
  • data/data.py:873-881: _load_tabular_dir/_load_tabular_dir_numpy are only called from data/tests/test_data.py; production goes through _concat_tabular_numpy directly (pre-feat(data)!: path-based labels.csv resolution + recursive image walk #103 loader-refactor vestige, 8bc55e2). Delete; repoint tests at _concat_tabular_numpy/_list_tabular_recursive.
  • tracking/mlflow_tracker.py:314: _backend_store_uri_configured is set in __init__ and read only by tests (its two siblings are used in production). Drop the flag; tests re-derive from config.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions