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

Development for v6.0.4 #243

Merged
merged 11 commits into from
Dec 5, 2023
Merged

Development for v6.0.4 #243

merged 11 commits into from
Dec 5, 2023

Conversation

dschlaep
Copy link
Member

@dschlaep dschlaep commented Dec 1, 2023

No description provided.

- `dbW_weatherData_round()` now rounds both "weatherList" and "weather data frame" objects; argument "digits" can now also be logical (if TRUE, then digits takes the default value of 4) or not finite (e.g., NA; not finite values return the input without rounding).
- argument "round" of `dbW_dataframe_to_weatherData()` is deprecated and changed the default value from rounding to 2 digits to no rounding (NA) - recommended replacement is a separate call to `dbW_weatherData_round()`.
- argument "digits" of `dbW_generateWeather()` changed the default value from rounding to 4 digits to no rounding (NA)
- `dbW_generateWeather()` gained `"return_weatherDF"` and now returns a user requested weather object type.
If `return_weatherDF` is `TRUE`, then the result is converted to a data frame where columns represent weather variables; otherwise, a list of elements of class `swWeatherData` is returned (as previously).
- `dbW_imputeWeather()` combines the use of the weather generator and `rSW2utils::impute_df()` for replacing missing weather values

- `dbW_imputeWeather()` simplifies the weather section of the demo vignette substantially
`dbW_substituteWeather()` replaces missing weather values in one weather data object with values from a second weather data object
…of approaches

Approaches are linear interpolation for short missing spells, possibly fixed values for short missing precipitation spells, substitution from a second weather data object, and finally replacement with long term daily mean values
New family of functions `sw_meteo_obtain` that obtain (download) weather data from external sources and prepare for use by `"rSOILWAT2"`
* `sw_meteo_obtain_DayMet()` obtains and formats data from `"Daymet"`
* `sw_meteo_obtain_SCAN()` obtains and formats data from `"SCAN"`

- vignette "demo" is simplified thanks to `sw_meteo_obtain_DayMet()`
Copy link

codecov bot commented Dec 1, 2023

Codecov Report

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

Comparison is base (249477c) 58.99% compared to head (9d727d7) 58.93%.

Files Patch % Lines
R/sw_WeatherExtract.R 0.00% 111 Missing ⚠️
R/swWeatherGenerator.R 89.16% 22 Missing ⚠️
R/sw_dbW_WeatherDatabase.R 54.54% 10 Missing ⚠️
R/D_swWeather.R 50.00% 1 Missing ⚠️
R/D_swWeatherData.R 95.83% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #243      +/-   ##
==========================================
- Coverage   58.99%   58.93%   -0.07%     
==========================================
  Files          42       43       +1     
  Lines        8263     8593     +330     
==========================================
+ Hits         4875     5064     +189     
- Misses       3388     3529     +141     

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

dschlaep and others added 3 commits December 4, 2023 08:35
- functionality to impute and 'fix' weather
- functionality to download weather and format for rSOILWAT2
- [scalar_in_linter] Use == to match length-1 scalars, not %in%. Note that == preserves NA where %in% does not.
- [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`.
- [keyword_quote_linter] Only quote named arguments to functions if necessary, i.e., if the name is not a valid R symbol (see ?make.names)
- [unreachable_code_linter] Code inside a conditional loop with a deterministically false condition should be removed
@dschlaep dschlaep merged commit 233217a into main Dec 5, 2023
15 of 16 checks passed
@dschlaep dschlaep deleted the release/devel_v6.0.4 branch December 5, 2023 21:15
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