Skip to content

Fix scaling mode in IC generators and std_one validation - #93

Merged
Ceyron merged 3 commits into
mainfrom
fix-ics
Feb 17, 2026
Merged

Ceyron merged 3 commits into
mainfrom
fix-ics

Conversation

@Ceyron

@Ceyron Ceyron commented Feb 17, 2026 •

Copy link
Copy Markdown
Owner

This PR is partially breaking

  • Fix build_scaling_array mode in IC generators: GaussianRandomField and RandomTruncatedFourierSeries used mode="coef_extraction" when pre-scaling Fourier coefficients before ifft. This mode doubles along every axis for non-zero, non-Nyquist modes, but irfftn only restores conjugates along the right-most axis. The result is that physical amplitudes on non-right-most axes are halved in 2D+. Changed to mode="reconstruction", which only doubles along the right-most axis. No behavior change in 1D (the two modes are identical when there is only one axis).

  • Fix inverted std_one validation: The condition offset_range == (0.0, 0.0) and std_one incorrectly rejected zero offset with std_one=True (valid) and allowed non-zero offset with std_one=True (invalid). Flipped to !=.

Closes #34

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.61%. Comparing base (691d050) to head (47a3baa).
⚠️ Report is 2 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #93      +/-   ##
==========================================
+ Coverage   91.60%   91.61%   +0.01%     
==========================================
  Files          72       72              
  Lines        2560     2564       +4     
==========================================
+ Hits         2345     2349       +4     
  Misses        215      215              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Ceyron
Ceyron merged commit cba9d02 into main Feb 17, 2026
4 checks passed
@Ceyron
Ceyron deleted the fix-ics branch February 17, 2026 13:31
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.

[Probably BREAKING] Fix to the usage of the correct scaling arrays at various places

2 participants