Skip to content

Fix num_filters_passed to count individually-passing filters - #252

Open
fnachon wants to merge 9 commits into
HannesStark:mainfrom
fnachon:fix/num-filters-passed-count
Open

Fix num_filters_passed to count individually-passing filters#252
fnachon wants to merge 9 commits into
HannesStark:mainfrom
fnachon:fix/num-filters-passed-count

Conversation

@fnachon

@fnachon fnachon commented Jul 10, 2026

Copy link
Copy Markdown

Fixes #126.

num_filters_passed incremented by the cumulative AND of all filter columns seen so far in the loop (self.df[filter_cols].all(axis=1)), not by whether the current filter passed. Once any filter failed for a design, every subsequent increment in the loop added 0 regardless of whether the design actually passed those later filters. So the column ends up reporting "count of leading filters passed before the first failure" rather than the intended total pass count. Fixed by incrementing with the current filter's own pass/fail column instead.

fnachon and others added 9 commits January 10, 2026 15:54
Changes made to run without errors on the Mac MPS device: torch.autocast, number of devices and workers to use on M1-5 chips, workaround for CUDA-specific code, handling of float64 incompatibilities for MPS.
Replace hardcoded torch.autocast("cuda") with device-agnostic
device_type=tensor.device.type in confidence_utils, inverse_fold,
and writer modules introduced in the upstream merge.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Python pickle does not preserve RDKit atom-level SetProp values. When
PyTorch DataLoader spawns worker processes (default num_workers=1 on
macOS), self.canonicals is pickled and all atom 'name' properties are
lost, causing KeyError in process_atom_features.

Fix: load all required molecules directly from the moldir zip inside
each get_sample() / get_feat() call instead of using the pickled
self.canonicals. The moldir zip handle is cached per-process by
_get_zipfile(), so there is no repeated I/O overhead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ders

- Disable pin_memory on MPS (unsupported, causes UserWarning)
- Enable persistent_workers when num_workers > 0 (avoids repeated
  worker init overhead and the PL suggestion warning)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The counter incremented by the cumulative AND of all filter columns
seen so far in the loop, not by whether the current filter passed.
Once any filter failed, every later increment added 0 regardless of
whether the design actually passed those later filters, so the
column ends up reporting "count of leading filters passed before the
first failure" instead of the intended total pass count.

Fixes HannesStark#126

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

suspected bug in "num_filters_passed"

1 participant