Skip to content

FireWeatherIndexBase plugin - change Error to Warning for input values outside expected ranges#2301

Merged
mo-robert-purvis merged 5 commits intometoppv:masterfrom
mo-robert-purvis:EPPT-3118-FSI-plugin-change-Error-to-Warning-for-out-of-range-inputs
Feb 12, 2026
Merged

FireWeatherIndexBase plugin - change Error to Warning for input values outside expected ranges#2301
mo-robert-purvis merged 5 commits intometoppv:masterfrom
mo-robert-purvis:EPPT-3118-FSI-plugin-change-Error-to-Warning-for-out-of-range-inputs

Conversation

@mo-robert-purvis
Copy link
Contributor

@mo-robert-purvis mo-robert-purvis commented Feb 10, 2026

Description

In the FireWeatherIndexBase there are value range checks made on the different components used to calculate the Fire Severity Index (FSI). It was found during testing that one of these ranges is too restrictive for real values from the data cache used for tests. The code in one place emits a warning message about this, but in another place it throws a ValueError which causes the FSI calculation to fail.

Given that the warning is sufficient, and that the ranges against which the input data is checked are arbitrary, and could be changed, it is best to change the ValueError into a Warning message so that the FSI can be calculated successfully.

Testing

  • Unit test updated to check for warning emitted if values are outside expected range

@mo-robert-purvis mo-robert-purvis marked this pull request as draft February 10, 2026 11:30
@mo-robert-purvis mo-robert-purvis marked this pull request as ready for review February 10, 2026 11:58
Copy link
Contributor

@ryan-cocking-mo ryan-cocking-mo left a comment

Choose a reason for hiding this comment

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

This looks sensible to me.

Co-authored-by: ryan-cocking-mo <ryan.cocking@metoffice.gov.uk>
@robertplatt-mo robertplatt-mo self-requested a review February 11, 2026 15:30
Copy link
Contributor

@robertplatt-mo robertplatt-mo left a comment

Choose a reason for hiding this comment

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

@mo-robert-purvis Tiny nitpick on the warning being in raises rather than Warns

Copy link
Contributor

@robertplatt-mo robertplatt-mo left a comment

Choose a reason for hiding this comment

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

Thanks! All approved

@mo-robert-purvis mo-robert-purvis merged commit c792a41 into metoppv:master Feb 12, 2026
7 checks passed
@mo-robert-purvis mo-robert-purvis deleted the EPPT-3118-FSI-plugin-change-Error-to-Warning-for-out-of-range-inputs branch February 12, 2026 09:33
gavinevans added a commit to gavinevans/improver that referenced this pull request Mar 5, 2026
…sformation

* upstream/master:
  EPPT3121 Add clip option to fine fuel moisture content calculation (metoppv#2317)
  Edit CLI docstring. (metoppv#2318)
  Update WeightAndBlend.process() to use *cubes and as_cubelist (metoppv#2314)
  Lighting in vicinity cell_method alignment for master (metoppv#2296)
  Add quantile mapping and associated tests (metoppv#2264)
  MOBT-1069: Using adjacent validity times in SAMOS (metoppv#2310)
  Mobt991 ApplySAMOS plugin distribution fix (metoppv#2311)
  Add attribute to realization clustering to record source realizations (metoppv#2305)
  MOBT-1070: Time-zone safe handling of time point extraction in SAMOS calibration (metoppv#2306)
  Set START_DATE_DICT to outside largest lag period to silence warnings (metoppv#2304)
  Eppt2408 implement initialisation process for fire severity iterative parameters (metoppv#2302)
  FireWeatherIndexBase plugin - change Error to Warning for input values outside expected ranges (metoppv#2301)
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.

3 participants