Skip to content

Release/devel v0.3.0#7

Draft
dschlaep wants to merge 33 commits into
mainfrom
release/devel_v0.3.0
Draft

Release/devel v0.3.0#7
dschlaep wants to merge 33 commits into
mainfrom
release/devel_v0.3.0

Conversation

@dschlaep

Copy link
Copy Markdown
Member
  • accommodate updates with rSOILWAT2 v6.0.0

Daniel Schlaepfer 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
dschlaep marked this pull request as draft May 25, 2023 16:37
@codecov

codecov Bot commented May 25, 2023

Copy link
Copy Markdown

Codecov Report

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

Comparison is base (f7b51c0) 6.53% compared to head (82edd2d) 6.16%.

Files Patch % Lines
R/Functions_Metrics_002_newRR.R 0.00% 372 Missing ⚠️
R/Functions_Supporting.R 4.49% 85 Missing ⚠️
R/Functions_Metrics_008_SW2toTable.R 0.00% 26 Missing ⚠️
R/rSW2metrics-package.R 0.00% 11 Missing ⚠️
R/Functions_Selfdescribing.R 18.18% 9 Missing ⚠️
R/Extractions_Main.R 82.14% 5 Missing ⚠️
R/Functions_AcrossYears.R 0.00% 3 Missing ⚠️
R/Functions_Metrics_005_TranspirationSeasonality.R 0.00% 2 Missing ⚠️
R/Functions_Metrics_001_SEUG.R 0.00% 1 Missing ⚠️
R/Functions_Metrics_003_ATlinkages.R 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

Daniel Schlaepfer 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
- several commits fixed EcologicalDroughtMetrics2023 metrics and output:
* commit e3baf14 'Fix RecruitmentFallWDD in "EcologicalDroughtMetrics2023"'
* commit 14af55a 'Add TDDssv to "EcologicalDroughtMetrics2023"'
- 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) { ... }`.
dschlaep and others added 5 commits November 30, 2023 11:26
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).
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