Skip to content

openmhc: evaluate_imputation(version="full", max_samples=N) crashes with an obscure IndexError #91

Description

@NarayanSchuetz

From a full-repo review (line refs from ecb7fe0).

src/openmhc/_evaluate.py:639-651: the full branch sets the max91d masks cache unconditionally while max_samples truncates split indices — the cache's applicable indices then overrun the truncated dataset → IndexError deep in the evaluator. The XS branch explicitly guards exactly this case (:660-667); the full branch doesn't, though the docstring advertises max_samples for all versions.

Related asymmetries worth fixing in the same pass: XS mask cache absent → silent fall-through to on-the-fly mask generation (:640-668) while full raises; and _raise_if_lfs_pointer_masks (:54-66) inspects only the first .npz and is never invoked for the XS cache.

Suggested fix: mirror the XS guard in the full branch (raise a clear ValueError that max_samples is incompatible with the precomputed mask cache, or subset the cache), make the XS missing-cache case raise, and run the LFS-pointer check on all mask files for both versions.

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

    Labels

    bugSomething isn't workingmedium priorityMedium priority

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions