Skip to content
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
4 changes: 2 additions & 2 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "kwb.raindrop: R Package for Optimisation Simulations for Rainwater Management",
"description": "<p>R interface and control unit for the RAINDROP hydrodynamic planning tool: long-term simulation of blue-green infrastructure (swale-trench elements) driven by real climate series, plus two cost optimisers that find the cost-minimal design per allowed overflow frequency &mdash; a deterministic bisection-based coordinate descent whose search order is derived from the construction cost rates, and an assumption-free simultaneous search (penalised Nelder-Mead, differential evolution and Halton sampling) as cross-check.</p><p>The proprietary calculation engine (&quot;Regenwasserbewirtschaftung&quot;, &copy; Tandler.com GmbH) is <em>not</em> part of this archive; it is downloaded on demand from the companion repository <a href=\"https://github.com/KWB-R/kwb.raindrop.binaries\">kwb.raindrop.binaries</a>.</p>",
"description": "<p>R interface and control unit for the RainDrop hydrodynamic planning tool: long-term simulation of blue-green infrastructure (swale-trench elements) driven by real climate series, plus two cost optimisers that find the cost-minimal design per allowed overflow frequency &mdash; a deterministic bisection-based coordinate descent whose search order is derived from the construction cost rates, and an assumption-free simultaneous search (penalised Nelder-Mead, differential evolution and Halton sampling) as cross-check.</p><p>The proprietary calculation engine (&quot;Regenwasserbewirtschaftung&quot;, &copy; Tandler.com GmbH) is <em>not</em> part of this archive; it is downloaded on demand from the companion repository <a href=\"https://github.com/KWB-R/kwb.raindrop.binaries\">kwb.raindrop.binaries</a>.</p>",
"upload_type": "software",
"access_right": "open",
"license": "MIT",
Expand All @@ -27,5 +27,5 @@
"scheme": "url"
}
],
"notes": "Developed within the project RAINDROP (Rainwater Drainage Optimization, GZ C300428), funded by the Austrian Federal Ministry of Agriculture, Forestry, Regions and Water Management."
"notes": "Developed within the project RainDrop (Rainwater Drainage Optimization, GZ C300428), funded by the Austrian Federal Ministry of Agriculture, Forestry, Regions and Water Management."
}
9 changes: 7 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ type: software
title: "kwb.raindrop: R Package for Optimisation Simulations for Rainwater Management"
version: 0.1.0
date-released: "2026-08-07"
# Concept DOI: always resolves to the newest release. Do not replace it with a
# version DOI - Zenodo mints those only after a release has been archived, so
# the DOI of the release being tagged cannot be known when this file is
# written. Version DOIs are listed on the Zenodo record this one resolves to.
doi: "10.5281/zenodo.21839222"
license: MIT
repository-code: "https://github.com/KWB-R/kwb.raindrop"
url: "https://kwb-r.github.io/kwb.raindrop"
Expand All @@ -21,7 +26,7 @@ keywords:
- infiltration swale
- R package
abstract: >-
R interface and control unit for the RAINDROP hydrodynamic planning
R interface and control unit for the RainDrop hydrodynamic planning
tool: long-term simulation of blue-green infrastructure (swale-trench
elements) driven by real climate series, plus two cost optimisers
that find the cost-minimal design per allowed overflow frequency - a
Expand All @@ -32,6 +37,6 @@ abstract: >-
proprietary calculation engine ("Regenwasserbewirtschaftung",
(c) Tandler.com GmbH) is not part of this package; it is downloaded
on demand from the companion repository kwb.raindrop.binaries.
Developed within the project RAINDROP (Rainwater Drainage
Developed within the project RainDrop (Rainwater Drainage
Optimization, GZ C300428), funded by the Austrian Federal Ministry
of Agriculture, Forestry, Regions and Water Management.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Version: 0.1.0
Authors@R: c(
person("Michael", "Rustler", , "michael.rustler@kompetenz-wasser.de", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-0647-7726")),
person("RAINDROP", role = "fnd"),
person("RainDrop", role = "fnd"),
person("Kompetenzzentrum Wasser Berlin gGmbH (KWB)", role = "cph")
)
Description: R Package for Optimisation Simulations for Rainwater
Expand Down
2 changes: 1 addition & 1 deletion R/compute_costs.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' Returns the default Austrian unit-cost rates used by [`compute_costs()`].
#' Rates were provided by Johannes Leimgruber (OeStaP) on 2026-03-27 for the
#' RAINDROP cost-optimisation work.
#' RainDrop cost-optimisation work.
#'
#' @return A named `list` of rates in EUR per m² or m³:
#' `excavation_eur_per_m3`, `profiling_eur_per_m2`,
Expand Down
2 changes: 1 addition & 1 deletion R/find_min_feasible.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' Core building block of the swale-design optimiser: finds the smallest
#' value of one design parameter for which the overflow target is met
#' (`n_overflows <= x_max`), assuming quasi-monotone feasibility (larger
#' value = never more overflows; verified for the RAINDROP model in the
#' value = never more overflows; verified for the RainDrop model in the
#' monotonicity analysis,
#' <https://raindrop.kompetenz-wasser.io/optimisation/monotonicity_analysis/>).
#' Each evaluation halves the search interval, so
Expand Down
2 changes: 1 addition & 1 deletion R/get_simulation_results_all.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Read Raindrop optimisation simulation results (all) from HDF5
#' Read RainDrop optimisation simulation results (all) from HDF5
#'
#' Reads per-run result files (HDF5) for both the *measure element* and the
#' *connected area* results and returns a named list (one entry per simulation).
Expand Down
2 changes: 1 addition & 1 deletion R/get_simulation_results_optim.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Read Raindrop optimisation simulation results from HDF5
#' Read RainDrop optimisation simulation results from HDF5
#'
#' Reads per-run result files (HDF5) for both the *measure element* and the
#' *connected area* results and returns a named list (one entry per simulation).
Expand Down
2 changes: 1 addition & 1 deletion R/get_simulation_results_optim_parallel.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Read Raindrop optimisation simulation results from HDF5
#' Read RainDrop optimisation simulation results from HDF5
#' (parallel via future.apply + progress)
#'
#' Parallel variant of \code{get_simulation_results_optim()} using
Expand Down
4 changes: 2 additions & 2 deletions R/h5_ensure_dataset.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Ensure that an HDF5 dataset exists (create if missing)
#'
#' Creates missing groups along the path and then creates the dataset.
#' Designed for RAINDROP input files where missing scalar parameters can
#' Designed for RainDrop input files where missing scalar parameters can
#' crash the model definition reader.
#'
#' @param h5 Open \code{hdf5r::H5File} (mode "a" or "r+").
Expand Down Expand Up @@ -38,7 +38,7 @@ h5_ensure_dataset <- function(h5, path, value, dtype = NULL, dims = NULL) {

infer_dims <- function(v) {
if (is.data.frame(v) && ncol(v) == 2L) {
# R Nx2 -> HDF5 2xN (RAINDROP style)
# R Nx2 -> HDF5 2xN (RainDrop style)
n <- nrow(v)
return(c(2L, as.integer(n)))
}
Expand Down
4 changes: 2 additions & 2 deletions R/h5_ensure_datasets_from_values.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' @param h5 Open hdf5r::H5File (mode "a" or "r+").
#' @param values Named list; names are dataset paths (leading // allowed).
#' @param ts_cols Character(2). Column names for TS (default time/value).
#' @param ts_layout One of "2xN" or "Nx2". For RAINDROP typically "2xN" in HDF5.
#' @param ts_layout One of "2xN" or "Nx2". For RainDrop typically "2xN" in HDF5.
#' @param ts_dtype Either an H5T object or a string ("double","integer","logical","float").
#' @param strict Stop if creation fails.
#' @return Invisibly, the character vector of created dataset paths.
Expand Down Expand Up @@ -50,7 +50,7 @@ h5_ensure_datasets_from_values <- function(h5, values,
}

.infer_dims <- function(v) {
# TS: 2-col df/tibble -> create as 2xN (RAINDROP) or Nx2
# TS: 2-col df/tibble -> create as 2xN (RainDrop) or Nx2
if (is.data.frame(v) && ncol(v) == 2L) {
n <- nrow(v)
if (ts_layout == "2xN") return(c(2L, as.integer(n)))
Expand Down
4 changes: 2 additions & 2 deletions R/hdf5_read-write.R
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ h5_read_values <- function(h5,
#' Write (updated) values back into existing HDF5 datasets (robust for your hdf5r build)
#'
#' - Scalars: write with required `args` (args=list() or args=1L fallback).
#' - 2-col TS (data.frame/tibble): expects Nx2 in R; writes as 2xN in HDF5 (RAINDROP style),
#' - 2-col TS (data.frame/tibble): expects Nx2 in R; writes as 2xN in HDF5 (RainDrop style),
#' using explicit hyperslab args=list(1:2, 1:N) to avoid empty selections.
#' - If TS length changes and dataset maxdims blocks resize, the dataset is deleted via
#' parent$link_delete(name) and recreated with dims=2xN (fixed), then written.
Expand Down Expand Up @@ -518,7 +518,7 @@ h5_write_values <- function(h5, values,
#'
#' Notes:
#' - 2-column data.frames/tibbles are treated as Nx2 in R and mapped to 2xN in HDF5.
#' - Many RAINDROP files store time series as HDF5 dims 2xN (appearing as Nx2 in R).
#' - Many RainDrop files store time series as HDF5 dims 2xN (appearing as Nx2 in R).
#'
#' @param h5 An open \code{hdf5r::H5File}.
#' @param values Named list of values to write (names are HDF5 paths).
Expand Down
2 changes: 1 addition & 1 deletion R/make_swale_runner.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ psi_s_mm <- function(kf_mmh) {
#'
#' Factors the `run_one()` function that was duplicated across the three
#' workflow vignettes (Eisenstadt 2005, Wien, Bad Aussee) into one
#' package-level closure factory. The returned function runs the RAINDROP
#' package-level closure factory. The returned function runs the RainDrop
#' engine for one parameter set and returns the thinned one-row
#' optimisation result (overflow events + water balance), augmented with
#' the input parameters and the overflow volume in m3.
Expand Down
4 changes: 2 additions & 2 deletions R/read_raindrop_errors.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Read RAINDROP error logs into a nested tibble
#' Read RainDrop error logs into a nested tibble
#'
#' Reads the RAINDROP error protocol HDF5 (typically \code{Fehlerprotokoll.h5})
#' Reads the RainDrop error protocol HDF5 (typically \code{Fehlerprotokoll.h5})
#' for a set of simulation runs and returns a tibble with one row per run and a
#' nested tibble column containing all errors found in the file.
#'
Expand Down
4 changes: 2 additions & 2 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ url: https://kwb-r.github.io/kwb.raindrop
authors:
Michael Rustler:
href: https://www.kompetenz-wasser.de/en/ueber-uns/team/michael-rustler
RAINDROP:
RainDrop:
href: https://www.kompetenz-wasser.de/en/forschung/projekte/raindrop
html: <img src='https://www.tandler.com/wp-content/uploads/2024/12/Icon_White.png'
alt='Project RAINDROP' width='72' />
alt='Project RainDrop' width='72' />
Kompetenzzentrum Wasser Berlin gGmbH (KWB):
href: http://www.kompetenz-wasser.de
html: <img src='https://logos.kompetenz-wasser.io/KWB_Logo_M_Blau_RGB.svg'
Expand Down
13 changes: 9 additions & 4 deletions inst/CITATION
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
citHeader("To cite kwb.raindrop in publications use:")

## The DOI is the concept DOI, which always resolves to the newest release.
## Do not replace it with a version DOI: Zenodo mints those only after a
## release has been archived, so the DOI of the release being tagged cannot be
## known when this file is written.
bibentry(
bibtype = "Manual",
title = paste("kwb.raindrop: R Package for Optimisation Simulations",
"for Rainwater Management"),
author = person("Michael", "Rustler",
comment = c(ORCID = "0000-0003-0647-7726")),
year = "2026",
note = "R package version 0.1.0",
url = "https://github.com/KWB-R/kwb.raindrop"
note = paste("R package version", meta$Version),
url = "https://github.com/KWB-R/kwb.raindrop",
doi = "10.5281/zenodo.21839222"
)

citFooter(paste(
"After the first Zenodo release, please prefer the version DOI",
"shown at https://github.com/KWB-R/kwb.raindrop (Cite this repository)."
"The DOI above resolves to the newest release. To cite the exact version you",
"used, take its version DOI from the version list on that Zenodo record."
))
2 changes: 1 addition & 1 deletion man/default_cost_rates.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/find_min_feasible.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/get_simulation_results_all.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/get_simulation_results_optim.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/get_simulation_results_optim_parallel.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/h5_ensure_dataset.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/h5_ensure_datasets_from_values.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/h5_validate_write.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/h5_write_values.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/make_swale_runner.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/read_raindrop_errors.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vignettes/example_wien_minimal.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ The XLSX dump bundles, in one file:
ET0 series fed to every scenario (these are identical across runs).
* `applied_settings` — long-format diff of every key the package writes
on top of `base.h5`, per scenario (`scenario × parameter × base_value
× scenario_value`). Use this to see at a glance exactly what RAINDROP
× scenario_value`). Use this to see at a glance exactly what RainDrop
is being told to change.
* `s00001`, `s00002`, ..., `s00012` — full per-scenario H5 dump (the
same view as `base`, but for each scenario's modified input file).
Expand Down
4 changes: 2 additions & 2 deletions vignettes/workflow_badaussee.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ htmlwidgets::saveWidget(DT::datatable(simulation_results_optimisation,
autoWidth = TRUE)),
file = sprintf("simulation_results_optimisation_%s.html",
paths$modelname),
title = sprintf("RAINDROP - '%s': Solution Space",
title = sprintf("RainDrop - '%s': Solution Space",
paths$modelname)
)
### Plot results
Expand Down Expand Up @@ -575,7 +575,7 @@ htmlwidgets::saveWidget(
file = sprintf("simulation_results_optimisation_%s_main-effects.html",
paths$modelname),
selfcontained = TRUE,
title = sprintf("RAINDROP - '%s': Main Effects",
title = sprintf("RainDrop - '%s': Main Effects",
paths$modelname)
)

Expand Down
4 changes: 2 additions & 2 deletions vignettes/workflow_eisenstadt-2005.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ htmlwidgets::saveWidget(DT::datatable(simulation_results_optimisation,
autoWidth = TRUE)),
file = sprintf("simulation_results_optimisation_%s.html",
paths$modelname),
title = sprintf("RAINDROP - '%s': Solution Space",
title = sprintf("RainDrop - '%s': Solution Space",
paths$modelname)
)
### Plot results
Expand Down Expand Up @@ -467,7 +467,7 @@ htmlwidgets::saveWidget(
file = sprintf("simulation_results_optimisation_%s_main-effects.html",
paths$modelname),
selfcontained = TRUE,
title = sprintf("RAINDROP - '%s': Main Effects",
title = sprintf("RainDrop - '%s': Main Effects",
paths$modelname)
)

Expand Down
4 changes: 2 additions & 2 deletions vignettes/workflow_wien.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ htmlwidgets::saveWidget(DT::datatable(simulation_results_optimisation,
autoWidth = TRUE)),
file = sprintf("simulation_results_optimisation_%s.html",
paths$modelname),
title = sprintf("RAINDROP - '%s': Solution Space",
title = sprintf("RainDrop - '%s': Solution Space",
paths$modelname)
)
### Plot results
Expand Down Expand Up @@ -571,7 +571,7 @@ htmlwidgets::saveWidget(
file = sprintf("simulation_results_optimisation_%s_main-effects.html",
paths$modelname),
selfcontained = TRUE,
title = sprintf("RAINDROP - '%s': Main Effects",
title = sprintf("RainDrop - '%s': Main Effects",
paths$modelname)
)

Expand Down
Loading