Skip to content

Test coverage gaps: AMICA.save/load and plot_components #15

Closed

Description

@neuromechanist

Surfaced during Phase 1 review (epic #9, PR #14).

  • AMICA.save/AMICA.load (pyAMICA/amica.py:244-297) do a real torch.save/load state_dict roundtrip but have zero test coverage. The old AMICATorch.save/load test was deleted (those methods no longer exist); coverage moved to the wrapper and was never re-added.
  • amica_viz.plot_components (pyAMICA/amica_viz.py:84) has a current signature (results_dir, data=None, ...) -> None and is fully untested since the stale test_visualization was deleted.

Add real (non-mock) tests: save/load a fitted model to tmp_path and assert roundtrip equality of W/A; render plot_components from a real saved results directory and assert files are written.

Activity

  1. added
    feature
    on Jul 2, 2026
  2. neuromechanist commented on Jul 6, 2026

    @neuromechanist
    MemberAuthor

    The save/load half of this issue is now covered by #44 (merged): real fit -> save -> load -> transform round-trip plus unfitted/degenerate/non-finite/snapshot guard tests (test_amica_ng_wrapper.py, test_ng_backend.py::test_state_dict_*).

    Remaining under this issue: amica_viz.plot_components test coverage. Keeping open for that.

  3. neuromechanist commented on Jul 7, 2026

    @neuromechanist
    MemberAuthor

    Done via #65 (and #36). AMICA.save/load roundtrip is covered by test_amica_ng_wrapper.py (save-requires-fit, save/load roundtrip asserting W/A equality, version guard, missing-key guard, degenerate-refusal) added under #36. plot_components builds an in-memory figure and never writes a file, so the 'assert files are written' premise does not apply; #65 covers its previously-untested activation branch (data provided) instead. amica.py coverage 86% -> 96%.

  4. added a commit that references this issue on Sep 1, 2026
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

    feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions