Skip to content

Refactoring plot_proc.py for use in fusrr#2979

Merged
timothy-nunn merged 11 commits intomainfrom
cmould/updating-plot-proc
Jan 12, 2024
Merged

Refactoring plot_proc.py for use in fusrr#2979
timothy-nunn merged 11 commits intomainfrom
cmould/updating-plot-proc

Conversation

@clmould
Copy link
Copy Markdown
Collaborator

@clmould clmould commented Oct 24, 2023

Description

Refactoring plot_proc.py for use in fusrr. Parts of plot_proc were copied and pasted into fusrr so refactoring these parts into separate files to be accessed by both plot_proc and fusrr without anything being copied and pasted between the two. The parts being refactored here are functions for the plasma, tf coils, pf coils, cryostat, blanket, shield and vacuum vessel.
Also refactored function for the first wall and added first wall plotting into fusrr.

Checklist

I confirm that I have completed the following checks:

  • I have justified any large differences in the regression tests caused by this pull request in the comments.
  • I have added new tests where appropriate for the changes I have made.
  • If I have had to change any existing unit or integration tests, I have justified this change in the pull request comments.
  • If I have made documentation changes, I have checked they render correctly.
  • I have added documentation for my change, if appropriate.

@clmould clmould linked an issue Oct 24, 2023 that may be closed by this pull request
@clmould clmould self-assigned this Oct 24, 2023
@clmould clmould force-pushed the cmould/updating-plot-proc branch from e954d9c to a0aa88f Compare October 26, 2023 14:21
@clmould clmould force-pushed the cmould/updating-plot-proc branch from d655865 to e7eb63e Compare November 2, 2023 15:47
@clmould clmould changed the title Refactoring plot_proc.py Refactoring plot_proc.py for use in fusrr Nov 22, 2023
@clmould clmould requested a review from timothy-nunn December 5, 2023 11:05
@clmould clmould marked this pull request as ready for review December 5, 2023 11:06
@clmould clmould force-pushed the cmould/updating-plot-proc branch 2 times, most recently from 9ca7e21 to 50dec2a Compare December 5, 2023 11:16
@clmould clmould force-pushed the cmould/updating-plot-proc branch from 72a788e to 7ae6e6a Compare December 13, 2023 17:00
@clmould clmould force-pushed the cmould/updating-plot-proc branch from c20e0e6 to bf173b2 Compare December 14, 2023 11:03
@clmould clmould requested a review from jonmaddock December 14, 2023 14:39
@clmould clmould marked this pull request as draft December 19, 2023 15:22
@clmould clmould force-pushed the cmould/updating-plot-proc branch from 658219c to 9a5b4f6 Compare December 19, 2023 15:59
@oliverfunk
Copy link
Copy Markdown
Contributor

From my end, this LGTM!

@clmould clmould marked this pull request as ready for review December 20, 2023 11:39
@clmould clmould requested a review from timothy-nunn December 20, 2023 11:39
Copy link
Copy Markdown
Collaborator

@timothy-nunn timothy-nunn left a comment

Choose a reason for hiding this comment

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

It looks like a lot of comments, but it basically boils down to:

  • Clearing up exactly the types that are contained in the dataclasses and ensuring they have a well-defined API.
  • Discussing if consolidation of some of the dataclasses into one unified ArbitraryGeometry would make sense (this is not me saying we should do that, it is something for us to discuss)
  • Clarifying the names of some functions that are called 'plot...' but dont seem to do any plotting.
  • Clarifying the docstrings (types and descriptions) on functions that have lots of returns. This is a complicated sub-package and it will get confusing what does and returns what without more documentation, and I want using this to be as easy as possible for any user of PROCESS.
  • Variable naming to, again, aide in clarity and understanding
  • Some other minor comments about fudge factors. I see they were in old plot_proc so it might a case of you asking one of the modelers.

Other than that, the sub-package is laid out well, docstring format is all correct, and plot_proc is looking a lot less busy!

Comment thread process/geometry/blanket_geometry.py Outdated
Comment thread process/geometry/blanket_geometry.py Outdated
Comment thread process/geometry/blanket_geometry.py Outdated
Comment thread process/geometry/blanket_geometry.py Outdated
Comment thread process/geometry/cryostat_geometry.py Outdated
Comment thread process/geometry/vacuum_vessel_geometry.py Outdated
Comment thread process/geometry/vacuum_vessel_geometry.py Outdated
Comment thread process/geometry/vacuum_vessel_geometry.py Outdated
Comment thread process/geometry/vacuum_vessel_geometry.py Outdated
Comment thread process/geometry/vacuum_vessel_geometry.py Outdated
- add arbitrary geometry class
- remove i_single_null < 0 option in plasma_geometry.py
- add better descriptions for RectangleGeometry objects
@clmould clmould requested a review from timothy-nunn January 11, 2024 15:41
Copy link
Copy Markdown
Collaborator

@timothy-nunn timothy-nunn left a comment

Choose a reason for hiding this comment

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

I am happy with the code. Could you maybe comment a before and after from plotproc of the large tokamak just to show nothing has changed?

@clmould
Copy link
Copy Markdown
Collaborator Author

clmould commented Jan 12, 2024

plot_proc output for large tokamak before:
plot_proc_2

after:
image

@timothy-nunn
Copy link
Copy Markdown
Collaborator

Thanks Clair, all looks good to me! Thanks for your work on this!

@timothy-nunn timothy-nunn merged commit 2619ad3 into main Jan 12, 2024
@timothy-nunn timothy-nunn deleted the cmould/updating-plot-proc branch January 12, 2024 14:24
chris-ashe pushed a commit that referenced this pull request Apr 22, 2024
* refactoring plot_proc adding dataclass

* removed todo comments

* update variable description shldith in large_tokamak_IN.DAT

* Added docstrings to refactored work

* refactor firstwall plotting

* restructure blanket and first wall geometries

* improve blanket and firstwall plotting

* rename vars

* improve vac vessel and shield plotting

* initial changes based on PR review comments

* make changes based on review comments

- add arbitrary geometry class
- remove i_single_null < 0 option in plasma_geometry.py
- add better descriptions for RectangleGeometry objects
chris-ashe pushed a commit that referenced this pull request Apr 22, 2024
* refactoring plot_proc adding dataclass

* removed todo comments

* update variable description shldith in large_tokamak_IN.DAT

* Added docstrings to refactored work

* refactor firstwall plotting

* restructure blanket and first wall geometries

* improve blanket and firstwall plotting

* rename vars

* improve vac vessel and shield plotting

* initial changes based on PR review comments

* make changes based on review comments

- add arbitrary geometry class
- remove i_single_null < 0 option in plasma_geometry.py
- add better descriptions for RectangleGeometry objects
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.

refactor plot_proc for use in fusrr

4 participants