8000 ⚡ Tidy `superconductors.py` part 1 by chris-ashe · Pull Request #3657 · ukaea/PROCESS · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

⚡ Tidy superconductors.py part 1 #3657

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

Merged
merged 7 commits into from
May 13, 2025
Merged

⚡ Tidy superconductors.py part 1 #3657

merged 7 commits into from
May 13, 2025

Conversation

chris-ashe
Copy link
Collaborator
@chris-ashe chris-ashe commented May 12, 2025

This pull request introduces significant updates to the documentation, codebase, and testing infrastructure for the modeling of superconductors, specifically focusing on the Western Superconducting Nb₃Sn critical surface model. The changes include the addition of detailed documentation, the replacement of an older method (wstsc) with a new implementation (western_superconducting_nb3sn), and the integration of this new implementation across various modules and tests.

Documentation Enhancements:

  • Added a detailed section in superconductors.md explaining the Bottura scaling model and its application to Western Superconducting Nb₃Sn, including equations, parameter definitions, and references.
  • Included a new interactive plot and static image of the critical current density surface for Western Superconducting Nb₃Sn, along with a description of its parameters.

Code Updates:

  • Replaced the wstsc function with the new western_superconducting_nb3sn function in process/superconductors.py. The new implementation improves readability, adds type annotations, and provides detailed docstrings.
  • Updated all references to wstsc across the codebase to use western_superconducting_nb3sn, ensuring consistency in pfcoil.py, stellarator.py, superconducting_tf_coil.py, and superconductors.py.

Visualization:

  • Added a new Python script, plotting_scripts/western_nb3sn_critical_surface.py, to generate both static and interactive visualizations of the critical current density surface for Western Superconducting Nb₃Sn. The script uses Matplotlib and Plotly for visualization.

Navigation and Testing:

  • Updated the navigation in mkdocs.yml to include the new superconductors documentation.
  • Updated the unit test for wstsc to validate the new western_superconducting_nb3sn function, ensuring the correctness of the updated implementation.

Checklist

I confirm that I have completed the following checks:

  • My changes follow the PROCESS style guide
  • 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.

@chris-ashe chris-ashe self-assigned this May 12, 2025
@chris-ashe chris-ashe added the Documentation Improvements or additions to documentation label May 12, 2025
@chris-ashe chris-ashe requested a review from j-a-foster May 12, 2025 13:25
@codecov-commenter
Copy link
codecov-commenter commented May 12, 2025

Codecov Report

Attention: Patch coverage is 74.35897% with 10 lines in your changes missing coverage. Please review.

Project coverage is 36.23%. Comparing base (e32ef54) to head (95f9d57).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
process/superconductors.py 77.77% 8 Missing ⚠️
process/pfcoil.py 0.00% 1 Missing ⚠️
process/stellarator.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3657   +/-   ##
=======================================
  Coverage   36.23%   36.23%           
=======================================
  Files          88       88           
  Lines       22191    22191           
=======================================
  Hits         8041     8041           
  Misses      14150    14150           

☔ 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.

@chris-ashe chris-ashe force-pushed the tidy_superconductors_1 branch from acb3037 to 98a54d9 Compare May 12, 2025 13:30
Copy link
Collaborator
@j-a-foster j-a-foster left a comment

Choose a reason for hiding this comment

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

Happy with the docs. Like the interactive plot!

Copy link
Collaborator
@j-a-foster j-a-foster left a comment

Choose a reason for hiding this comment

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

Also happy with the code changes.

@chris-ashe chris-ashe requested a review from j-a-foster May 13, 2025 12:27
Copy link
Collaborator
@j-a-foster j-a-foster left a comment

Choose a reason for hiding this comment

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

Reapproving after pre-commit fixes.

@chris-ashe chris-ashe merged commit 519e881 into main May 13, 2025
18 checks passed
@chris-ashe chris-ashe deleted the < 8000 span data-view-component="true" class="css-truncate css-truncate-target width-fit"> tidy_superconductors_1 branch May 13, 2025 13:33
ym1906 pushed a commit that referenced this pull request May 16, 2025
* 📝 Add Superconductors documentation page to navigation

* 📝 Re-factor bottura scaling and add equations to docs

* 📝 Enhance documentation for Bottura scaling function with detailed parameterization and strain function notes

* 📝 Update WST Nb3Sn critical surface model implementation with enhanced documentation and parameter definitions

* ♻️ Refactor superconductors function names to `western_superconducting_nb3sn` for clarity and consistency

* 🎨 Add critical surface plot for Western Superconducting Ltd. Nb3Sn and update documentation

* Implement code changes to enhance functionality and improve performance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements or additions to documentation Refactor Superconductors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0