Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature drought metrics climatology #12

Merged
merged 22 commits into from
Dec 1, 2023

Conversation

dschlaep
Copy link
Member

  • metric_FrostDaysAtNeg5C() returns now NAs instead of +/-Inf for years
    without a frost event.
  • New metrics functions to extract "EcologicalDroughtMetrics2023", i.e.,
    • metric_EcologicalDroughtMetrics2023_annual() returns annual time series
    • metric_EcologicalDroughtMetrics2023_annualClim() returns climatologies
      (summaries across years).

dschlaep added 21 commits July 12, 2023 11:15
…dedicated functions

- new (internal) `calc_extreme_funNday()`, `calc_condition()`, `calc_durations_consecutive_periods()`, `calc_extreme_value_consecutive_periods()`

- use new functions where appropriate: `calc_new_yearly_aggregations()`, `calc_DSI()`
- documentation updated with published reference
- extract all metrics used by Chenoweth et al. 2023

- `metric_EcologicalDroughtMetrics2023_annual()` returns annual time series of these metrics
- `metric_EcologicalDroughtMetrics2023_annualClim()` returns climatologies (summaries across years) of these metrics

- test reference values for rSOILWAT2 v5.0 and v5.1 (but not yet v6.0)
- `calc_frost_doy()` returns +/-Inf if there was no frost event; "EcologicalDroughtMetrics2023" assumes NA for no frost events --> convert non-finite values to NA
- CWD values were previously but incorrectly multiplied by 10
-> now they return the correct value in mm
- recruitment doesn't occur every year; WDD during the recruitment period in year when it doesn't occur is NA
-> metrics for which we calculate frequency, need to be calculated only over finite values
…t of integer vectors

- previously, the returned object may have not been a list or may have contained elements with real-typed 0s or logical-typed NAs instead of integer-typed objects
- update reference data objects
-> +/- Inf values changed to NA
- several commits fixed EcologicalDroughtMetrics2023 metrics and output:
* commit e13d743 "Fix frost in "EcologicalDroughtMetrics2023""
* commit e9c782f "Fix CWD in "EcologicalDroughtMetrics2023""
* commit 011e3be "Fix recruitment-WDD in "EcologicalDroughtMetrics2023""
* commit 57fb582 "`calc_durations_consecutive_periods()` returns now consistently a list of integer vectors"
- tests that run metrics and compare output to stored reference objects are now comparing values by variable (across time) instead of by time step (across all variables)
-> comparing values by variable will make it easier to interpret error messages
- TDDssv = seasonal variability of total growing degree days
- fixed fall recruitment WDD which was previously mistakenly using values from spring instead of fall
- several commits fixed EcologicalDroughtMetrics2023 metrics and output:
* commit e3baf14 'Fix RecruitmentFallWDD in "EcologicalDroughtMetrics2023"'
* commit 14af55a 'Add TDDssv to "EcologicalDroughtMetrics2023"'
- metric groups "EcologicalDroughtMetrics2023" and "RR2020predictors" gain dedicated documentation
- this is in addition to the generic documentation for all `metric_*()` fucntions
…ual()`

- warning: [lengths_linter] Use lengths() to find the length of each element in a list.
Copy link

codecov bot commented Nov 30, 2023

Codecov Report

Attention: 456 lines in your changes are missing coverage. Please review.

Comparison is base (a5c9558) 6.58% compared to head (d3369c6) 6.17%.

❗ Current head d3369c6 differs from pull request most recent head b0f7f8b. Consider uploading reports for the commit b0f7f8b to get more accurate results

Files Patch % Lines
R/Functions_Metrics_002_newRR.R 0.00% 371 Missing ⚠️
R/Functions_Supporting.R 0.00% 83 Missing ⚠️
R/Functions_AcrossYears.R 0.00% 2 Missing ⚠️
Additional details and impacted files
@@                   Coverage Diff                   @@
##           release/devel_v0.3.0     #12      +/-   ##
=======================================================
- Coverage                  6.58%   6.17%   -0.42%     
=======================================================
  Files                        18      18              
  Lines                      5464    5833     +369     
=======================================================
  Hits                        360     360              
- Misses                     5104    5473     +369     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Addressing package check warnings for "Rd files with duplicated alias" and "Undocumented arguments in Rd file":

- remove duplicate aliases for EcologicalDroughtMetrics2023_annual/Clim and RR2022predictors_annual/Clim
- link to general "metrics" documentation for EcologicalDroughtMetrics2023_annual/Clim and RR2022predictors_annual/Clim
- use links to individual metrics in general "metrics" documentation
@dschlaep dschlaep merged commit 82edd2d into release/devel_v0.3.0 Dec 1, 2023
7 checks passed
@dschlaep dschlaep deleted the feature_droughtMetricsClimatology branch December 1, 2023 16:30
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.

1 participant