Skip to content

Commit 1be3a41

Browse files
authored
Merge pull request #1 from KWB-R/dev
Dev
2 parents ee4b889 + af4299b commit 1be3a41

42 files changed

Lines changed: 328 additions & 184 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

DESCRIPTION

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Package: kwb.BerlinWaterModel.public
22
Title: R Package of Berlin Water Model
3-
Version: 0.1.0
3+
Version: 0.2.0
44
Authors@R: c(
5-
person("Daniel", "Wicke", , "daniel.wicke@kompetenz-wasser.de", role = "aut",
6-
comment = c(ORCID = "0000-0002-5722-5433")),
75
person("Michael", "Rustler", , "michael.rustler@kompetenz-wasser.de", role = c("aut", "cre"),
86
comment = c(ORCID = "0000-0003-0647-7726")),
7+
person("Daniel", "Wicke", , "daniel.wicke@kompetenz-wasser.de", role = "aut",
8+
comment = c(ORCID = "0000-0002-5722-5433")),
99
person("IMPETUS", role = "fnd"),
1010
person("Kompetenzzentrum Wasser Berlin gGmbH (KWB)", role = "cph")
1111
)
@@ -36,7 +36,9 @@ Imports:
3636
units
3737
Suggests:
3838
covr,
39+
DT,
3940
knitr,
41+
openxlsx,
4042
rmarkdown
4143
VignetteBuilder:
4244
knitr

NEWS.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
# [kwb.BerlinWaterModel.public 0.2.0](https://github.com/KWB-R/kwb.BerlinWaterModel.public/releases/tag/v0.2.0) <small>2026-03-20</small>
2+
3+
* Finalisation of example input dataset for year 2019 (including WW/WWTP flows)
4+
5+
16
# [kwb.BerlinWaterModel.public 0.1.0](https://github.com/KWB-R/kwb.BerlinWaterModel.public/releases/tag/v0.1.0) <small>2025-12-17</small>
27

3-
* first public version of kwb.BerlinWaterMode.public for data management plan of IMPETUS EU project (flow data for gallery abstraction
8+
* First public version of kwb.BerlinWaterMode.public for data management plan of IMPETUS EU project (flow data for gallery abstraction
49
of water works and wastewater treatment plants preliminary set to 0, public data set in coordination by BWB and will be available soon)
510

611
* Added a `NEWS.md` file to track changes to the package.
712

8-
* see https://style.tidyverse.org/news.html for writing a good `NEWS.md`
13+
* See https://style.tidyverse.org/news.html for writing a good `NEWS.md`
914

1015

R/calculate_flow.R

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,18 @@ calculate_flow <- function(df, input, shares_timeseries_wide = NULL, config, use
5151
shorten_ww_flow_id(col_flow_id = "target") %>%
5252
dplyr::pull(target)
5353

54-
missing_flow_ids <- !flow_ids[flow_ids != section_id_up] %in% names(input)
54+
flow_ids_without_section_up <- flow_ids[flow_ids != section_id_up]
55+
56+
missing_flow_ids <- if(length(flow_ids_without_section_up) == 0) {
57+
0
58+
} else {
59+
sapply(flow_ids_without_section_up, function(x) ! x %in% names(input))
60+
}
5561

5662
if (sum(missing_flow_ids) > 0) {
5763
stop(sprintf(
5864
"The following flow_ids are missing in the input dataset:\n%s",
59-
paste0(flow_ids[missing_flow_ids], collapse = ", ")
65+
paste0(names(missing_flow_ids[missing_flow_ids == TRUE]), collapse = ", ")
6066
))
6167
}
6268

R/config_read.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#' Configuration: Read
22
#'
33
#' @param config_dir directory with configuration files (default:
4-
#' system.file("extdata/config/network_complete", package = "kwb.BerlinWaterModel")). It is mandatory
4+
#' system.file("extdata/config/network_complete_mean-start-conc", package = "kwb.BerlinWaterModel")). It is mandatory
55
#' that there are three files within this folder: "flows_in_out.csv", "outflows_multiple.csv"
66
#' and "sections.csv"
77
#' @param file_encoding encoding for reading the files (default: "UTF-8")
@@ -16,7 +16,7 @@
1616
#' @importFrom stats setNames
1717
#' @importFrom readr read_csv2 locale
1818
#' @importFrom stringr str_remove
19-
config_read <- function(config_dir = system.file("extdata/config/network_complete",
19+
config_read <- function(config_dir = system.file("extdata/config/network_complete_mean-start-conc",
2020
package = "kwb.BerlinWaterModel.public"),
2121
file_encoding = "UTF-8") {
2222

R/dataset_cso.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
#' Dataset: Combined Sewer Overflows (cso) for a few rainfall events simulated with Infoworks
1+
#' Dataset: Combined Sewer Overflows (cso) for one rainfall event simulated with Infoworks in 2019
22
#'
3-
#' Dataset with combined sewer overflow events for a few rainfall events simulated with Infoworks
3+
#' Dataset with combined sewer overflow events for one rainfall rainfall event simulated with Infoworks
4+
#' in 2019
45
#'
5-
#' @format A tibble with 336,672 rows and five columns
6+
#' @format A tibble with 12,096 rows and five columns
67
#' \describe{
78
#' \item{file_name}{filename of data origin}
89
#' \item{datetime}{datetime}

R/dataset_evapo_p.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#'
33
#' Daily potential evaporation based on DWD 1x1 km raster data.
44
#'
5-
#' @format A tibble with 7,670 rows and 10 columns:
5+
#' @format A tibble with 365 rows and 10 columns:
66
#' \describe{
77
#' \item{file}{Name of the file from the DWD https/ftp server}
88
#' \item{date}{Date}

R/dataset_inflows.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#' Dataset: Inflows
1+
load#' Dataset: Inflows
22
#'
33
#' Dataset with inflows
44
#'
5-
#' @format A tibble with 398,840 rows and three columns
5+
#' @format A tibble with 21,170 rows and three columns
66
#' \describe{
77
#' \item{date}{date}
88
#' \item{id}{id of inflow station}

R/dataset_rain.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#'
33
#' Dataset with rainfall data (based on DWD station 0433)
44
#'
5-
#' @format A tibble with 247,076 rows and two columns
5+
#' @format A tibble with 8,721 rows and two columns
66
#' \describe{
77
#' \item{datetime}{datetime}
88
#' \item{DWD_0433}{hourly rainfall in mm for DWD rainstation 0433}

R/dataset_ww.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#'
33
#' Dataset with waterworks abstractions per gallery
44
#'
5-
#' @format A tibble with 17,141 rows and three columns
5+
#' @format A tibble with 828 rows and three columns
66
#' \describe{
77
#' \item{date}{date}
88
#' \item{id}{id of WW gallery}

R/dataset_wwtp.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#'
33
#' Dataset with WWTP inflows
44
#'
5-
#' @format A tibble with 1,152 rows and three columns
5+
#' @format A tibble with 4015 rows and three columns
66
#' \describe{
77
#' \item{date}{date}
88
#' \item{id}{id of WWTP}

0 commit comments

Comments
 (0)