Skip to content

perf: reduce unit test runtime from 82s to 28s#322

Merged
Jammy2211 merged 1 commit intomainfrom
feature/unit-test-profiling
Apr 6, 2026
Merged

perf: reduce unit test runtime from 82s to 28s#322
Jammy2211 merged 1 commit intomainfrom
feature/unit-test-profiling

Conversation

@Jammy2211
Copy link
Copy Markdown
Collaborator

Summary

Reduce unit test suite runtime by 66% (81.56s → ~28s) through three strategies:

  1. Move 17 aggregator tests to autogalaxy_workspace_test as integration scripts (saves ~30s)
  2. Monkeypatch plt.tight_layout and plt.colorbar in plot_patch fixture to skip expensive matplotlib internals (saves ~12s)
  3. Reduce interferometer grid sizes (51×51→31×31), UV wavelengths (7→3), and MGE test gaussian counts (saves ~3s)

All 17 aggregator tests are preserved with identical assertions in the new autogalaxy_workspace_test repo under scripts/database/scrape/.

API Changes

None — internal test changes only.

Test Plan

  • All 835 remaining unit tests pass
  • All 3 workspace_test integration scripts pass (imaging.py, interferometer.py, ellipse.py)
  • CI passes on this branch
Full API Changes (for automation & release notes)

No public API changes. All modifications are to test files and test configuration only:

Removed (from unit tests — moved to autogalaxy_workspace_test)

  • test_autogalaxy/aggregator/ — entire directory (17 tests across 8 files)

Changed (test parameters only)

  • test_autogalaxy/interferometer/test_simulate_and_fit_interferometer.py — grid 51×51→31×31, UV wavelengths 7→3, mesh 7×7→5×5
  • test_autogalaxy/interferometer/test_simulator.py — UV wavelengths 7→3
  • test_autogalaxy/analysis/test_model_util.py — total_gaussians 10→3, 5→2
  • test_autogalaxy/conftest.py — added tight_layout and colorbar monkeypatches to plot_patch fixture

🤖 Generated with Claude Code

Move 17 aggregator tests to autogalaxy_workspace_test as integration
scripts. Monkeypatch plt.tight_layout and plt.colorbar in plot_patch
fixture to skip expensive matplotlib internals. Reduce interferometer
grid sizes (51x51→31x31), UV wavelengths (7→3), and MGE test gaussian
counts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Jammy2211 Jammy2211 merged commit 07374f0 into main Apr 6, 2026
2 checks passed
@Jammy2211 Jammy2211 deleted the feature/unit-test-profiling branch April 6, 2026 18:43
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.

1 participant