Efficiency improvements for unit tests #2223
Draft
GernotMaier wants to merge 3 commits into
Draft
Conversation
…lotting routines)
- Mock HTTP requests globally (urlretrieve) to serve local repo files - Cache pyproj Transformer construction with lru_cache (layout/telescope_position.py) - Write stub PNG bytes instead of real matplotlib renders for file saves - Patch Figure.tight_layout to no-op (eliminates text-extent rendering) - Patch Figure.colorbar to MagicMock (eliminates quad-mesh rendering) - Add session-scoped ERFA warm-up fixture to pre-initialise astropy coordinate transforms before any test measures them Typical improvements on slow test hardware (original -> new): test_plot_writes_per_type_comparison_figures: 1.96s -> ~0.25s test_plot_incident_angles_debug_plots_true: 1.73s -> ~0.25s test_generate_simulation_grid (ERFA): 1.12s -> ~0.30s test_build_layout (pyproj): 1.56s -> ~0.10s test_read_table_from_file_and_validate: 1.24s -> ~0.25s Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Improvements mostly in unit tests of the plotting routines - a lot can be achieved to set DPI to 10...
Was:
is now: