airGRiwrm issueshttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues2021-12-12T17:38:14+01:00https://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/12Use S3 plot function for GRiwrm diagram display2021-12-12T17:38:14+01:00Dorchies DavidUse S3 plot function for GRiwrm diagram displayv0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/26Use S3 plot method for GRiwrm and GRiwrmOutputsModel class objects2021-12-12T17:40:19+01:00Dorchies DavidUse S3 plot method for GRiwrm and GRiwrmOutputsModel class objects- [x] replace `DiagramGRiwrm` by `plot.GRiwrm`
- [x] Add class `GRiwrmOutputsModel` in the list returned by `RunModel.GRiwrmInputsModel`
- [x] Add `id` item in `OutputsModel` embedded in `GRiwrmOutputsModel`
- [x] Create the method `plot...- [x] replace `DiagramGRiwrm` by `plot.GRiwrm`
- [x] Add class `GRiwrmOutputsModel` in the list returned by `RunModel.GRiwrmInputsModel`
- [x] Add `id` item in `OutputsModel` embedded in `GRiwrmOutputsModel`
- [x] Create the method `plot.GRiwrmOutputsModel` with the following code:
```r
lapply(
x,
function(y) {
plot(y, Qobs = Qobs[,y$id] , main = y$id, ...)
}
)
```v0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/32airGR compatibility: change on LengthHydro unit2021-04-15T10:13:55+02:00Dorchies DavidairGR compatibility: change on LengthHydro unitIn HYCAR-Hydro/airgr#112 LengthHydro unit passed from meters to kilometers.
The documentation and vignettes should be modified consequently.In HYCAR-Hydro/airgr#112 LengthHydro unit passed from meters to kilometers.
The documentation and vignettes should be modified consequently.v0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/33airGR compatibility: debugged version of RunModel_Lag2021-04-15T10:13:56+02:00Dorchies DavidairGR compatibility: debugged version of RunModel_LagThe patched version of RunModel_Lag in airGRiwrm is no longer necessary after resolution of HYCAR-Hydro/airgr#102 and HYCAR-Hydro/airgr#103The patched version of RunModel_Lag in airGRiwrm is no longer necessary after resolution of HYCAR-Hydro/airgr#102 and HYCAR-Hydro/airgr#103v0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/34Push roxygen outputs on the repository2021-04-08T16:05:57+02:00Dorchies DavidPush roxygen outputs on the repositoryTo be able to install the package directly with `remotes::install_gitlab()`To be able to install the package directly with `remotes::install_gitlab()`v0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/35Vignettes: working directory instability2021-04-15T10:13:55+02:00Dorchies DavidVignettes: working directory instabilityOn my session of Rstudio, the working directory is the one of the project directory on vignette 1 and it is the subdirectory "vignettes" on vignette 2. It leads to severe issues with the version of the files we're suppose to write and read.On my session of Rstudio, the working directory is the one of the project directory on vignette 1 and it is the subdirectory "vignettes" on vignette 2. It leads to severe issues with the version of the files we're suppose to write and read.v0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/36Add network consistency checks in `GRiwrm`2021-04-28T12:35:37+02:00Dorchies DavidAdd network consistency checks in `GRiwrm`Minimum checks are necessary on connections between nodes.Minimum checks are necessary on connections between nodes.v0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/37CreateInputsModel: Error when using data.frame for Qobs2021-04-28T12:35:37+02:00Dorchies DavidCreateInputsModel: Error when using data.frame for QobsError with Qupstream which should be a matrix...Error with Qupstream which should be a matrix...v0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/38CreateInputsCrit: Change obs parameter characteristics2021-04-28T12:35:37+02:00Dorchies DavidCreateInputsCrit: Change obs parameter characteristics- Change `Qobs` to `Obs` as `Qobs` is deprecated in **airGR**
- Remove `IndPeriod_Run`- Change `Qobs` to `Obs` as `Qobs` is deprecated in **airGR**
- Remove `IndPeriod_Run`v0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/39`RunModel.Supervisor`: Error in ctrlr$U[seq.int(length(sv$ts.index)), i]2021-04-19T18:48:21+02:00Dorchies David`RunModel.Supervisor`: Error in ctrlr$U[seq.int(length(sv$ts.index)), i]Supervisor avec un time step = 1, on a cette erreur dans `setDataToLocation` car le vecteur revoyé par le contrôleur n'est pas une matrice...Supervisor avec un time step = 1, on a cette erreur dans `setDataToLocation` car le vecteur revoyé par le contrôleur n'est pas une matrice...v0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/40Supervisor: measurement on network downstream node returns `NULL`2021-04-28T12:35:37+02:00Dorchies DavidSupervisor: measurement on network downstream node returns `NULL``getDataFromLocation` do not handle dowstream node of a network.`getDataFromLocation` do not handle dowstream node of a network.v0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/41RunModel: Suspected bug on `OutputsModel$Qsim` in the training example2021-05-03T13:47:04+02:00Dorchies DavidRunModel: Suspected bug on `OutputsModel$Qsim` in the training exampleIn the training example (https://gitlab.irstea.fr/in-wop/formation-airgriwrm) in the **airGRiwrm** naturalised flow example, we have this result of simulation for the downstream node:
```
$ CHALO_21:List of 22
..$ DatesR : POSIXlt[1:...In the training example (https://gitlab.irstea.fr/in-wop/formation-airgriwrm) in the **airGRiwrm** naturalised flow example, we have this result of simulation for the downstream node:
```
$ CHALO_21:List of 22
..$ DatesR : POSIXlt[1:4749], format: "1995-08-01" "1995-08-02" "1995-08-03" "1995-08-04" ...
..$ PotEvap : num [1:4749] 4.4 4.5 4.2 4.2 4.3 4 3.4 3 3.6 3.8 ...
..$ Precip : num [1:4749] 0 0 0 0 0 1.8 10.5 0.4 0 0 ...
..$ Prod : num [1:4749] 310 307 304 301 297 ...
..$ Pn : num [1:4749] 0 0 0 0 0 0 7.1 0 0 0 ...
..$ Ps : num [1:4749] 0 0 0 0 0 ...
..$ AE : num [1:4749] 3.11 3.16 2.93 2.91 2.95 ...
..$ Perc : num [1:4749] 0.131 0.125 0.119 0.113 0.107 ...
..$ PR : num [1:4749] 0.131 0.125 0.119 0.113 0.107 ...
..$ Q9 : num [1:4749] 0.388 0.442 0.5 0.563 0.136 ...
..$ Q1 : num [1:4749] 0.099 0.0915 0.0847 0.0788 0.0699 ...
..$ Rout : num [1:4749] 33 32.8 32.7 32.7 32.3 ...
..$ Exch : num [1:4749] -0.229 -0.224 -0.22 -0.218 -0.217 ...
..$ AExch1 : num [1:4749] -0.229 -0.224 -0.22 -0.218 -0.217 ...
..$ AExch2 : num [1:4749] -0.099 -0.0915 -0.0847 -0.0788 -0.0699 ...
..$ AExch : num [1:4749] -0.328 -0.315 -0.304 -0.296 -0.287 ...
..$ QR : num [1:4749] 0.393 0.383 0.378 0.376 0.351 ...
..$ QD : num [1:4749] 0 0 0 0 0 0 0 0 0 0 ...
..$ Qsim : Named num [1:4749] 0.0859 0.1731 0.2319 0.2525 0.2418 ...
.. ..- attr(*, "names")= chr [1:4749] "" "" "13515" "13516" ...
..$ StateEnd:List of 4
.. ..$ Store :List of 4
.. .. ..$ Prod: num 317
.. .. ..$ Rout: num 29.9
.. .. ..$ Exp : num NA
.. .. ..$ Int : num NA
.. ..$ UH :List of 2
.. .. ..$ UH1: num [1:20] 0.18 0.182 0.184 0.186 0.187 ...
.. .. ..$ UH2: num [1:40] 0.0209 0.0206 0.0203 0.02 0.0196 ...
.. ..$ CemaNeigeLayers:List of 4
.. .. ..$ G : num NA
.. .. ..$ eTG : num NA
.. .. ..$ Gthr : num NA
.. .. ..$ Glocmax: num NA
.. ..$ SD :List of 3
.. .. ..$ : Named num [1:3] 541563 534570 523807
.. .. .. ..- attr(*, "names")= chr [1:3] "18261" "18262" "18263"
.. .. ..$ : Named num [1:3] 95772 93020 91120
.. .. .. ..- attr(*, "names")= chr [1:3] "18261" "18262" "18263"
.. .. ..$ : Named num [1:2] 508672 496590
.. .. .. ..- attr(*, "names")= chr [1:2] "18262" "18263"
.. ..- attr(*, "class")= chr [1:3] "IniStates" "GR" "daily"
..$ QsimDown: num [1:4749] 0.393 0.383 0.378 0.376 0.351 ...
..$ Qsim_m3 : Named num [1:4749] 540230 1089349 1458910 1588607 1521507 ...
.. ..- attr(*, "names")= chr [1:4749] "" "" "13515" "13516" ...
..- attr(*, "class")= chr [1:3] "OutputsModel" "daily" "GR"
- attr(*, "class")= chr [1:2] "GRiwrmOutputsModel" "list"
- attr(*, "Qm3s")=Classes ‘Qm3s’ and 'data.frame': 4749 obs. of 5 variables:
..$ DatesR : POSIXct[1:4749], format: "1995-08-01" "1995-08-02" "1995-08-03" "1995-08-04" ...
..$ STDIZ_04: num [1:4749] 5.46 5.28 5.11 4.95 4.8 ...
..$ LOUVE_19: num [1:4749] 0.858 0.836 0.815 0.795 0.775 ...
..$ VITRY_25: num [1:4749] 6.65 6.43 6.23 6.04 5.86 ...
..$ CHALO_21: num [1:4749] 6.25 12.61 16.89 18.39 17.61 ...
```
Here,we have `QSimDown > Qsim` which is very suspicious because the flow is supposed to come from upstream basins in dry weather...v0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/43Review documentation for publication on CRAN2021-12-11T15:56:42+01:00Dorchies DavidReview documentation for publication on CRANv0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/44Generation of the https://airgriwrm.g-eau.net site documentation2021-04-28T12:35:37+02:00Dorchies DavidGeneration of the https://airgriwrm.g-eau.net site documentationWith pkgdown!!
With integration of the formation in French and the vignettes on the Seine RiverWith pkgdown!!
With integration of the formation in French and the vignettes on the Seine Riverv0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/45Update URLs in the DESCRIPTION file2021-12-12T18:03:32+01:00Delaigue OlivierUpdate URLs in the DESCRIPTION file```
URL: https://airgriwrm.g-eau.fr/
BugReports: https://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues
``````
URL: https://airgriwrm.g-eau.fr/
BugReports: https://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues
```v0.6.0https://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/46Rename function GRiwrm to CreateGRiwrm2021-05-22T12:40:21+02:00Dorchies DavidRename function GRiwrm to CreateGRiwrmTo be consistent with other functions that create **airGRiwrm** / **airGR** objectsTo be consistent with other functions that create **airGRiwrm** / **airGR** objectsv0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/47Automatically update website from package repository2021-12-12T17:04:26+01:00Dorchies DavidAutomatically update website from package repositoryUse CI/CD to generate and transfer the website to https://airgriwrm.g-eau.net.Use CI/CD to generate and transfer the website to https://airgriwrm.g-eau.net.v0.6.0Dorchies DavidDorchies Davidhttps://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/48Handling correctly initial conditions2021-07-29T20:11:17+02:00Dorchies DavidHandling correctly initial conditionsv0.6.0https://gitlab.irstea.fr/in-wop/airGRiwrm/-/issues/49Add an airGR galaxy tab on the website?2022-02-21T17:53:17+01:00Thirel GuillaumeAdd an airGR galaxy tab on the website?I think it would be preferable to add an airGR Galaxy tab on the airGRiwrm website, in a similar way as done in other site (e.g. https://hydrogr.github.io/airGR/). What do you think @olivier.delaigue and @david.dorchies ?I think it would be preferable to add an airGR Galaxy tab on the airGRiwrm website, in a similar way as done in other site (e.g. https://hydrogr.github.io/airGR/). What do you think @olivier.delaigue and @david.dorchies ?v0.6.0https://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/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/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/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/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 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/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/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/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/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/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/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/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/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/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/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/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/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/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/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 David