add a normalization test#3
Merged
michael-petersen merged 3 commits intoJun 30, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the flex Python package by tightening input validation in the core FLEX class, modernizing packaging to a pyproject.toml-based build, and replacing an older normalization-oriented test with a reconstruction accuracy test to better exercise the numerical path.
Changes:
- Added centralized numeric input coercion/validation for
FLEXinputs (R,phi,mass,velocity, plus reconstruction inputs). - Refactored Laguerre amplitude and reconstruction computations to use NumPy broadcasting/
einsuminstead of explicit Python loops. - Modernized packaging metadata (remove
setup.py, updatepyproject.tomlconfig) and adjusted test dependencies accordingly.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_flex.py |
Replaces the previous normalization-focused test with a reconstruction peak-amplitude check to validate the updated reconstruction path. |
test_requirements.txt |
Removes numba from test requirements and keeps editable install (-e .) for the src-layout package. |
src/flex/flexbase.py |
Adds input validation helpers and rewrites amplitude/reconstruction logic with vectorized NumPy operations. |
setup.py |
Removed in favor of pyproject.toml build configuration. |
pyproject.toml |
Removes unused build/runtime dependencies and configures setuptools package discovery for the src/ layout (plus pytest config). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cad735c
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 pull request makes some improvements to the
flexpackage, focusing on input validation, array handling, and code structure. The changes enhance robustness, improve maintainability, and modernize the package setup.Refactoring and Modernization
setup.pyfile in favor of a modernpyproject.toml-based build system.pyproject.tomlto specify the package source directory assrc, added configuration for package discovery, and updated the project homepage URL.Performance and Code Simplification
laguerre_amplitudes,laguerre_amplitudes_newaxis, andlaguerre_reconstructionto use efficient broadcasting andnumpyoperations instead of Python loops, improving performance and code clarity.Testing Improvements