Skip to content

Conversation

@mo-philrelton
Copy link
Contributor

EPPT-2586

In order to calculate the daily Fire Severity Index, we require a Drought Code calculation. This class, and associated tests, partially reproduce the Canadian Forest Fire Weather Index from van Wagner and Pickett's 1985 FORTRAN implementation

Testing:

  • Ran tests and they passed OK
  • Added new tests for the new feature(s)

@codecov
Copy link

codecov bot commented Nov 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (EPPT_2411_fire_severity_index_workflow_development@a2fcead). Learn more about missing BASE report.

Additional details and impacted files
@@                                  Coverage Diff                                  @@
##             EPPT_2411_fire_severity_index_workflow_development    #2251   +/-   ##
=====================================================================================
  Coverage                                                      ?   95.26%           
=====================================================================================
  Files                                                         ?      152           
  Lines                                                         ?    15389           
  Branches                                                      ?        0           
=====================================================================================
  Hits                                                          ?    14660           
  Misses                                                        ?      729           
  Partials                                                      ?        0           

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

@mo-philrelton mo-philrelton changed the base branch from master to EPPT_2411_fire_severity_index_workflow_development December 1, 2025 10:22
Copy link

@RDP-mo RDP-mo left a comment

Choose a reason for hiding this comment

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

I've reviewed the commits 1, 2 and 4 - I'll give 3 and 5 another look tomorrow but you may as well have the comments so far

@RDP-mo
Copy link

RDP-mo commented Dec 18, 2025

On the ABC refactor - it looks like process on the new base class now uses _make_output_cube instead which seems to be an improvement on the _make_dc_cube. Took me a little while to see but seems sensible.

The thing I'd mention is I think ideally the FireWeatherIndexBase._calculate abstract method should raise a NotImplementedError rather than simply pass. Otherwise the docstring should be adjusted from 'must' to 'should'.

Main point I'd make is that the review would have been easier if the creation of the base class has accompanied the removal of the base class elements from DroughtCode.

@RDP-mo
Copy link

RDP-mo commented Dec 18, 2025

@mo-philrelton I'm done reviewing now - I'll assign back to you most comments are somewhat optional or fairly nitty. I haven't run the tests yet just because I haven't got improver set up to do so yet so I will do that after the stand so I have it for next time - any issues I'll probably come to you.

@RDP-mo
Copy link

RDP-mo commented Dec 19, 2025

Thanks I'm happy with these changes

@mo-philrelton
Copy link
Contributor Author

The thing I'd mention is I think ideally the FireWeatherIndexBase._calculate abstract method should raise a NotImplementedError rather than simply pass. Otherwise the docstring should be adjusted from 'must' to 'should'.

I agree with this, that is the clearest way to do this. I have now made the switch to the error raising implementation of _calculate.

Obviously all other reviews will still have this pass method, but I can fix this when performing future rebases. Just watch out for it in the other PRs.

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.

Minor comments on some docstrings but otherwise great.

Comment on lines +149 to +152
potential_evapotranspiration (np.ndarray): The potential evapotranspiration.

Returns:
np.ndarray: The calculated DC value.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
potential_evapotranspiration (np.ndarray): The potential evapotranspiration.
Returns:
np.ndarray: The calculated DC value.
potential_evapotranspiration: The potential evapotranspiration.
Returns:
The calculated DC value.

Type not required in docstring as it is expressed in type hint.

From Van Wagner and Pickett (1985), Pages 6-7: Equation 22, Steps 3 & 4.

Returns:
np.ndarray: The potential evapotranspiration value.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
np.ndarray: The potential evapotranspiration value.
The potential evapotranspiration value.

Type not required in docstring.

"""Calculate the Drought Code (DC).

Returns:
np.ndarray: The calculated DC values for the current day.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
np.ndarray: The calculated DC values for the current day.
The calculated DC values for the current day.

Type not required in docstring.

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