Skip to content

Fix FejerFirst and FejerSecond implementations - #339

Merged
marco-2023 merged 3 commits into
theochem:masterfrom
marco-2023:fejer_fix
Oct 2, 2026
Merged

marco-2023 merged 3 commits into
theochem:masterfrom
marco-2023:fejer_fix

Conversation

@marco-2023

Copy link
Copy Markdown
Collaborator

This addresses #336. There was a mismatch in the indices between the documentation and the implementation.

@marco-2023 marco-2023 linked an issue Sep 30, 2026 that may be closed by this pull request
The test was a clone of the erroneous implementation.

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.

Copilot review overview

🟡 Changes recommended

The FejerFirst regression remains untested because the existing even-sized test cannot detect the corrected term.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Corrects off-by-one errors in Fejér quadrature weight calculations and aligns related documentation.

Changes:

  • Includes the final Fejér summation term.
  • Clarifies formulas, scaling, ordering, and validation messaging.
  • Updates the FejerSecond reference test.
File Description
src/​grid/​onedgrid.py Corrects Fejér weights and documentation.
src/​grid/​tests/​test_onedgrid.py Updates FejerSecond expected weights.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/grid/onedgrid.py

nsum = npoints // 2
j = np.arange(nsum - 1) + 1
j = np.arange(nsum) + 1

@PaulWAyers PaulWAyers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks @marco-2023

@marco-2023
marco-2023 merged commit ad304ca into theochem:master Oct 2, 2026
35 of 50 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.

FejerFirst and FejerSecond weights drop the last term of the sum

3 participants