Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding toroidal harmonic notebooks #3681

Conversation

clmould
Copy link
Contributor

@clmould clmould commented Oct 28, 2024

Linked Issues

(This merge request is updated version of #3645)

Part of #3340

Description

Interface Changes

Checklist

I confirm that I have completed the following checks:

  • Tests run locally and pass pytest tests --reactor
  • Code quality checks run locally and pass pre-commit run --from-ref develop --to-ref HEAD
  • Documentation built locally and checked sphinx-build -W documentation/source documentation/build

@clmould clmould mentioned this pull request Oct 28, 2024
3 tasks
Copy link

Copy link

codecov bot commented Oct 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.25%. Comparing base (97db428) to head (53ad3a9).

Additional details and impacted files
@@                      Coverage Diff                       @@
##           feature/toroidal-harmonics    #3681      +/-   ##
==============================================================
- Coverage                       76.62%   76.25%   -0.38%     
==============================================================
  Files                             230      231       +1     
  Lines                           27025    27053      +28     
==============================================================
- Hits                            20709    20630      -79     
- Misses                           6316     6423     +107     

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

@clmould clmould marked this pull request as ready for review October 30, 2024 14:47
@clmould clmould requested a review from a team as a code owner October 30, 2024 14:47
Copy link
Contributor

@je-cook je-cook left a comment

Choose a reason for hiding this comment

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

From my naive understand looks really good. Could have have some tests for the function going into the main package please?

@je-cook je-cook added enhancement New feature or request equilibria Tasks relating to the equilibria module labels Nov 4, 2024
@je-cook
Copy link
Contributor

je-cook commented Nov 18, 2024

I was just running our tests on develop and we get a warning from one of the conversion functions (from arccos of a number outside the range -1<x>1 could we add a np.clip to this line unless that would have unintended side effects?

(d_1**2 + d_2**2 - 4 * R_0**2) / (2 * d_1 * d_2)

to

np.clip((d_1**2 + d_2**2 - 4 * R_0**2) / (2 * d_1 * d_2), -1, 1)

this seem to remove the warning in my quick test. I think its just floating point problems.

@clmould clmould force-pushed the clair/toroidal-approx-nb-single-wire-nb branch from 27871cf to e123fbd Compare December 11, 2024 16:36
@clmould clmould requested a review from a team as a code owner December 11, 2024 16:36
- added tests for legendre functions
- improved explanations
@clmould clmould force-pushed the clair/toroidal-approx-nb-single-wire-nb branch from e123fbd to 582c036 Compare December 11, 2024 17:06
Copy link
Contributor

@je-cook je-cook left a comment

Choose a reason for hiding this comment

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

From a code perspective looks good, thanks for adding the tests. A few little things otherwise from my end good to go.

I can't comment on the actual maths maybe @CoronelBuendia or @geograham can comment more?

@clmould clmould requested a review from a team as a code owner December 13, 2024 13:51
Copy link
Contributor

github-actions bot commented Dec 13, 2024

⚠️ Warning Report

Found 3 warnings.

All warnings (3)

On config

  • /home/runner/miniconda3/envs/bluemira/lib/python3.10/site-packages/pivy/quarter/QuarterWidget.py:17: DeprecationWarning: invalid escape sequence '\C'

On runtest

  • /home/runner/work/bluemira/bluemira/bluemira/equilibria/find.py:478: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  • /home/runner/work/bluemira/bluemira/bluemira/radiation_transport/radiation_tools.py:886: DeprecationWarning: interp2dis deprecated!interp2d` is deprecated in SciPy 1.10 and will be removed in SciPy 1.12.0.

For legacy code, nearly bug-for-bug compatible replacements are
RectBivariateSpline on regular grids, and bisplrep/bisplev for
scattered 2D data.

In new code, for regular grids use RegularGridInterpolator instead.
For scattered data, prefer LinearNDInterpolator or
CloughTocher2DInterpolator.

For more details see
https://gist.github.com/ev-br/8544371b40f414b7eaf3fe6217209bff
`

Copy link
Contributor

@geograham geograham left a comment

Choose a reason for hiding this comment

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

Looks good to go

@je-cook je-cook merged commit 489a202 into Fusion-Power-Plant-Framework:feature/toroidal-harmonics Dec 16, 2024
12 checks passed
je-cook pushed a commit that referenced this pull request Jan 29, 2025
* add toroidal harmonics approx functions and examples

* working on pr comments

* changes based on pr review comments

- added tests for legendre functions
- improved explanations

* adding image referenced in singe_wire notebook

* changes based on review comments

* Update bluemira/equilibria/optimisation/harmonics/toroidal_harmonics_approx_functions.py

Co-authored-by: geograham <[email protected]>

* Update bluemira/equilibria/optimisation/harmonics/toroidal_harmonics_approx_functions.py

Co-authored-by: geograham <[email protected]>

---------

Co-authored-by: geograham <[email protected]>
je-cook pushed a commit that referenced this pull request Feb 4, 2025
* add toroidal harmonics approx functions and examples

* working on pr comments

* changes based on pr review comments

- added tests for legendre functions
- improved explanations

* adding image referenced in singe_wire notebook

* changes based on review comments

* Update bluemira/equilibria/optimisation/harmonics/toroidal_harmonics_approx_functions.py

Co-authored-by: geograham <[email protected]>

* Update bluemira/equilibria/optimisation/harmonics/toroidal_harmonics_approx_functions.py

Co-authored-by: geograham <[email protected]>

---------

Co-authored-by: geograham <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request equilibria Tasks relating to the equilibria module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants