Skip to content

add a normalization test#3

Merged
michael-petersen merged 3 commits into
ObservationalExpansions:mainfrom
michael-petersen:newtests
Jun 30, 2026
Merged

add a normalization test#3
michael-petersen merged 3 commits into
ObservationalExpansions:mainfrom
michael-petersen:newtests

Conversation

@michael-petersen

Copy link
Copy Markdown
Collaborator

This pull request makes some improvements to the flex package, focusing on input validation, array handling, and code structure. The changes enhance robustness, improve maintainability, and modernize the package setup.

Refactoring and Modernization

  • Removed the legacy setup.py file in favor of a modern pyproject.toml-based build system.
  • Updated pyproject.toml to specify the package source directory as src, added configuration for package discovery, and updated the project homepage URL.

Performance and Code Simplification

  • Refactored the computation of trigonometric arrays and summations in laguerre_amplitudes, laguerre_amplitudes_newaxis, and laguerre_reconstruction to use efficient broadcasting and numpy operations instead of Python loops, improving performance and code clarity.

Testing Improvements

  • Replaced the old normalization test with a more comprehensive test that checks the accuracy of the Laguerre reconstruction against a known peak amplitude, increasing test coverage and reliability.

Copilot AI review requested due to automatic review settings June 29, 2026 13:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 FLEX inputs (R, phi, mass, velocity, plus reconstruction inputs).
  • Refactored Laguerre amplitude and reconstruction computations to use NumPy broadcasting/einsum instead of explicit Python loops.
  • Modernized packaging metadata (remove setup.py, update pyproject.toml config) 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.

@michael-petersen michael-petersen merged commit cad735c into ObservationalExpansions:main Jun 30, 2026
10 checks passed
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.

2 participants