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

SH Plotting #3023

Conversation

clmould
Copy link
Contributor

@clmould clmould commented Feb 15, 2024

Linked Issues

Closes #3080

Description

A new class called EquilibriumComparisonPlotter has been created which allows equilibrium plotting and comparing to a reference equilibrium. The plotting options allow for splitting the psi plots to show the coilset psi and plasma psi, and also a difference plot which plots the relative difference in psi between the current and reference equilibrium. For all the plotting options, the reference LCFS and current LCFS are overlaid on the plots.

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 force-pushed the clair/sh-plotting branch 3 times, most recently from 2809d2f to 3015955 Compare February 22, 2024 10:38
Copy link
Contributor

github-actions bot commented Feb 22, 2024

⚠️ Warning Report

Found 0 new warnings, 0 fixed warnings. 🎉

All warnings (15)

On runtest

  • /home/runner/miniconda3/envs/bluemira/lib/python3.8/site-packages/h5py/__init__.py:36: UserWarning: h5py is running against HDF5 1.14.3 when it was built against 1.14.2, this may cause problems
  • /home/runner/work/bluemira/bluemira/eudemo/eudemo/tf_coils/tf_coils.py:338: DeprecationWarning: Argument 'separatrix' is deprecated, argument 'ripple_wire' is used instead.
  • /home/runner/work/bluemira/bluemira/tests/builders/test_tf_coils.py:46: DeprecationWarning: RippleConstrainedLengthGOP API has changed, please specify how you want to constrain TF ripple by using one of the available RipplePointSelector classes. Defaulting to an EquispacedSelector with n_rip_points=3 for now.
  • /home/runner/work/bluemira/bluemira/bluemira/base/reactor.py:677: DeprecationWarning: Using kwarg 'dim' is no longer supported. Simply pass in the dimensions you would like to show, e.g. show_cad('xz')

On collect

  • /home/runner/miniconda3/envs/bluemira/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/feature.py:139: DeprecationWarning: The module 'bluemira.utilities.optimiser' is deprecated and will be removed in version 2.0.0. See https://bluemira.readthedocs.io/en/latest/optimisation/optimisation.html for documentation of the new optimisation module.
  • /home/runner/miniconda3/envs/bluemira/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/feature.py:139: DeprecationWarning: The module 'bluemira.utilities.opt_problems' is deprecated and will be removed in v2.0.0. See https://bluemira.readthedocs.io/en/latest/optimisation/optimisation.html for documentation of the new optimisation module.
  • /home/runner/miniconda3/envs/bluemira/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/feature.py:139: DeprecationWarning: The module 'bluemira.equilibria.opt_constraint_funcs' is deprecated and will be removed in v2.0.0. See https://bluemira.readthedocs.io/en/latest/optimisation/optimisation.html for documentation of the new optimisation module.
  • /home/runner/miniconda3/envs/bluemira/lib/python3.8/site-packages/pkg_resources/__init__.py:2846: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('mpl_toolkits'). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
  • /home/runner/miniconda3/envs/bluemira/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/feature.py:139: DeprecationWarning: The module 'bluemira.equilibria.opt_constraints' is deprecated and will be removed in v2.0.0. See https://bluemira.readthedocs.io/en/latest/optimisation/optimisation.html for documentation of the new optimisation module.
  • /home/runner/miniconda3/envs/bluemira/lib/python3.8/site-packages/pkg_resources/__init__.py:2846: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('sphinxcontrib'). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
  • /home/runner/miniconda3/envs/bluemira/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/feature.py:139: DeprecationWarning: The module 'bluemira.equilibria.opt_problems' is deprecated and will be removed in v2.0.0. See https://bluemira.readthedocs.io/en/latest/optimisation/optimisation.html for documentation of the new optimisation module.
  • /home/runner/miniconda3/envs/bluemira/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/feature.py:139: DeprecationWarning: The module 'bluemira.geometry.optimisation._optimisation_old' is deprecated and will be removed in v2.0.0. See https://bluemira.readthedocs.io/en/latest/optimisation/optimisation.html for documentation of the new optimisation module.
  • /home/runner/miniconda3/envs/bluemira/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/feature.py:139: DeprecationWarning: The module 'bluemira.equilibria.opt_objectives' is deprecated and will be removed in v2.0.0. See https://bluemira.readthedocs.io/en/latest/optimisation/optimisation.html for documentation of the new optimisation module.
  • /home/runner/miniconda3/envs/bluemira/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/feature.py:139: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  • /home/runner/miniconda3/envs/bluemira/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/feature.py:139: DeprecationWarning: The module 'bluemira.utilities.opt_tools' is deprecated and will be removed in v2.0.0. See https://bluemira.readthedocs.io/en/latest/optimisation/optimisation.html for documentation of the new optimisation module.

Copy link

codecov bot commented Feb 22, 2024

Codecov Report

Attention: Patch coverage is 18.66029% with 170 lines in your changes missing coverage. Please review.

Project coverage is 75.52%. Comparing base (9f6c09f) to head (1a5edaa).
Report is 1 commits behind head on feature/eq_analysis_tools.

Files Patch % Lines
bluemira/equilibria/plotting.py 11.97% 147 Missing ⚠️
bluemira/utilities/plot_tools.py 10.52% 17 Missing ⚠️
...quilibria/optimisation/problem/_minimal_current.py 37.50% 5 Missing ⚠️
bluemira/equilibria/diagnostics.py 92.85% 1 Missing ⚠️
Additional details and impacted files
@@                      Coverage Diff                      @@
##           feature/eq_analysis_tools    #3023      +/-   ##
=============================================================
- Coverage                      76.35%   75.52%   -0.83%     
=============================================================
  Files                            231      232       +1     
  Lines                          26652    26849     +197     
=============================================================
- Hits                           20351    20279      -72     
- Misses                          6301     6570     +269     

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

@clmould clmould force-pushed the clair/sh-plotting branch 2 times, most recently from 1170ed3 to cda23ac Compare February 22, 2024 15:57
Copy link

sonarcloud bot commented Feb 22, 2024

Quality Gate Passed Quality Gate passed

Issues
2 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@clmould clmould changed the title WIP: SH Plotting SH Plotting Apr 30, 2024
@clmould clmould marked this pull request as ready for review April 30, 2024 12:58
@clmould clmould requested review from a team as code owners April 30, 2024 12:58
@oliverfunk oliverfunk self-assigned this May 1, 2024
Copy link

sonarcloud bot commented May 2, 2024

Quality Gate Passed Quality Gate passed

Issues
3 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@je-cook je-cook added equilibria Tasks relating to the equilibria module display enhancement New feature or request labels May 2, 2024
@geograham
Copy link
Contributor

Hey, could you add a few lines to the description? I don't think the original issue fully covers the extra plotting features you have added.

@geograham
Copy link
Contributor

Currently we have the option to plot the 'full' psi or 'split' psi contributions. The alternative is to plot all three (total, plasma, coilset) along side each other. Pro = would remove a plotting option input. Con = might be a lot to look at at once during an optimisation. What do you (@clmould, @oliverfunk, @je-cook) think?

(This is something we had talked about before but not decided on).

@je-cook
Copy link
Contributor

je-cook commented May 9, 2024

What do you (@clmould, @oliverfunk, @je-cook) think?

I have no preference it more what people think is useful.

My only blocker on here atm is there is no test to cover 80% of this which is needed. Btw to view figures while testing you can use the --plotting-on pytest flag.

@je-cook je-cook force-pushed the develop branch 5 times, most recently from 5a50acb to 7574352 Compare May 15, 2024 08:13
@clmould clmould self-assigned this Jun 5, 2024
@oliverfunk oliverfunk marked this pull request as draft July 2, 2024 09:22
@je-cook je-cook changed the base branch from develop to feature/eq_analysis_tools August 16, 2024 10:03
@je-cook je-cook marked this pull request as ready for review August 16, 2024 10:48
Copy link

sonarcloud bot commented Aug 16, 2024

@je-cook je-cook merged commit a72188d into Fusion-Power-Plant-Framework:feature/eq_analysis_tools Aug 16, 2024
6 of 8 checks passed
je-cook added a commit that referenced this pull request Aug 29, 2024
* Create equilibrium comparison plotter class

- compare equilibrium object with reference equilibrium
- split psi plotting
- plotting percentage difference between current and reference equilibrium
- plot reference lcfs

* work on plots before work to update plot instead of producing new plots

* make subplots have the same axes limits

* remove unused argument in call to EquilibriumComparisonPlotter class in _minimal_current

* Add xz_plot_setup to plot_tools.py

* working on updating plot

* remove blank line after docstring

* trying to update colorbar (from stackexchange)

* colorbar updating instead of multiple colorbars

* add # noqa: BLE001 to Exception

* update typing

* pre-commit changes

* fix from github comment

* 🚨 Few missing imports

---------

Co-authored-by: james <james.cook1@ukaea.uk>
je-cook added a commit that referenced this pull request Sep 13, 2024
* Create equilibrium comparison plotter class

- compare equilibrium object with reference equilibrium
- split psi plotting
- plotting percentage difference between current and reference equilibrium
- plot reference lcfs

* work on plots before work to update plot instead of producing new plots

* make subplots have the same axes limits

* remove unused argument in call to EquilibriumComparisonPlotter class in _minimal_current

* Add xz_plot_setup to plot_tools.py

* working on updating plot

* remove blank line after docstring

* trying to update colorbar (from stackexchange)

* colorbar updating instead of multiple colorbars

* add # noqa: BLE001 to Exception

* update typing

* pre-commit changes

* fix from github comment

* 🚨 Few missing imports

---------

Co-authored-by: james <james.cook1@ukaea.uk>
geograham pushed a commit that referenced this pull request Oct 3, 2024
* Create equilibrium comparison plotter class

- compare equilibrium object with reference equilibrium
- split psi plotting
- plotting percentage difference between current and reference equilibrium
- plot reference lcfs

* work on plots before work to update plot instead of producing new plots

* make subplots have the same axes limits

* remove unused argument in call to EquilibriumComparisonPlotter class in _minimal_current

* Add xz_plot_setup to plot_tools.py

* working on updating plot

* remove blank line after docstring

* trying to update colorbar (from stackexchange)

* colorbar updating instead of multiple colorbars

* add # noqa: BLE001 to Exception

* update typing

* pre-commit changes

* fix from github comment

* 🚨 Few missing imports

---------

Co-authored-by: james <james.cook1@ukaea.uk>
je-cook added a commit that referenced this pull request Oct 10, 2024
* Create equilibrium comparison plotter class

- compare equilibrium object with reference equilibrium
- split psi plotting
- plotting percentage difference between current and reference equilibrium
- plot reference lcfs

* work on plots before work to update plot instead of producing new plots

* make subplots have the same axes limits

* remove unused argument in call to EquilibriumComparisonPlotter class in _minimal_current

* Add xz_plot_setup to plot_tools.py

* working on updating plot

* remove blank line after docstring

* trying to update colorbar (from stackexchange)

* colorbar updating instead of multiple colorbars

* add # noqa: BLE001 to Exception

* update typing

* pre-commit changes

* fix from github comment

* 🚨 Few missing imports

---------

Co-authored-by: james <james.cook1@ukaea.uk>
je-cook added a commit that referenced this pull request Oct 21, 2024
* Create equilibrium comparison plotter class

- compare equilibrium object with reference equilibrium
- split psi plotting
- plotting percentage difference between current and reference equilibrium
- plot reference lcfs

* work on plots before work to update plot instead of producing new plots

* make subplots have the same axes limits

* remove unused argument in call to EquilibriumComparisonPlotter class in _minimal_current

* Add xz_plot_setup to plot_tools.py

* working on updating plot

* remove blank line after docstring

* trying to update colorbar (from stackexchange)

* colorbar updating instead of multiple colorbars

* add # noqa: BLE001 to Exception

* update typing

* pre-commit changes

* fix from github comment

* 🚨 Few missing imports

---------

Co-authored-by: james <james.cook1@ukaea.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
display 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.

New split psi plotting option
4 participants