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

hydro2023 fix #100

Merged
merged 19 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ vignettes/articles/usecase.Rmd
^pkgdown$
^.codecov.yml$
^tests$
^.covrignore$
4 changes: 4 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
coverage:
ignore:
- "R/sounding_wyoming.R"
- "R/imgw_read.R"
- "R/onAttach.R"
status:
patch:
default:
Expand Down
3 changes: 3 additions & 0 deletions .covrignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
R/sounding_wyoming.R
R/imgw_read.R
R/onAttach.R
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ covr_report.html
lib
docs
pkgdown
.Renviron
.Renviron
test-out.txt
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: climate
Title: Interface to Download Meteorological (and Hydrological) Datasets
Version: 1.2.1
Version: 1.2.2
Authors@R: c(person(given = "Bartosz",
family = "Czernecki",
role = c("aut", "cre"),
Expand Down
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

export(.onAttach)
export(hydro_imgw)
export(hydro_imgw_annual)
export(hydro_imgw_daily)
export(hydro_imgw_monthly)
export(hydro_shortening_imgw)
Expand Down
11 changes: 8 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# climate 1.2.2

* Major fixes for adjusting code to stay in line with CRAN policies
* Fixes for `hydro_imgw()` set of functions due to changes in encoding and metadata structure

* Fixes and modifications for `hydro_imgw()` set of functions due to changes in the IMGW-PIB hydrological datasets
* adjusting code to recognize different encoding and directory structure
* adjusting changes in metadata
* removed option to download data for "semiannual and annual" time resolutions due to inconsistencies in the data
* Fix unit tests for ogimet- and IMGW-related datasets
* Resolving date formatting for hydrological data - the Date column represents calendar date
* Corrected logic in downloading hourly OGIMET dataset

# climate 1.2.1

* Major fixes for adjusting code to stay in line with CRAN policies
* Corrected duplicated column names for IMGW-PIB stations
* Adjusted encoding changes and documentation updates in `meteo_imgw_telemetry_stations()`

Expand Down
17 changes: 0 additions & 17 deletions R/clean_metadata_hydro.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,5 @@ clean_metadata_hydro = function(address, interval) {
if (interval == "daily") {
b = data.frame(parameters = a[1:10])
}
if (interval == "semiannual_and_annual") {
bczernecki marked this conversation as resolved.
Show resolved Hide resolved
godzina = paste0(a[13], ":", a[14])
data = c(a[10:12], godzina)
data_od = paste0("wystapienie_od_", data)
data_do = paste0("wystapienie_do_", data)
SPT = unlist(strsplit(a[8], "]/")) # stan/przeplyw/temperatura
SPT[1] = paste0(SPT[1], "]")
SPT[2] = paste0(SPT[2], "]")
b = NULL
for (i in seq_along(SPT)) {
tmp = c(a[1:7], SPT[i], data_od, data_do)
b = cbind(b, tmp)
}
b = list("H" = data.frame(parameters = b[, 1]),
"Q" = data.frame(parameters = b[, 2]),
"T" = data.frame(parameters = b[, 3]))
}
return(b)
}
14 changes: 3 additions & 11 deletions R/hydro_imgw.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
#' Downloading daily, and monthly hydrological data from the measurement stations
#' available in the danepubliczne.imgw.pl collection
#'
#' @param interval temporal resolution of the data ("daily" , "monthly",
#' or "semiannual_and_annual")
#' @param interval temporal resolution of the data ("daily" or "monthly")
#' @param year vector of years (e.g., 1966:2000)
#' @param coords add coordinates of the stations (logical value TRUE or FALSE)
#' @param value type of data (can be: state - "H" (default), flow - "Q", or
Expand Down Expand Up @@ -38,20 +37,13 @@
# dobowe
calosc = hydro_imgw_daily(year = year, coords = coords, station = station, col_names = col_names, ...)
} else if (interval == "monthly") {
#miesieczne
# miesieczne
calosc = hydro_imgw_monthly(year = year,
coords = coords,
station = station,
col_names = col_names, ...)
} else if (interval == "semiannual_and_annual") {
# polroczne_i_roczne
calosc = hydro_imgw_annual(year = year,
coords = coords,
value = value,
station = station,
col_names = col_names, ...)
} else{
stop("Wrong `interval` value. It should be either 'daily', 'monthly', or 'semiannual_and_annual'.", call. = FALSE)
stop("Wrong `interval` value. It should be either 'daily' or 'monthly'", call. = FALSE)

Check warning on line 46 in R/hydro_imgw.R

View check run for this annotation

Codecov / codecov/patch

R/hydro_imgw.R#L46

Added line #L46 was not covered by tests
}
return(calosc)
}
135 changes: 0 additions & 135 deletions R/hydro_imgw_annual.R

This file was deleted.

Loading
Loading