Skip to content

Add AvailabilityModel enum for plant availability models - #4468

Open
chris-ashe wants to merge 2 commits into
mainfrom
add_avail_model_enum
Open

Add AvailabilityModel enum for plant availability models#4468
chris-ashe wants to merge 2 commits into
mainfrom
add_avail_model_enum

Conversation

@chris-ashe

Copy link
Copy Markdown
Collaborator

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 requested a review from a team as a code owner July 25, 2026 22:14
@codecov-commenter

codecov-commenter commented Jul 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.83333% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.66%. Comparing base (808481e) to head (e720c8e).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
process/models/availability.py 75.00% 5 Missing ⚠️
process/core/scan.py 50.00% 1 Missing ⚠️
process/core/solver/objectives.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4468      +/-   ##
==========================================
+ Coverage   48.64%   48.66%   +0.01%     
==========================================
  Files         151      151              
  Lines       29704    29721      +17     
==========================================
+ Hits        14449    14463      +14     
- Misses      15255    15258       +3     

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

@timothy-nunn timothy-nunn self-assigned this Jul 27, 2026

@timothy-nunn timothy-nunn 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.

I believe you are still missing some places where the switch value is checked:

Image Image

@chris-ashe
chris-ashe force-pushed the add_avail_model_enum branch from 501a28a to e720c8e Compare July 27, 2026 12:53
@chris-ashe
chris-ashe requested a review from timothy-nunn July 27, 2026 12:53

@timothy-nunn timothy-nunn 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.

Couple of questions about code that seems might be outdated and from when we only had 1 availability model. Otherwise happy with code changes you have made.

Comment thread process/core/scan.py
case 20:
self.data.constraints.t_burn_min = swp[iscn - 1]
case 22:
if self.data.costs.i_plant_availability == 1:

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.

Is there a reason this only applies to i_plant_availability == 1? I find it more likely that this should be checking AvailabilityModel(self.data.costs.i_plant_availability) != AvailabilityModel.INPUT... I.e. don't scan if f_t_plant_available is not being input because the scanned value will get overwritten by the model

Comment on lines +74 to +77
if (
AvailabilityModel(data.costs.i_plant_availability)
!= AvailabilityModel.WARD_TAYLOR
):

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.

Similar question, is this correct anymore. Shouldn't you be able to optimise if using model 1, 2, or 3?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants