Skip to content

Added variable descriptions to dataclass variables - #4554

Open
j-a-foster wants to merge 35 commits into
mainfrom
4513-missing-variable-descriptions-in-dataclasses-in-superconductingpy
Open

Added variable descriptions to dataclass variables#4554
j-a-foster wants to merge 35 commits into
mainfrom
4513-missing-variable-descriptions-in-dataclasses-in-superconductingpy

Conversation

@j-a-foster

@j-a-foster j-a-foster commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Description

Missing variable desriptions have been added to variables in superconducting.py data classes.

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.

@j-a-foster
j-a-foster requested a review from a team as a code owner August 25, 2026 12:34
@clmould clmould self-assigned this Aug 25, 2026
@codecov-commenter

codecov-commenter commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.14894% with 49 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.94%. Comparing base (a9358cc) to head (48720bd).
⚠️ Report is 26 commits behind head on main.

Files with missing lines Patch % Lines
process/models/availability.py 35.08% 37 Missing ⚠️
process/models/physics/scrape_off_layer.py 42.85% 8 Missing ⚠️
process/core/init.py 50.00% 2 Missing ⚠️
process/core/io/plot/summary.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4554      +/-   ##
==========================================
+ Coverage   49.46%   49.94%   +0.48%     
==========================================
  Files         150      151       +1     
  Lines       30069    29906     -163     
==========================================
+ Hits        14874    14938      +64     
+ Misses      15195    14968     -227     

☔ View full report in Codecov by Harness.
📢 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.

@mkovari

mkovari commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

These seem to be copies of the descriptions in process/data_structure/tfcoil_variables.py. Did you intend to duplicate these descriptions without deleting the originals?

@j-a-foster

Copy link
Copy Markdown
Collaborator Author

These seem to be copies of the descriptions in process/data_structure/tfcoil_variables.py. Did you intend to duplicate these descriptions without deleting the originals?

I've replicated what's been done for other dataclasses in the same file, they have descriptions which match or summarise what's in the corresponding _variables.py file. j_tf_wp_critical is one such variable that has a description in both superconducting.py and tfcoil_variables.py. Unless I'm missing something, I think they are supposed to be in both places?

@clmould

clmould commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

These seem to be copies of the descriptions in process/data_structure/tfcoil_variables.py. Did you intend to duplicate these descriptions without deleting the originals?

I've replicated what's been done for other dataclasses in the same file, they have descriptions which match or summarise what's in the corresponding _variables.py file. j_tf_wp_critical is one such variable that has a description in both superconducting.py and tfcoil_variables.py. Unless I'm missing something, I think they are supposed to be in both places?

Yea the variables in these dataclasses need descriptions, as well as in the data_structure files - this way users can see the descriptions for the dataclass variables without having to search through data_structure files, but we still need the descriptions in the data structure for the dictionaries

@clmould
clmould requested a review from chris-ashe August 27, 2026 11:19

@chris-ashe chris-ashe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Just a few very small changes for each, can I ask that the global vars are done to match the ones here. Cant recommend changes on those files

Comment thread process/models/tfcoil/superconducting.py
Comment thread process/models/tfcoil/superconducting.py Outdated
Comment thread process/models/tfcoil/superconducting.py Outdated
Comment thread process/models/tfcoil/superconducting.py Outdated
Comment thread process/models/tfcoil/superconducting.py
Comment thread process/models/tfcoil/superconducting.py Outdated
Comment thread process/models/tfcoil/superconducting.py Outdated
Comment thread process/models/tfcoil/superconducting.py Outdated
Comment thread process/models/tfcoil/superconducting.py Outdated
Comment thread process/models/tfcoil/superconducting.py Outdated
j-a-foster and others added 20 commits September 8, 2026 10:36
* Move data structure to its own class

* Fix pre-commit failures

* Create data_structure submodule in core
* Reject zero-thickness superconducting TF at input validation

Build.calculate_radial_build only derives dr_tf_inboard from the
winding pack and case thicknesses when dr_tf_wp_with_insulation
(ixc = 140) is an iteration variable. If a user supplies the winding
pack thickness as a plain input instead, dr_tf_inboard silently stays
at its default of 0: the TF coil vanishes from the radial build and the
run fails far downstream with unexplained radial-build inconsistency
and multi-GPa TF stresses.

Add a check_process validation that a superconducting TF has a positive
dr_tf_inboard when neither ixc = 13 nor ixc = 140 is active, with an
actionable message. Stellarators (which calculate dr_tf_inboard during
the model run) and IFE are excluded.

Test-suite change, per CONTRIBUTING: the parser tests in
tests/unit/core/test_input.py run init_process on minimal input
snippets and relied on config validation not examining the TF
geometry; their fixture scaffold now sets a valid dr_tf_inboard.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Address review: check all conductor models, no ixc 13 exemption, parser tests skip validation

- The check no longer exempts ixc = 13: the input value seeds the first
  model evaluation either way; an exactly-zero value was only caught later
  by the generic iteration-variable check, and a negative value was not
  caught at all (the 1/value scaling in load_iteration_variables inverts
  the variable's bounds). Rejecting at input validation covers both with
  an actionable message.
- The error message drops "or use ixc = 13" accordingly.
- The conductor-model condition is removed: dr_tf_inboard is only derived
  under ixc = 140 or for stellarators, neither of which depends on
  i_tf_sup, so resistive TF coils had the same silent zero-thickness path.
- test_input.py keeps its scaffold unchanged and instead disables
  check_process with an autouse monkeypatch fixture, as suggested; the
  parser tests no longer carry TF geometry.
- Tests updated: resistive zero-thickness now rejected (plus an accepted
  positive-thickness case), and ixc = 13 with zero or negative input is
  rejected.

Unit suite 855 passed / 4 skipped; integration 21 passed / 1 skipped
(all shipped regression inputs pass the widened check). Rebased onto
main (includes #4553).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Parametrize non-positive thickness test; apply fixture docstring suggestion

Also corrects the test docstring: a negative dr_tf_inboard cannot come
from an input file (the parser bounds it to [0, 10]); check_process guards
the data structure however it was populated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* DataStructure module changed

* Re-order imports

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* availability refactor

* vertical build refactor

* divertor and radial build refactor

* missed return

* oops

* Apply suggestions from code review

Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>

* code review

* Update process/models/build.py

* Update process/models/build.py

* Update process/models/build.py

* fix indentation from github

---------

Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>
* Bump ruff from 0.16.4 to 0.16.5

Bumps [ruff](https://github.com/astral-sh/ruff) from 0.16.4 to 0.16.5.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@0.16.4...0.16.5)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.16.5
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* update ruff

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: james <81617086+je-cook@users.noreply.github.com>
* Use tabulate to output vertical build table

* Use tabulate to output radial build table

* Format floats to scientific notation
* Change set_filenames in single_run fixture to use temp_input_file instead of tmp_path

* Update tests/unit/test_main.py

Co-authored-by: Timothy <75321887+timothy-nunn@users.noreply.github.com>

---------

Co-authored-by: Timothy <75321887+timothy-nunn@users.noreply.github.com>
* move data_structure_dicts, obsolete_variables and variable_metadata to process/core/data_structure

* rename data_structure_dicts.py to dicts.py
* Support a local repository of regression test assets

* Improve docs and fix spelling
* Add method to calculate Eich 2011 JET SOL power decay length

* Add Eich 2011 JET model for power decay length calculation and update related documentation

* Add Eich 2011 JET power decay length variables to PhysicsData class

* Add Eich 2011 JET power decay length calculations to ScrapeOffLayer model

* Add Eich 2011 JET + ASDEX Upgrade power decay length calculations and update related models

* Add tests for Eich 2011 JET and ASDEX Upgrade SOL power decay length calculations

* Add scaling information for type-I ELMy H-mode plasmas in documentation and model notes
* Write tracker CI job as hatch script

* Add run-tracker to hatch scripts
dallonby and others added 14 commits September 8, 2026 11:09
The a > c branch of surface_stress_intensity_factor computed the G22
coefficient as 0.14*(c/a)*1.5 where the published Newman-Raju equation
(and the sibling a <= c branch) uses 0.14*(c/a)**1.5 — multiplication
in place of exponentiation.

Currently benign in outputs because bending_stress is hardcoded to zero
so H2 never enters the stress intensity factor, but wrong the moment
bending is enabled. Also adds the previously-missing test coverage of
the a > c branch, with expected K values computed independently from
the Newman-Raju equations (the existing tests only exercised a < c at
phi = pi/2).

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* Clarify peak b field error message

* Update process/models/pfcoil.py

Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>

* Update process/models/pfcoil.py

Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>

---------

Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>
Bumps [actions/deploy-pages](https://github.com/actions/deploy-pages) from 5.0.0 to 5.0.1.
- [Release notes](https://github.com/actions/deploy-pages/releases)
- [Commits](actions/deploy-pages@cd2ce8f...368f825)

---
updated-dependencies:
- dependency-name: actions/deploy-pages
  dependency-version: 5.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Updates the requirements on [platformdirs](https://github.com/tox-dev/platformdirs) to permit the latest version.
- [Release notes](https://github.com/tox-dev/platformdirs/releases)
- [Changelog](https://github.com/tox-dev/platformdirs/blob/main/docs/changelog.rst)
- [Commits](tox-dev/platformdirs@4.10.0...4.11.7)

---
updated-dependencies:
- dependency-name: platformdirs
  dependency-version: 4.11.7
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Bump ruff from 0.16.5 to 0.16.6

Bumps [ruff](https://github.com/astral-sh/ruff) from 0.16.5 to 0.16.6.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@0.16.5...0.16.6)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.16.6
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* update pre-commit

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Clair Mould <86794332+clmould@users.noreply.github.com>
* Update plotly requirement from <7,>=5.15 to >=7.0.0,<8

Updates the requirements on [plotly](https://github.com/plotly/plotly.py) to permit the latest version.
- [Release notes](https://github.com/plotly/plotly.py/releases)
- [Changelog](https://github.com/plotly/plotly.py/blob/main/CHANGELOG.md)
- [Commits](plotly/plotly.py@v5.15.0...v7.0.0)

---
updated-dependencies:
- dependency-name: plotly
  dependency-version: 7.0.0
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update pyproject.toml

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>
* Move data structure to its own class

* Fix pre-commit failures

* Create data_structure submodule in core
* availability refactor

* vertical build refactor

* divertor and radial build refactor

* missed return

* oops

* Apply suggestions from code review

Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>

* code review

* Update process/models/build.py

* Update process/models/build.py

* Update process/models/build.py

* fix indentation from github

---------

Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>
* Bump ruff from 0.16.4 to 0.16.5

Bumps [ruff](https://github.com/astral-sh/ruff) from 0.16.4 to 0.16.5.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@0.16.4...0.16.5)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.16.5
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* update ruff

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: james <81617086+je-cook@users.noreply.github.com>
* Use tabulate to output vertical build table

* Use tabulate to output radial build table

* Format floats to scientific notation
* move data_structure_dicts, obsolete_variables and variable_metadata to process/core/data_structure

* rename data_structure_dicts.py to dicts.py
* Bump ruff from 0.16.5 to 0.16.6

Bumps [ruff](https://github.com/astral-sh/ruff) from 0.16.5 to 0.16.6.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@0.16.5...0.16.6)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.16.6
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* update pre-commit

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Clair Mould <86794332+clmould@users.noreply.github.com>
* Validate the divertor count before the build calculations execute

* Update processvalueerror expression

* added test to check n_divertors validation is working
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.

Missing variable descriptions in dataclasses in superconducting.py