airGRiwrm issueshttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues2022-03-03T16:41:09+01:00https://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/76`plot.Qm3s`: customize legend position2022-03-03T16:41:09+01:00Dorchies David`plot.Qm3s`: customize legend positionRaise x and y parameters of legend to allow user defined values.Raise x and y parameters of legend to allow user defined values.v0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/75Results differences between versions on vignette V042022-03-03T16:40:47+01:00Dorchies DavidResults differences between versions on vignette V04Here is the result showed by the last devel build of the website (http://airgriwrm.g-eau.fr/dev/articles/V04_Closed-loop_regulated_withdrawal.html):
![image](/uploads/15c7d9738bdde010445d3097e8de74e7/image.png)
And here is the result I...Here is the result showed by the last devel build of the website (http://airgriwrm.g-eau.fr/dev/articles/V04_Closed-loop_regulated_withdrawal.html):
![image](/uploads/15c7d9738bdde010445d3097e8de74e7/image.png)
And here is the result I get on my machine on master branch after solving issue #71:
![image](/uploads/79b166d8eda35100034eab3731c0f699/image.png)v0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/74`plot.GRiwrm` not working in gitlab-ci2022-03-03T16:40:45+01:00Dorchies David`plot.GRiwrm` not working in gitlab-ciHere the errors we have on check:
```
--- re-building ‘V01_Structure_SD_model.Rmd’ using rmarkdown
Quitting from lines 78-80 (V01_Structure_SD_model.Rmd)
Error: processing vignette 'V01_Structure_SD_model.Rmd' failed with diagnostics:
...Here the errors we have on check:
```
--- re-building ‘V01_Structure_SD_model.Rmd’ using rmarkdown
Quitting from lines 78-80 (V01_Structure_SD_model.Rmd)
Error: processing vignette 'V01_Structure_SD_model.Rmd' failed with diagnostics:
invalid value 0 for 'digits' argument
--- failed re-building ‘V01_Structure_SD_model.Rmd’
--- re-building ‘V02_Calibration_SD_model.Rmd’ using rmarkdown
--- finished re-building ‘V02_Calibration_SD_model.Rmd’
--- re-building ‘V03_Open-loop_influenced_flow.Rmd’ using rmarkdown
Quitting from lines 64-65 (V03_Open-loop_influenced_flow.Rmd)
Error: processing vignette 'V03_Open-loop_influenced_flow.Rmd' failed with diagnostics:
invalid value 0 for 'digits' argument
--- failed re-building ‘V03_Open-loop_influenced_flow.Rmd’
--- re-building ‘V04_Closed-loop_regulated_withdrawal.Rmd’ using rmarkdown
Quitting from lines 58-69 (V04_Closed-loop_regulated_withdrawal.Rmd)
Error: processing vignette 'V04_Closed-loop_regulated_withdrawal.Rmd' failed with diagnostics:
invalid value 0 for 'digits' argument
--- failed re-building ‘V04_Closed-loop_regulated_withdrawal.Rmd’
--- re-building ‘airgriwrm.Rmd’ using rmarkdown
--- finished re-building ‘airgriwrm.Rmd’
```v0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/73`plot.GRiwrm`: mermaid code is displayed with the diagram2022-03-03T16:40:42+01:00Dorchies David`plot.GRiwrm`: mermaid code is displayed with the diagramSee on vignette Severn_01:
![image](/uploads/2c095003e57019dcb6801a609a6894cb/image.png)See on vignette Severn_01:
![image](/uploads/2c095003e57019dcb6801a609a6894cb/image.png)v0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/71Prepare the package for v0.6.x CRAN submission2022-03-09T10:16:33+01:00Dorchies DavidPrepare the package for v0.6.x CRAN submissionUse the check list provided by https://github.com/ThinkR-open/prepare-for-cranUse the check list provided by https://github.com/ThinkR-open/prepare-for-cranv0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/69Update airGR dependency to CRAN v1.7.02022-02-23T13:01:02+01:00Dorchies DavidUpdate airGR dependency to CRAN v1.7.0Finally...Finally...v0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/68Clone on github master and dev branches of the repository2022-02-24T11:08:51+01:00Dorchies DavidClone on github master and dev branches of the repositorySteps:
- [x] create repository inrae/airGRiwrm on github
- [x] set up gitlab-ci https://gitlab.irstea.fr/in-wop/hubeau/-/blob/master/.gitlab-ci.yml#L30
- [x] change links in DESCRIPTIONSteps:
- [x] create repository inrae/airGRiwrm on github
- [x] set up gitlab-ci https://gitlab.irstea.fr/in-wop/hubeau/-/blob/master/.gitlab-ci.yml#L30
- [x] change links in DESCRIPTIONv0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/65pkgdown: wrong documentation for methods CreateRunOptions and CreateCalibOptions2022-02-20T20:53:28+01:00Dorchies Davidpkgdown: wrong documentation for methods CreateRunOptions and CreateCalibOptionsGot these warnings in pkgdown:
```
Warning: Failed to parse usage:
S3method(`CreateCalibOptions`, `GRiwrmInputsModel`)(x, ...)
CreateCalibOptions(x, ...)
S3method(`CreateCalibOptions`, `InputsModel`)(x, ...)
S3method(`CreateCalibOptions...Got these warnings in pkgdown:
```
Warning: Failed to parse usage:
S3method(`CreateCalibOptions`, `GRiwrmInputsModel`)(x, ...)
CreateCalibOptions(x, ...)
S3method(`CreateCalibOptions`, `InputsModel`)(x, ...)
S3method(`CreateCalibOptions`, `character`)(x, ...)
S3method(`CreateCalibOptions`, ``function``)(x, ...)
Warning: Failed to parse usage:
S3method(`CreateRunOptions`, `GRiwrmInputsModel`)(x, IniStates = NULL, ...)
CreateRunOptions(x, ...)
S3method(`CreateRunOptions`, `InputsModel`)(x, ...)
S3method(`CreateRunOptions`, `character`)(x, ...)
S3method(`CreateRunOptions`, ``function``)(x, ...)
```
The issue comes from the double back-ticks on methods for `function` objects.
This is related to a bug in roxygen2 https://github.com/r-lib/roxygen2/issues/906 but it seems to have been already fixed...v0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/64`CreateGRiwrm` crashes when keeping all columns and rename some2022-02-21T13:34:44+01:00Dorchies David`CreateGRiwrm` crashes when keeping all columns and rename someSee example below:
```r
text = "id_amont lambert2.x lambert2.y area nom id_aval distance_aval model
H8100021 537912.994 2455749.314 64420.94 La Seine à Vernon NA NA RunModel_CemaNeigeGR4J
H7900010 578113 2437649 61642.28 La Seine à Pois...See example below:
```r
text = "id_amont lambert2.x lambert2.y area nom id_aval distance_aval model
H8100021 537912.994 2455749.314 64420.94 La Seine à Vernon NA NA RunModel_CemaNeigeGR4J
H7900010 578113 2437649 61642.28 La Seine à Poissy H8100021 76.28 RunModel_CemaNeigeGR4J
H5920010 602213 2427449 43824.66 La Seine à Paris [Austerlitz après création lacs] H7900010 82.26 RunModel_CemaNeigeGR4J"
BS_reseau <- read.csv(text = text, sep = "\t")
library(airGRiwrm)
> griwrm <- CreateGRiwrm(BS_reseau,
cols = list(id = "id_amont",
down = "id_aval",
length = "distance_aval"),
keep_all = TRUE)
```
which leads to this error:
```r
Error in if (typeof(df[[x]]) != coltypes[[x]]) { :
argument is of length zero
4.
FUN(X[[i]], ...)
3.
lapply(names(df), function(x) {
if (typeof(df[[x]]) != coltypes[[x]]) {
stop(sprintf("The '%s' column is of type %s, a column of type %s is required",
x, typeof(df[[x]]), coltypes[[x]])) ... at CreateGRiwrm.R#95
2.
CheckColumnTypes(db, list(id = "character", down = "character",
length = "double", model = "character", area = "double")) at CreateGRiwrm.R#69
1.
CreateGRiwrm(BS_reseau, cols = list(id = "id_amont", down = "id_aval",
length = "distance_aval"), keep_all = TRUE)
```v0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/63Simplify the use of airGR in airGRiwrm2021-12-12T15:06:27+01:00Dorchies DavidSimplify the use of airGR in airGRiwrmThe current usage needs the following preamble:
```r
library(airGR)
library(airGRiwrm)
```
In order to have in the scope the airGR functions always needed by the user (such as `ErrorCrit...`).
Moreover running airGR and airGRiwrm in ...The current usage needs the following preamble:
```r
library(airGR)
library(airGRiwrm)
```
In order to have in the scope the airGR functions always needed by the user (such as `ErrorCrit...`).
Moreover running airGR and airGRiwrm in the code often leads to load and detach airGR and airGRiwrm libraries which is a real pain (For example see: https://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/43#note_41579).
I think that a "Depends" dependency on airGR instead of "Imports" would solve this problem. As it is said [here](https://kbroman.org/pkg_primer/pages/depends.html#depends-imports-suggests-and-enhances):
> Depends is used to indicate dependency on a particular version of R, and on packages that are to be loaded (with library()) whenever your package is loaded. If you expect that users would want to load that other package whenever they loaded yours, then you should include the package name here. But this is now relatively rare. (I think the namespaces for these packages should also be imported, with @import.)
I checked on a small example with a 'toto' library with a "Depends: airGR" and airGR function are directly accessible.
In that way a simple `library(airGRiwrm)` would give complete access to airGR functions. It remains to check if we can completely run airGRiwrm and airGR functions by only loading airGRiwrm.v0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/62Breaking change in airGR in issue HYCAR-Hydro/airgr#1372021-11-03T18:05:52+01:00Dorchies DavidBreaking change in airGR in issue HYCAR-Hydro/airgr#137Warm-up outputs and parameters in `OutputsModel` are now stored in the item `OutputsModel$RunOptions`.Warm-up outputs and parameters in `OutputsModel` are now stored in the item `OutputsModel$RunOptions`.v0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/60[CreateInputsModel] Make `Qobs` parameter optional2021-11-05T14:07:20+01:00Dorchies David[CreateInputsModel] Make `Qobs` parameter optionalThe `Qobs` parameter is useless when the network in only composed of hydrological model nodes.
`Qobs` is used to fill the matrix `Qupstream` parameter of `airGR::CreateInputsModel` items but the column of this matrix is replace by upstr...The `Qobs` parameter is useless when the network in only composed of hydrological model nodes.
`Qobs` is used to fill the matrix `Qupstream` parameter of `airGR::CreateInputsModel` items but the column of this matrix is replace by upstream simulated flows during calibration and simulation.
The only exception are:
- when direct flows are injected in the network (case `model = NA`).
- when using option `useUpstreamQsim = FALSE` in `Calibration`
So my proposition is that:
- `Qobs` should be optional and in that case, `Qupstream` should be filled with zeros for `airGR::CreateInputsModel` calls.
- `Qobs` is mandatory only in case of nodes with `model = NA` and column names should at least match with these nodes.
- In case of using option `useUpstreamQsim = FALSE`, check in `Calibration` that all nodes are present in the columns.v0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/59Remove dependency to R > 3.52022-02-20T20:41:08+01:00Dorchies DavidRemove dependency to R > 3.5See the following check result:
```
NB: this package now depends on R (>= 3.5.0)
WARNING: Added dependency on R >= 3.5.0 because serialized objects in
serialize/load version 3 cannot be read in older versions of R.
File(s...See the following check result:
```
NB: this package now depends on R (>= 3.5.0)
WARNING: Added dependency on R >= 3.5.0 because serialized objects in
serialize/load version 3 cannot be read in older versions of R.
File(s) containing such objects:
'airGRiwrm/inst/vignettes/ParamV03.RDS'
```v0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/58Regularisation: Add default value for parameter Celerity2021-09-28T10:50:25+02:00Dorchies DavidRegularisation: Add default value for parameter CelerityAs seen on the calibration of the Yonne river, on small catchment, the sensibility of the celerity can be almost null and return big values that are not physical.
A good trade-off could be to use regularisation to force to get a rationa...As seen on the calibration of the Yonne river, on small catchment, the sensibility of the celerity can be almost null and return big values that are not physical.
A good trade-off could be to use regularisation to force to get a rational value when the parameter is not sensitive.
Todo: Add a default parameter for the celerity in `CreateInputsCrit`v0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/57Wrong Qobs use in Lavenne function criteria2021-09-03T19:08:26+02:00Dorchies DavidWrong Qobs use in Lavenne function criteriav0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/56CreateInputsCrit: transfo is mandatory for parameter regularisation2021-09-03T19:08:26+02:00Dorchies DavidCreateInputsCrit: transfo is mandatory for parameter regularisationAdd fatal error if the `AprioriIds` is provided but not the `transfo` one.
The reason is that default values of transfo are different between classical InputsCrit (`tranfo = ""`) and the Lavenne one (`tranfo = "sqrt"`).Add fatal error if the `AprioriIds` is provided but not the `transfo` one.
The reason is that default values of transfo are different between classical InputsCrit (`tranfo = ""`) and the Lavenne one (`tranfo = "sqrt"`).v0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/54Calibration with parameter regularisation2021-08-02T14:00:09+02:00Dorchies DavidCalibration with parameter regularisationAfter HYCAR-Hydro/airgr#111, automate the regularisation in the calibration.
The main challenge is that the a priori parameters and the a priori criteria used in `CreateInputsCrit_DeLavenne` for one sub-catchment are only known if the a...After HYCAR-Hydro/airgr#111, automate the regularisation in the calibration.
The main challenge is that the a priori parameters and the a priori criteria used in `CreateInputsCrit_DeLavenne` for one sub-catchment are only known if the a priori sub-catchment has been already calibrated. So the `InputsCrit` object should be created on-the-fly during the network calibration.
I propose to :
- add an optional parameter in `CreateInputsCrit.GRiwrmInputsModel` for specifying the use of the DeLavenne regularisation with the Id of the sub-catchment to use as a priori parameter
- add a call to `CreateInputsCrit_DeLavenne` before each sub-catchment calibrationv0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/53CI: dependency issues with Latex in Check as CRAN2022-02-20T22:31:38+01:00Dorchies DavidCI: dependency issues with Latex in Check as CRANGot this error message with docker image rocker/verse: `! Font TS1/cmr/m/n/10=tcrm1000 at 10.0pt not loadable: Metric (TFM) file not found.`
I first solved this issue by : `sudo apt-get install -y --no-install-recommends texlive-fonts-r...Got this error message with docker image rocker/verse: `! Font TS1/cmr/m/n/10=tcrm1000 at 10.0pt not loadable: Metric (TFM) file not found.`
I first solved this issue by : `sudo apt-get install -y --no-install-recommends texlive-fonts-recommended` but it's not sustainable because this installation is very big and it's done at each job execution.
I found the same error in https://next.travis-ci.org/github/yihui/tinytex/builds/686702503 which has been solved by https://github.com/yihui/tinytex/commit/5684295f91955b803c1cb623d1823f53cb3917f2.
It seems that using the R package `tinytex` with `rocker/tidyverse` instead of the Latex installation of `rocker/verse` can solve this problem.v0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/52Handle CemaNeige compatibility2021-07-08T17:57:06+02:00Dorchies DavidHandle CemaNeige compatibilityv0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/50Test fail after airGR update on outputing warm-up Qsim2021-07-09T18:56:19+02:00Dorchies DavidTest fail after airGR update on outputing warm-up QsimAfter the merge HYCAR-Hydro/airgr!49, a series of tests are failing:
```
── 1. Failure: RunModelSupervisor with no regulation should returns same results
OM_Supervisor[["54057"]]$Qsim not equal to OM_GriwrmInputs[["54057"]]$Qsim.
names ...After the merge HYCAR-Hydro/airgr!49, a series of tests are failing:
```
── 1. Failure: RunModelSupervisor with no regulation should returns same results
OM_Supervisor[["54057"]]$Qsim not equal to OM_GriwrmInputs[["54057"]]$Qsim.
names for current but not for target
── 2. Failure: RunModelSupervisor with two regulations that cancel each other ou
OM_Supervisor[["54057"]]$Qsim not equal to OM_GriwrmInputs[["54057"]]$Qsim.
names for current but not for target
── 3. Failure: RunModelSupervisor with multi time steps controller, two regulati
OM_Supervisor[["54057"]]$Qsim not equal to OM_GriwrmInputs[["54057"]]$Qsim.
names for current but not for target
══ testthat results ═══════════════════════════════════════════════════════════
[ OK: 9 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 3 ]
1. Failure: RunModelSupervisor with no regulation should returns same results as RunModel.GRiwrmInputsModel (@test-RunModel.R#50)
2. Failure: RunModelSupervisor with two regulations that cancel each other out should returns same results as RunModel.GRiwrmInputsModel (@test-RunModel.R#84)
3. Failure: RunModelSupervisor with multi time steps controller, two regulations in 1 centralised controller that cancel each other out should returns same results as RunModel.GRiwrmInputsModel (@test-RunModel.R#98)
Error: testthat unit tests failed
Execution halted
1 error ✖ | 1 warning ✖ | 1 note ✖
```v0.6.0Dorchies DavidDorchies David