Skip to content

Remove duplicated method-attachment loop from MIAHandler.__init__ - #433

Open
avalyset wants to merge 3 commits into
aidotse:mainfrom
avalyset:issue394-dedup-handler-attach
Open

avalyset wants to merge 3 commits into
aidotse:mainfrom
avalyset:issue394-dedup-handler-attach

Conversation

@avalyset

@avalyset avalyset commented Jul 5, 2026

Copy link
Copy Markdown

Description

Removes the duplicated method-attachment loop that ran in both MIAHandler.__init__ and LeakPro.setup_handler (#394). On the MIA path the two loops were identical, so AbstractInputHandler methods were bound to the handler twice on every run.

The loop is kept in LeakPro.setup_handler — the single point that attaches methods for both the MIA and MINV paths. The other direction, removing it from setup_handler, was rejected: MINVHandler.__init__ only receives configs and has no access to the training handler, so it would require a signature change there (as the issue notes).

  • Removed the attach loop from MIAHandler.__init__
  • Dropped the now-unused training_handler parameter and the now-unused inspect / types imports in mia_handler.py. MIAHandler is constructed only internally by LeakPro.setup_handler; it is not re-exported in any __all__ and not shown in docs/notebooks.
  • Updated the single call site in leakpro.py

Resolved Issues

How Has This Been Tested?

ruff check passes locally on the changed files. I couldn't run the pytest suite locally (torch isn't installed in my environment), so I'm relying on CI there. The change is covered: test_tabular_input_handler builds the handler through LeakPro(...) → setup_handler and calls handler.train(...), so method attachment is exercised end-to-end and setup_handler binds the same methods as before.

Related Pull Requests

(none)

avalyset and others added 3 commits July 5, 2026 19:14
The attach loop ran in both MIAHandler.__init__ and LeakPro.setup_handler.
On the MIA path the two were identical, binding AbstractInputHandler methods
twice per run. Keep the single central loop in setup_handler (the only attach
point for both MIA and MINV paths) and drop the duplicate from __init__.

Also drops the now-unused training_handler parameter and inspect/types imports
in mia_handler.py, and updates the single internal call site in leakpro.py.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Double attachment of methods to MIAHandler

2 participants