Improve coverage, setup to ignore flex#2
Merged
michael-petersen merged 8 commits intoObservationalExpansions:mainfrom Nov 25, 2025
Merged
Improve coverage, setup to ignore flex#2michael-petersen merged 8 commits intoObservationalExpansions:mainfrom
michael-petersen merged 8 commits intoObservationalExpansions:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves test coverage for the discmodel package and adds pytest configuration to ignore the flex directory during test runs. The changes include expanded test cases for the expansion functions, a bug fix in the optional imports checker, and modifications to exception handling in the disc rotation code.
- Adds test coverage for noisy expansions and expansion computation before image generation
- Fixes bug in
_check_flex()function that was checking for wrong module - Comments out try-except blocks in rotation code that handled single-particle edge cases
- Configures pytest to ignore the flex directory
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_discmodel.py | Adds test for expansion before image generation and noisy expansion test; renames variable E2 to E3 for clarity |
| src/discmodel/optional_imports.py | Fixes bug where _check_flex() was incorrectly checking for "lintsampler" instead of "flex" |
| src/discmodel/discmodel.py | Comments out try-except blocks in rotate_disc() that handled single-particle (N=1) edge cases |
| pytest.ini | Adds pytest configuration to ignore the flex directory during test runs |
| .github/workflows/test.yaml | Minor whitespace cleanup in pytest command |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
304866f
into
ObservationalExpansions:main
10 checks passed
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.
This PR does some test improvement, and also adds an example of how to ignore a specific directory with
pytest.