Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
55f253b
Set up kwb package structure
ma-z-am May 23, 2023
becd1c6
Implemented first steps until the aggregation of deficiency time
ma-z-am May 23, 2023
5e3e9e1
Added all functions needed for the map plot
ma-z-am May 31, 2023
183ba5b
Updated "ImportFrom" for graphic elements in functions
ma-z-am May 31, 2023
9975068
Update
ma-z-am Jan 5, 2024
297d954
Add scripts used for impetus data
ma-z-am Jan 5, 2024
83b0921
upper/lower case for LWK corrected (in Qsim, both "Lwk" and "LwK" is …
daniel-wicke Jan 5, 2024
ce2d202
Added "SedS" for Seddinsee
daniel-wicke Jan 31, 2024
f594c16
Updated sim_IDs based on Biber_Excel
daniel-wicke Feb 1, 2024
3ae3031
Add general path to the river ID table
ma-z-am Apr 23, 2024
9c92528
Correct wrong river IDs
ma-z-am Apr 23, 2024
a84f0c1
Merge branch 'dev' of github.com:KWB-R/qsimVis into dev
ma-z-am Apr 23, 2024
99d80ee
ID Problems solved and Berlin Board shape included
ma-z-am Apr 26, 2024
be3465d
Improve map plot
ma-z-am Apr 29, 2024
bd6175d
New Roxygen version added
ma-z-am Jul 29, 2024
6520abf
Added small Berlin rivers
ma-z-am Jul 29, 2024
38d1cb1
Added small Berlin rivers
ma-z-am Jul 29, 2024
7ae58f1
Update river_id_table.csv
ma-z-am Jul 29, 2024
1a24101
Include possibility to load manually added rivers
ma-z-am Jul 29, 2024
1744f1f
Fix a bug in insert_downstreamNA()
ma-z-am Jul 29, 2024
c509685
Update extend_river_table.R
ma-z-am Jul 29, 2024
a2ecf52
Update plot_impetus.R
ma-z-am Jul 29, 2024
e5473cc
Load all manually added rivers to the river list
ma-z-am Jul 29, 2024
e2a114f
Skip rivers that are part of the rivers without available data
ma-z-am Jul 29, 2024
b484e33
Add further error message if project IDs are not unique
ma-z-am Jul 29, 2024
bd50e1b
Update plot_impetus.R
ma-z-am Jul 29, 2024
fae9e5c
Fix Bug (wrong order of interpolation)
ma-z-am Jul 31, 2024
ee7607a
Delete accidentally repeated function
ma-z-am Jul 31, 2024
1f7b78f
Remove section id and river name from project ID
ma-z-am Jul 31, 2024
ba4e6b5
Include error message for wrong parameter definition
ma-z-am Jul 31, 2024
b37227e
Change "df_row" to "id_row"
ma-z-am Jul 31, 2024
3b19450
Rmove MiSa Data from package
ma-z-am Jul 31, 2024
ef6a055
Add simple plotting example
ma-z-am Jul 31, 2024
4896e6e
Remove size column from ID table (not used in functions)
ma-z-am Jul 31, 2024
82074e6
Update scripts
ma-z-am Jul 31, 2024
7fa06a5
shorter name for Marzahn-Hohenschoenhauser Grenzgraben for smaller fi…
daniel-wicke Mar 4, 2025
bd8d43d
read data from BerlinWaterModel
daniel-wicke Mar 5, 2025
edb16d5
Add option to choose between section name or river name
ma-z-am Mar 6, 2025
9d272da
Update script to use "river_name" as qsimVis ID
ma-z-am Mar 6, 2025
9c557a1
New file names
ma-z-am Mar 6, 2025
17fbaed
ID Table for Berlin Water Model
ma-z-am Mar 6, 2025
4352af1
Adjust script for Berlin Water Model
ma-z-am Mar 6, 2025
96baaf8
Improve documetation of parameters
ma-z-am Mar 6, 2025
5971213
New split
ma-z-am Mar 6, 2025
b7c9eb0
faster reading of large csv data files
daniel-wicke Mar 7, 2025
89ee4b0
Zero km added fro Wannsee to start plotting at Unterhavel
daniel-wicke Mar 7, 2025
f60bd11
all input files from Masterplan Wasser added and thresholds adapted f…
daniel-wicke Mar 7, 2025
58cb504
Merge branch 'dev' of github.com:KWB-R/qsimVis into dev
daniel-wicke Mar 7, 2025
6d2c866
Add datatime specific functions
ma-z-am Sep 24, 2025
09182ad
Make function more flexible, to deal with different column names and …
ma-z-am Sep 24, 2025
cf5c29d
Add function to load mulitple Qsim Output files, if the model size re…
ma-z-am Sep 24, 2025
0b8fb33
Selects column by name instead of index
ma-z-am Sep 24, 2025
125b328
New column names depending on the "dev_type"
ma-z-am Sep 24, 2025
2fe081a
New project ID
ma-z-am Sep 24, 2025
0e937cb
Restructure Impetus data reading script
ma-z-am Sep 24, 2025
b029981
Add dev_type option for critical events
ma-z-am Sep 24, 2025
a8d8ed6
remove empty lines
ma-z-am Sep 24, 2025
330c8a4
Split the loading, processing and color assignment of rivers and rive…
ma-z-am Sep 26, 2025
57f64a9
New Version of scripts
ma-z-am Sep 26, 2025
a367461
add "size_type" column to set line width in plot
ma-z-am Sep 26, 2025
5712ede
New column names
ma-z-am Sep 26, 2025
9d753ff
Better variable names
ma-z-am Sep 26, 2025
b4c9e20
Include add_qsimVis_id() in functions
ma-z-am Sep 26, 2025
d5a8645
Script adjusted to new functions
ma-z-am Sep 26, 2025
be11587
Add relative value option
ma-z-am Sep 30, 2025
e2cef3e
Include relative values in deviating_hours()
ma-z-am Sep 30, 2025
35b6aaf
Add new possibilites to script
ma-z-am Oct 1, 2025
8f67edb
Split Color and Legend functions for plotting
ma-z-am Oct 1, 2025
3300ee1
Implement class color as a factor
ma-z-am Oct 1, 2025
02c8c47
Add general stats function
ma-z-am Oct 1, 2025
21c8772
Add flow weighted mean function
ma-z-am Oct 1, 2025
9b2c7a3
Update NAMESPACE
ma-z-am Oct 1, 2025
8900dd9
Fixed Flow Bug
ma-z-am Oct 9, 2025
9f70b9b
Update
ma-z-am Oct 9, 2025
8c9580d
Add 90th Percentile to stats()
ma-z-am Oct 15, 2025
b896a87
Add option "lower than" and "greater than" and adjust column names fo…
ma-z-am Oct 15, 2025
d5db93f
Add MiSa plot option
ma-z-am Oct 16, 2025
d6974cb
Make legend options more flexible
ma-z-am Oct 16, 2025
363b152
Update deviating_hours.Rd
ma-z-am Oct 16, 2025
41f00ae
Add function saveActiveDevice()
ma-z-am Oct 17, 2025
6538be3
script that can read and plot the aggregated data, created in the MiS…
ma-z-am Oct 17, 2025
27a5d0c
Add saveActiveDevice() function to the BerlinWaterModel script
ma-z-am Oct 17, 2025
960efee
latest version
daniel-wicke Oct 27, 2025
2c8ad82
latest plot configurations
daniel-wicke Oct 31, 2025
6233af5
smaller adaptations
daniel-wicke Oct 31, 2025
8f2345e
title for map added (not as function yet)
daniel-wicke Nov 11, 2025
37f6367
Add function add_logo()
ma-z-am Nov 12, 2025
cc78302
Rename R file for plotting the legend
ma-z-am Nov 12, 2025
3303e08
Fix wrong png ratio in graphic
ma-z-am Nov 13, 2025
e231b90
change background of logos to transparent
daniel-wicke Nov 14, 2025
46b50c3
add section_id and section_name to output table
daniel-wicke Dec 4, 2025
486472f
New Roxygen version
ma-z-am Dec 5, 2025
22e79a9
Add view_output()
ma-z-am Dec 5, 2025
3b6b294
Define colclasses for input tables
ma-z-am Dec 5, 2025
70bee15
Bug fixing
ma-z-am Dec 5, 2025
1b874b6
Bug fix to deal with only NA values along one river
ma-z-am Jan 12, 2026
bc3bf9e
New warning for unintended space
ma-z-am Jan 14, 2026
5ad6656
Bug fix for legend lables
ma-z-am Jan 14, 2026
49826dc
Update
ma-z-am Jan 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 11 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
^\.here$
^LICENSE\.md$
^_pkgdown\.yml$
^docs$
^pkgdown$
^\.github$
^codecov\.yml$
^index\.md$
^README\.md$
^.*\.Rproj$
^\.Rproj\.user$
83 changes: 83 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
on:
push:
branches:
- master
- main
- dev
pull_request:
branches:
- master
- main
- dev

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: windows-latest, r: 'devel'}
- {os: windows-latest, r: 'oldrel'}
- {os: windows-latest, r: 'release'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
use-public-rspm: true

- uses: r-lib/actions/setup-pandoc@v2

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), "depends.Rds", version = 2)
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-3-${{ hashFiles('depends.Rds') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-3-

- name: Install system dependencies
if: runner.os == 'Linux'
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
run: |
Rscript -e "remotes::install_github('r-hub/sysreqs')"
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
sudo -s eval "$sysreqs"
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: Check
run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "warning", check_dir = "check")
shell: Rscript {0}

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
53 changes: 53 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
on:
push:
branches:
- main
- master
- dev

name: pkgdown

jobs:
pkgdown:
runs-on: windows-latest
env:
CURL_SSL_BACKEND: "openssl"
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-pandoc@v2

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
install.packages("pkgdown", type = "binary")
shell: Rscript {0}

- name: Install package
run: R CMD INSTALL .
shell: cmd

- name: Deploy package
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
51 changes: 51 additions & 0 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
on:
issue_comment:
types: [created]
name: Commands
jobs:
document:
if: startsWith(github.event.comment.body, '/document')
name: document
runs-on: macOS-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/pr-fetch@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: r-lib/actions/setup-r@master
- name: Install dependencies
run: Rscript -e 'install.packages(c("remotes", "roxygen2"))' -e 'remotes::install_deps(dependencies = TRUE)'
- name: Document
run: Rscript -e 'roxygen2::roxygenise()'
- name: commit
run: |
git add man/\* NAMESPACE
git commit -m 'Document'
- uses: r-lib/actions/pr-push@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
style:
if: startsWith(github.event.comment.body, '/style')
name: style
runs-on: macOS-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/pr-fetch@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: r-lib/actions/setup-r@master
- name: Install dependencies
run: Rscript -e 'install.packages("styler")'
- name: Style
run: Rscript -e 'styler::style_pkg()'
- name: commit
run: |
git add \*.R
git commit -m 'Style'
- uses: r-lib/actions/pr-push@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
48 changes: 48 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main

name: test-coverage

jobs:
test-coverage:
runs-on: windows-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v2

- uses: r-lib/actions/setup-pandoc@v2

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install dependencies
run: |
install.packages(c("remotes"))
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("covr")
shell: Rscript {0}

- name: Test coverage
run: covr::codecov()
shell: Rscript {0}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.Rproj.user
docs
1 change: 1 addition & 0 deletions .here
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

25 changes: 25 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Package: qsimVis
Title: Visualize Qsim Output
Version: 0.0.0.9000
Authors@R: c(
person("Malte", "Zamzow", , "malte.zamzow@kompetenz-wasser.de", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-8748-038X")),
person("Kompetenzzentrum Wasser Berlin gGmbH (KWB)", role = "cph")
)
Description: Aggregate and visualize Qsim/Hydrax output data.
License: MIT + file LICENSE
URL: https://github.com/KWB-R/qsimVis
BugReports: https://github.com/KWB-R/qsimVis/issues
Depends:
R (>= 4.0.0)
Suggests:
covr
Imports:
data.table,
geosphere,
ggmap,
methods,
png
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.3
23 changes: 2 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,2 @@
MIT License

Copyright (c) 2023 Kompetenzzentrum Wasser Berlin gGmbH (KWB)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
YEAR: 2023
COPYRIGHT HOLDER: Kompetenzzentrum Wasser Berlin gGmbH (KWB)
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# MIT License

Copyright (c) 2023 Kompetenzzentrum Wasser Berlin gGmbH (KWB)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
62 changes: 62 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Generated by roxygen2: do not edit by hand

export(Berlin_add_boarder)
export(Berlin_add_catchments)
export(Berlin_add_waterbodies)
export(QSIM_prepare)
export(QSIM_prepare_multiple)
export(add_coloredRivers)
export(add_districts)
export(add_inflow)
export(add_logo)
export(add_qsimVis_id)
export(add_river_legend)
export(add_site_info)
export(adverse_deviation_from_reference)
export(critical_events)
export(deviating_hours)
export(extend_riverTable)
export(filter_parameter_data)
export(flow_weighted_mean)
export(getDimensions)
export(insert_downstreamNA)
export(interpolate_multipleNA)
export(load_geo)
export(load_rivers)
export(load_timeframes)
export(plot_empty_map)
export(prepare_rivers)
export(saveActiveDevice)
export(site_info_from_qsimID)
export(stats)
export(value_to_classes)
export(view_output)
import(ggmap)
importFrom(data.table,fread)
importFrom(geosphere,distHaversine)
importFrom(grDevices,col2rgb)
importFrom(grDevices,dev.new)
importFrom(grDevices,dev.off)
importFrom(grDevices,dev.print)
importFrom(grDevices,dev.size)
importFrom(grDevices,png)
importFrom(grDevices,rgb)
importFrom(grDevices,svg)
importFrom(graphics,abline)
importFrom(graphics,legend)
importFrom(graphics,lines)
importFrom(graphics,par)
importFrom(graphics,points)
importFrom(graphics,polygon)
importFrom(graphics,rasterImage)
importFrom(graphics,rect)
importFrom(graphics,text)
importFrom(methods,as)
importFrom(methods,is)
importFrom(png,readPNG)
importFrom(stats,quantile)
importFrom(stats,sd)
importFrom(utils,View)
importFrom(utils,data)
importFrom(utils,read.table)
importFrom(utils,unstack)
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# qsimVis 0.0.0.9000

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

* see https://style.tidyverse.org/news.html for writing a good `NEWS.md`


Loading
Loading