-
Notifications
You must be signed in to change notification settings - Fork 1
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 swrc #8
base: release/devel_v0.3.0
Are you sure you want to change the base?
Feature swrc #8
Conversation
dschlaep
commented
May 25, 2023
- close Accommodate new SWRCs functionality from rSOILWAT2-devel #5
- new internal `convert_with_swrc()` translates between volumetric water content and soil water potential for any suitable version combination of `rSOILWAT2` input objects and currently installed `rSOILWAT2` package
- new internal `has_fun_swrc_as_arg()` detects if a metric function requires a `SWRC` translation by checking for the presence of a `"swrcp_and_usage"` argument - metrics that require a `SWRC` translation **will** gain argument `"swrcp_and_usage"`; this argument contains all necessary information about the `SWRC` which was active during a simulation, and is then internally used to call `convert_with_swrc()` -> this commit prepares for the new argument `"swrcp_and_usage"` of metrics functions but does not actually implement them; implementation is planned for later commits
new functionality gathers information for the new `"swrcp_and_usage"`arguments (following structure of existing functionality that prepares soil properties information for the `"soils"` arguments), i.e., such information can either be extracted from a `rSOILWAT2` input object when needed to calculate a metrics or, alternatively (but not implemented yet), be loaded from a pre-prepared file stored on disk * new `load_swrcp_and_usage()` determines available `SWRC` functionality and prepares required parameters depending on `rSOILWAT2` version * `process_values_one_site()`, `prepare_soils_for_site()`, and `get_soillayers_variable()` gain arguments to load and/or prepare necessary `SWRC` information at the same time as soil properties are prepared (to avoid reading multiple times a `rSOILWAT2` input objects from disk) * `extract_metrics()` now checks if a metric requires `SWRC` functionality and handles loading and/or preparing of necessary information to be passed on to the metric function. -> note: handling of pre-extracted SWRC information stored on disk is not implemented by this commit
- `calc_SWA_mm()`: replace call to `rSOILWAT2::SWPtoVWC()` (deprecated by rSOILWAT2 v6.0.0) with `convert_with_swrc()` - this works correctly with versions of rSOILWAT2 at v6.0.0 and earlier - all functions and metrics that utilize `calc_SWA_mm()` gain argument "swrcp_and_usage" - updated metrics: * `metric_SW2toTable_daily()` * `metric_SWAat0to020cm39bar_daily()` * `metric_SWAat0to020cm39bar_dailyClim()` * `metric_SWAat0to020cm39bar_JJA()` * `metric_SWAat0to020to100cm39bar_quarterly()` * `metric_SWAat0to100cm30bar()` * `metric_SWAat0to100cm39bar()` * `metric_SWAat0to100cm39bar_daily()` * `metric_SWAat0to100cm39bar_JJA()` * `metric_SWAat20to040cm39bar_daily()` * `metric_SWAat20to040cm39bar_JJA()` * `metric_SWAat20to100cm39bar_daily()` * `metric_SWAat20to100cm39bar_dailyClim()` * `metric_SWAat20to100cm39bar_JJA()` * `metric_SWAat40to060cm39bar_daily()` * `metric_SWAat40to060cm39bar_JJA()` * `metric_SWAat60to080cm39bar_daily()` * `metric_SWAat60to080cm39bar_JJA()` * `metric_SWAat80to100cm39bar_daily()` * `metric_SWAat80to100cm39bar_JJA()`
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/devel_v0.3.0 #8 +/- ##
=======================================================
+ Coverage 6.16% 6.34% +0.17%
=======================================================
Files 18 18
Lines 5839 5614 -225
=======================================================
- Hits 360 356 -4
+ Misses 5479 5258 -221 ☔ View full report in Codecov by Sentry. |
- `get_NonDrySWA_Seasonal()`: replace call to `rSOILWAT2::SWPtoVWC()` (deprecated by rSOILWAT2 v6.0.0) with `convert_with_swrc()` - this works correctly with versions of rSOILWAT2 at v6.0.0 and earlier - all functions and metrics that utilize `get_NonDrySWA_Seasonal()` gain argument "swrcp_and_usage" - updated metrics: * `metric_NonDrySWA_Seasonal_wholeprofile()` * `metric_NonDrySWA_Seasonal_top50cm()`
- `get_SWA_Seasonal()`: replace call to `rSOILWAT2::SWPtoVWC()` (deprecated by rSOILWAT2 v6.0.0) with `convert_with_swrc()` - this works correctly with versions of rSOILWAT2 at v6.0.0 and earlier - all functions and metrics that utilize `get_SWA_Seasonal()` gain argument "swrcp_and_usage" - updated metrics: * `metric_SWA_Seasonal_wholeprofile()` * `metric_SWA_Seasonal_top50cm()`
- `metric_SWP_SoilLayers_MeanMonthly()`: replace call to `rSOILWAT2::VWCtoSWP()` (deprecated by rSOILWAT2 v6.0.0) with `convert_with_swrc()` - this works correctly with versions of rSOILWAT2 at v6.0.0 and earlier - updated metrics: * `metric_SWP_SoilLayers_MeanMonthly()`
- this function is unused and likely remains unused - SWRC functionality is not implemented
…l()` - see commit f65ecf5 --> all functions and metrics that utilize `calc_SWA_mm()` gain argument "swrcp_and_usage" - new function `get_EcologicalDroughtMetrics2023_annual()` now also gains argument "swrcp_and_usage" (which is passed to `calc_SWA_mm()` - this works correctly with versions of rSOILWAT2 at v6.0.0 and earlier - updated metrics: * `metric_EcologicalDroughtMetrics2023_annual()` * `metric_EcologicalDroughtMetrics2023_annualClim()`
- prepare_soils_for_site() can now prepare "swrcp_and_usage" from `soils` (previously, it failed if swInputData was not available) - load_swrcp_and_usage() now accepts as input (renamed to `x`) either an object of class "swInputData" (as previously) or (new) a data frame with soil properties - load_swrcp_and_usage() is now exported