Skip to content

♻️ Refactor Availability module part1#3942

Merged
timothy-nunn merged 15 commits intomainfrom
refactor_avail_1
Nov 18, 2025
Merged

♻️ Refactor Availability module part1#3942
timothy-nunn merged 15 commits intomainfrom
refactor_avail_1

Conversation

@chris-ashe
Copy link
Copy Markdown
Collaborator

@chris-ashe chris-ashe commented Oct 20, 2025

This pull request updates the naming conventions and documentation for the plant availability models and related variables to improve clarity and consistency across the codebase, documentation, and example data files. The changes also introduce more detailed documentation for each availability model and its associated calculations.

🔄 Renames

  • iavail -> i_plant_availability
  • tbktrepl -> t_blkt_replace_yrs
  • tdivrepl -> t_div_replace_yrs
  • t_operation -> t_plant_operational_total_yrs
  • cfactr -> f_t_plant_available
  • cdrlife -> life_hcd_fpy
  • tlife -> life_plant
  • divlife -> life_div_fpy
  • divlife_cal -> life_div

Documentation improvements and variable renaming:

  • Renamed the switch for selecting the plant availability model from iavail to i_plant_availability, and the overall plant availability factor from cfactr to f_t_plant_available throughout documentation/eng-models/plant-availability.md, documentation/io/python-lib-guide.md, and all example data files. [1] [2] [3] [4] [5] [6]
  • Updated variable names for component lifetimes and other outputs in example data files, such as divlife to life_div_fpyv_fpy, cdrlife to life_hcd_fpy, tlife to life_plant, and cfactr to f_t_plant_available. [1] [2] [3] [4] [5] [6] [7] [8]
  • Expanded and clarified the documentation in plant-availability.md to describe the Taylor-Ward, Morris, and Spherical Tokamak (ST) models, including their input parameters, calculation methods, and relevant equations. New sections detail planned and unplanned unavailability calculations for various subsystems. [1] [2] [3]
  • Added section dividers and improved formatting for model-specific documentation, making it easier to navigate and understand the calculation flow and dependencies between variables. [1] [2] [3]
  • Updated references and notes in the documentation to match the new variable names and provide clearer context for users. [1] [2]

These changes ensure consistent naming, clearer documentation, and easier maintenance and extension of the plant availability models.## Description

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 Oct 20, 2025
@chris-ashe chris-ashe changed the title ♻️ Refactor Availability module ♻️ Refactor Availability module PART 1 Oct 21, 2025
@chris-ashe chris-ashe changed the title ♻️ Refactor Availability module PART 1 ♻️ Refactor Availability module part1 Oct 21, 2025
@chris-ashe chris-ashe marked this pull request as ready for review October 29, 2025 09:32
@chris-ashe chris-ashe requested review from kj5248 and removed request for timothy-nunn November 3, 2025 09:34
Comment thread examples/data/large_tokamak_IN.DAT Outdated
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Nov 3, 2025

Codecov Report

❌ Patch coverage is 76.99115% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.98%. Comparing base (cc15436) to head (bffa82c).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
process/availability.py 79.68% 13 Missing ⚠️
process/costs.py 14.28% 6 Missing ⚠️
process/objectives.py 0.00% 3 Missing ⚠️
process/scan.py 0.00% 3 Missing ⚠️
process/ife.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3942      +/-   ##
==========================================
- Coverage   46.03%   45.98%   -0.05%     
==========================================
  Files         123      123              
  Lines       28970    29074     +104     
==========================================
+ Hits        13335    13371      +36     
- Misses      15635    15703      +68     

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

Copy link
Copy Markdown
Collaborator

@kj5248 kj5248 left a comment

Choose a reason for hiding this comment

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

Just a couple more missed

Comment thread examples/data/scan_example_file_IN.DAT Outdated
Comment thread mkdocs.yml Outdated
Comment thread process/io/obsolete_vars.py
Comment thread tests/integration/data/large_tokamak_MFILE.DAT Outdated
Comment thread tests/unit/data/large_tokamak_MFILE.DAT Outdated
Copy link
Copy Markdown
Collaborator

@kj5248 kj5248 left a comment

Choose a reason for hiding this comment

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

All seems good now just needs to pass tests

Copy link
Copy Markdown
Collaborator

@kj5248 kj5248 left a comment

Choose a reason for hiding this comment

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

I have re-approved this. Good catch on i_plant_availabilityt_availability, I had only checked for the old still being around in the big mfiles

Copy link
Copy Markdown
Collaborator

@kj5248 kj5248 left a comment

Choose a reason for hiding this comment

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

Just noticed this on double check

Comment thread examples/data/scan_MFILE.DAT Outdated
Comment thread examples/data/scan_MFILE.DAT Outdated
@chris-ashe chris-ashe force-pushed the refactor_avail_1 branch 5 times, most recently from f19288d to 1646e98 Compare November 18, 2025 13:57
Copy link
Copy Markdown
Collaborator

@kj5248 kj5248 left a comment

Choose a reason for hiding this comment

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

Two got missed. Also noticed a file disappeared from examples: examples/data/scan_MFILE.DAT? Not sure if that is intentional.

Comment thread examples/data/large_tokamak_3_MFILE.DAT Outdated
Comment thread examples/data/large_tokamak_4_MFILE.DAT Outdated
@timothy-nunn timothy-nunn merged commit aa129eb into main Nov 18, 2025
14 of 18 checks passed
@timothy-nunn timothy-nunn deleted the refactor_avail_1 branch November 18, 2025 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants