Release/devel v0.3.0#7
Draft
dschlaep wants to merge 33 commits into
Draft
Conversation
dschlaep
commented
May 25, 2023
Member
- accommodate updates with rSOILWAT2 v6.0.0
added 2 commits
May 24, 2023 14:34
- incorporate new SWRC functionality starting with rSOILWAT2 v6.0.0
- some small changes compared to previous versions, see rSOILWAT2 v6.0.0
dschlaep
marked this pull request as draft
May 25, 2023 16:37
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #7 +/- ##
========================================
- Coverage 6.53% 6.16% -0.38%
========================================
Files 18 18
Lines 5446 5839 +393
========================================
+ Hits 356 360 +4
- Misses 5090 5479 +389 ☔ View full report in Codecov by Sentry. |
added 26 commits
July 12, 2023 11:09
-> this comment will make it easier for developers to find rSOILWAT2 versions that produce metrics with updated values
…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
- 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
* [implicit_assignment_linter] Avoid implicit assignments in function calls. For example, instead of `if (x <- 1L) { ... }`, write `x <- 1L; if (x) { ... }`
* [unnecessary_lambda_linter] Pass grepl directly as a symbol to vapply() instead of wrapping it in an unnecessary anonymous function. For example, prefer lapply(DF, sum) to lapply(DF, function(x) sum(x))
* [matrix_apply_linter] Use rowMeans(colMeans(x)) or colMeans(x) if x has 2 dimensions rather than apply(x, MARGIN = 2, FUN = mean)
* [unnecessary_nested_if_linter] Don't use nested `if` statements, where a single `if` with the combined conditional expression will do. For example, instead of `if (x) { if (y) { ... }}`, use `if (x && y) { ... }`.
…ly()` - check more carefully if VWC and if SWC is part of the simulated output - use logical flags to avoid subsetting a `<0 x 0 matrix>` - now calculate SWC from VWC if SWC is not available but VWC is (VWC was already calculated from SWC if available and VWC was not)
- metric groups "EcologicalDroughtMetrics2023" and "RR2020predictors" gain dedicated documentation - this is in addition to the generic documentation for all `metric_*()` fucntions
- warning: [scalar_in_linter] Use == to match length-1 scalars, not %in%. Note that == preserves NA where %in% does not.
- warning: [if_not_else_linter] In a simple if/else statement, prefer `if (A) x else y` to the less-readable `if (!A) y else x`
- style: [undesirable_function_linter] Function "structure" is undesirable
- warning: [implicit_assignment_linter] Avoid implicit assignments in function calls. For example, instead of `if (x <- 1L) { ... }`, write `x <- 1L; if (x) { ... }`.
Feature lintr310 - close #11 - linting updated for lintr v3.1.1
…ual()` - warning: [lengths_linter] Use lengths() to find the length of each element in a list.
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
…atology
Feature drought metrics climatology
* `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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.