Skip to content

load_psf is undefined — PSF-from-file modalities raise NameError #116

@paxcalpt

Description

@paxcalpt

Found during a full-repo audit.

generate/imaging.py:587 (_load_PSF_from_file) calls load_psf(path, transpose, unitary), but:

  • the only import is commented out at generate/imaging.py:9 (# from .psf.image_psf import load_psf), and
  • there is no def load_psf anywhere in the package (grep -rn "def load_psf" src/ returns nothing), and it is not provided by the from ..utils.transform.datatype import * wildcard.

So any modality whose PSF stack_source != "generate" hits _load_PSF_from_fileNameError: name 'load_psf' is not defined.

Latent today because every shipped modality config uses source: generate, but a user-supplied PSF-from-file config crashes.

I did not fix this in the audit PRs because the fix needs the original psf/image_psf.py (or equivalent) load_psf implementation, which isn't in the tree — guessing it would be wrong. Options:

  1. restore/repoint the import to the real load_psf, or
  2. implement load_psf, or
  3. raise a clear NotImplementedError if PSF-from-file isn't supported yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions