Skip to content
Snippets Groups Projects
Commit 71c6f338 authored by RICQUIER FLORIAN's avatar RICQUIER FLORIAN :duck:
Browse files

init : OptirrigManual initialisation repository

parent 707a3cd6
No related branches found
No related tags found
No related merge requests found
Pipeline #181297 failed
Showing with 1048 additions and 115 deletions
^.*\.Rproj$
^\.Rproj\.user$
^\.vscode$
^\.gitlab-ci\.yml$
^data-raw$
^LICENSE\.md$
^man-roxygen$
^pkgdown$
^\.vscode$
^ci$
^snippets$
^README.rmd$
^dev$
^\.RDataTmp
^\.devcontainer
^\.png
^_pkgdown\.yml$
^docs$
^reports$
^templates$
^public$
# History files
.Rhistory
.Rapp.history
# Session Data files
.RData
.RDataTmp
# User-specific files
.Ruserdata
# Example code in package build process
*-Ex.R
# Output files from R CMD build
/*.tar.gz
# Output files from R CMD check
/*.Rcheck/
# RStudio files
.Rproj.user/
# produced vignettes
vignettes/*.html
vignettes/*.pdf
vignettes/*.png
# produced files
inst/extdata/02_Sorties/*/*.csv
# Temporary files created by R markdown
*.utf8.md
*.knit.md
# R Environment Variables
.Renviron
# RStudio Connect folder
rsconnect/
/.vscode
*.bak
*.rds
public/*
docs
# This file is a template, and might need editing before it works on your project.
# This is a sample GitLab CI/CD configuration file that should run without any modifications.
# It demonstrates a basic 3 stage CI/CD pipeline. Instead of real tests or scripts,
# it uses echo commands to simulate the pipeline execution.
#
# A pipeline is composed of independent jobs that run scripts, grouped into stages.
# Stages run in sequential order, but jobs within stages run in parallel.
#
# For more information, see: https://docs.gitlab.com/ee/ci/yaml/index.html#stages
#
# You can copy and paste this template into a new `.gitlab-ci.yml` file.
# You should not add this template to an existing `.gitlab-ci.yml` file by using the `include:` keyword.
#
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml
stages: # List of stages for jobs, and their order of execution
- build
- test
stages:
- checks
- pkgdown
- bookdown
- deploy
build-job: # This job runs in the build stage, which runs first.
stage: build
default:
tags: [stable]
image: rocker/geospatial:4.3.1
variables:
CI_CACHE_DIR: "$CI_PROJECT_DIR/ci"
R_LIBS_USER: "$CI_CACHE_DIR/lib"
PKG_DATA_CACHE: "$CI_CACHE_DIR/data"
cache:
key:
paths:
- $CI_CACHE_DIR
before_script:
- mkdir -p $R_LIBS_USER
- echo "R_LIBS='$R_LIBS_USER'" > .Renviron
- R -q -e 'if (!require(remotes)) install.packages(c("remotes", "testthat"))'
- R -q -e 'devtools::install_deps(dependencies = TRUE)'
- R -q -e 'remotes::install_git("https://forgemia.inra.fr/umr-g-eau/fairify.git")'
check:
variables:
NOT_CRAN: "true"
stage: checks
script:
- echo "Compiling the code..."
- echo "Compile complete."
- R -q -e 'remotes::update_packages("rcmdcheck")'
- R -q -e 'rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error")'
unit-test-job: # This job runs in the test stage.
stage: test # It only starts when the job in the build stage completes successfully.
pkgdown:
stage: pkgdown
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
script:
- echo "Running unit tests... This will take about 60 seconds."
- sleep 60
- echo "Code coverage is 90%"
- R -q -e 'devtools::install()'
- R -q -e 'remotes::update_packages("pkgdown")'
- R -q -e 'rmarkdown::render("README.rmd", "md_document")'
- R -q -e 'fairify::build_site()'
- mv docs/* public/
artifacts:
paths:
- public/
lint-test-job: # This job also runs in the test stage.
stage: test # It can run at the same time as unit-test-job (in parallel).
bookdown:
stage: bookdown
dependencies:
- pkgdown
script:
- echo "Linting code... This will take about 10 seconds."
- sleep 10
- echo "No lint issues found."
- ls reports/
- mv reports/* public/
artifacts:
paths:
- public/
deploy-job: # This job runs in the deploy stage.
stage: deploy # It only runs when *both* jobs in the test stage complete successfully.
environment: production
pages:
stage: deploy
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
script:
- echo "Deploying application..."
- echo "Application successfully deployed."
- ls public/
artifacts:
paths:
- public/
Package: OptirrigManual
Type: Package
Title: OptirrigManual
Version: 0.1.0
Authors@R: c(
person("UMR G-Eau Aqua Department INRAE Montpellier", "Team Optimiste", role = c("aut", "cre"), email = "florian.ricquier@inrae.fr"))
Description: The purpose of this package is to serve as a basis for reports & documentation production.
Encoding: UTF-8
License: GPL (>= 3)
LazyData: true
Depends:
R (>= 2.10),
OptirrigCore (>= 0.4.0)
Imports:
fairify,
Suggests:
knitr,
pkgdown,
rmarkdown,
usethis,
testthat (>= 3.0.0)
remotes:
git::https://package_read:NypwTCoxFT6f6yDQruje@forgemia.inra.fr/optirrigdev/OptirrigCore.git,
git::https://forgemia.inra.fr/umr-g-eau/fairify.git
VignetteBuilder: knitr
RoxygenNote: 7.3.1
Config/testthat/edition: 3
This diff is collapsed.
# Generated by roxygen2: do not edit by hand
export(renderBook)
import(fairify)
# OptirrigManual 0.1.0
Version: 1.0
RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default
EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8
RnwWeave: Sweave
LaTeX: pdfLaTeX
AutoAppendNewline: Yes
StripTrailingWhitespace: Yes
BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
#' Function to render bookdown
#'
#' @param path path to reports dir
#' @param path_pub path to publish dir
#'
#' @import fairify
#'
#' @return a html bookdown
#' @export
#'
renderBook <- function(path = file.path("./reports"),
path_pub = file.path("../../public/reports")){
fairify::render_reports(reports_dir = path,
reports = list.dirs(path,
full.names = FALSE,
recursive = FALSE),
publish_dir = path_pub,
clean_cache = TRUE)
}
# OptirrigManual
# <img src="man/figures/logo_OptirrigManual.png" alt="Optirrig" align="right" style="width:200px"/> OptirrigManual: User Manual & Documentation : R Package support
<!-- badges: start -->
## Getting started
[![CRAN](https://www.r-pkg.org/badges/version-ago/OptirrigManual)](https://forgemia.inra.fr/optirrigdev/OptirrigManual.git)
[![License:
GPL-3](https://img.shields.io/badge/license-GPL--3-orange.svg)](https://cran.r-project.org/web/licenses/GPL-3)
[![Dev check
status](https://forgemia.inra.fr/optirrigdev/OptirrigManual/badges/main/pipeline.svg)](forgemia.inra.fr/optirrigdev/OptirrigManual/-/pipelines)
<!-- badges: end -->
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
Optirrig is a conceptual 1D model with multiple functionalities. Its
purpose is to simulate and optimize irrigation scenarios based on the
type of crop. It incorporates climatic forcings, and accounts for
biological processes (plant development, leaf surface index, dry matter
rates, water and nitrogen stress).
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
The purpose of this package is to serve as a basis for developing and
integrating functionality as required.
## Add your files
## Installation
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
You can install the development version of OptirrigManual like so:
``` r
install.packages("remotes")
remotes::install_git("https://package_read:NypwTCoxFT6f6yDQruje@forgemia.inra.fr/optirrigdev/OptirrigManual.git", build_vignettes = TRUE)
```
cd existing_repo
git remote add origin https://forgemia.inra.fr/optirrigdev/OptirrigManual.git
git branch -M main
git push -uf origin main
```
## Integrate with your tools
- [ ] [Set up project integrations](https://forgemia.inra.fr/optirrigdev/OptirrigManual/-/settings/integrations)
## Collaborate with your team
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
## Test and Deploy
Use the built-in continuous integration in GitLab.
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
***
# Editing this README
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
## Launch the library
## Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
## Name
Choose a self-explaining name for your project.
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
``` r
library(OptirrigCore)
library(OptirrigManual)
```
## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
## Documentation
## Contributing
State if you are open to contributions and what your requirements are for accepting them.
UMR G-EAU - Gestion de l’Eau, Acteurs, Usages (Montpellier)
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
<https://www.g-eau.fr/index.php/fr/>
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
Equipe OPTIMISTE - Optimisation du Pilotage et des Technologies
d’Irrigation, Minimisation des IntrantS, Transferts dans l’Environnement
## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
<https://www.g-eau.fr/index.php/fr/umr-geau/les-equipes/item/410-optimisation-du-pilotage-et-des-technologies-d-irrigation-minimisation-des-intrants-transferts-environnementaux-optimiste>
## License
For open source projects, say how it is licensed.
<div style="display: flex; justify-content: space-between; align-items: center;">
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
<img src="man/figures/Logo-INRAE_Transparent.svg.png" alt="G-EAU" width="300"/><img src="man/figures/logo_G-EAU.jpg" alt="G-EAU" width="200"/><img src="man/figures/log_Optirrig.png" alt="G-EAU" width="200"/>
---
output: github_document
---
# <img src="man/figures/logo_OptirrigManual.png" alt="Optirrig" align="right" style="width:200px"/> OptirrigManual: User Manual & Documentation : R Package support
<!-- badges: start -->
[![CRAN](https://www.r-pkg.org/badges/version-ago/OptirrigManual)]( https://forgemia.inra.fr/optirrigdev/OptirrigManual.git)
[![License: GPL-3](https://img.shields.io/badge/license-GPL--3-orange.svg)](https://cran.r-project.org/web/licenses/GPL-3)
[![Dev check status](https://forgemia.inra.fr/optirrigdev/OptirrigManual/badges/main/pipeline.svg)](forgemia.inra.fr/optirrigdev/OptirrigManual/-/pipelines)
<!-- badges: end -->
```{r opts, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
Optirrig is a conceptual 1D model with multiple functionalities. Its purpose is to simulate and optimize irrigation scenarios based on the type of crop. It incorporates climatic forcings, and accounts for biological processes (plant development, leaf surface index, dry matter rates, water and nitrogen stress).
The purpose of this package is to serve as a basis for developing and integrating functionality as required.
## Installation
You can install the development version of OptirrigManual like so:
``` r
install.packages("remotes")
remotes::install_git("https://package_read:NypwTCoxFT6f6yDQruje@forgemia.inra.fr/optirrigdev/OptirrigManual.git", build_vignettes = TRUE)
```
## Launch the library
``` r
library(OptirrigCore)
library(OptirrigManual)
```
## Documentation
UMR G-EAU - Gestion de l'Eau, Acteurs, Usages (Montpellier)
https://www.g-eau.fr/index.php/fr/
Equipe OPTIMISTE - Optimisation du Pilotage et des Technologies d'Irrigation, Minimisation des IntrantS, Transferts dans l'Environnement
https://www.g-eau.fr/index.php/fr/umr-geau/les-equipes/item/410-optimisation-du-pilotage-et-des-technologies-d-irrigation-minimisation-des-intrants-transferts-environnementaux-optimiste
<div style="display: flex; justify-content: space-between; align-items: center;"><img src="man/figures/Logo-INRAE_Transparent.svg.png" alt="G-EAU" width="300"/><img src="man/figures/logo_G-EAU.jpg" alt="G-EAU" width="200"/><img src="man/figures/log_Optirrig.png" alt="G-EAU" width="200"/>
url: https://optirrig.pages.mia.inra.fr/OptirrigManual/
template:
package: pkgdown
params:
bootswatch: flatly
navbar:
type: inverse
background: '#0053B3'
text: '#ffffff'
border: '#004494'
bslib:
bg: '#ffffff'
fg: '#0053B3'
primary: '#0053B3'
success: '#4CAF50'
info: '#46B8DA'
warning: '#FFC107'
danger: '#D9534F'
development:
mode: release
navbar:
structure:
left:
- intro
- reports
- articles
- news
- reference
right: gitlab
components:
gitlab: ~
icon: fab fa-gitlab fa-lg
href: https://forgemia.inra.fr/optirrigdev/OptirrigManual
reports:
text: Reports
menu:
- text: User manual Optirrig method & uses
href: reports/User_manual_Optirrig_method_&_uses/index.html
- text: Livrable report for WP2 Prima MAGO project
href: reports/WP2_Prima_MAGO_livrable/index.html
repo:
url:
home: https://forgemia.inra.fr/optirrigdev/OptirrigManual
source: https://forgemia.inra.fr/optirrigdev/OptirrigManual/-/tree/main/
issue: https://forgemia.inra.fr/optirrigdev/OptirrigManual/-/issues
default:
Version: 0.2.0
data:
path: NULL
input: 01_Entrees
output: 02_Sorties
runType: NULL
runName: NULL
param: NULL
paramN: NULL
win:
OAD: FALSE
UI: FALSE
man/figures/Logo-INRAE_Transparent.svg.png

28.8 KiB

flowchart TD
A[OptirrigCore] -->|Ex-Post| B(Usage Analytique)
A[OptirrigCore] -->|Ex-Ante| C(Usage Prospectif)
A[OptirrigCore] -->|OAD| D(Usage en temps réel)
B --> |Reproduction de situation
passées, recherche d'alternative
pour les usages documentés
outils de compréhension| F[Calage/Simulation]
C --> |Identification de bonne
stratégie d'usage future,
outils de planification| E[Simulation]
D --> |Prise de décision par
un uttilisateur a partir des
données d'observation sur la saison,
outils d'aide à la décision| F
G[Integration et calcule des processus bio-physique V1 à V12 :
- bilan hydrique
- developement plantes
- Rendement]
I[Type de culture
- LSP : Légumes sur pieds; tomate, piment ...
- LRA : Légumes-racines; Pomme de terre, Betterave, ...
- GRC : Grandes Cultures; Maïs, Orgre, Soja, Blé, ...
- PHF : Prairie, herbes, fourrage; Gazon, Foin, Luzerne, ...
- CPE : Cultures pérennes; Vigne, Olivier, Fruitiers, ...
- VUR : Végétation Urbaines Abélia, ...]
F --> G --> H[Scenarii d'irigation]
E --> G
I --> G
style A fill:#669900
style B fill:#79A2E0
style C fill:#79A2E0
style D fill:#79A2E0
style E fill:#CC3300
style F fill:#CC3300
style G fill:#CC3300
style I fill:#996600
style I text-align:left
\ No newline at end of file
flowchart TD
A[(Données d'entrée)] --> B
B([Calibration/Simulation]) --> | calModel/SimModel/piloteR | C(Description processus Bio-physiques)
C ==> | calcPlantDev | D([Developpement Plante])
C ==> | calcWaterBalance | E([Bilan Hydrique]) ==> T
C ==> | calcFinYield | F([Rendement]) ==> T
C ==> | calcNitrogenMng | G([Gestion de l'Azote]) ==> T
D --> | calcStressFactor | H(Facteur de stress) --> T
D --> | calcLaiTdm | I(LAI et TDM) --> T
D --> | calcRootGrowth | J(Developpement racinaire) --> T
D --> | calcDryMatter | K(Matière sèche) --> T
T[(Sorties)] ==> | plotOutputModel | U([Affichage des résultats]) ==> V(Sauvegarde Fichiers Simulations)
style B fill:#666600,stroke:#333,stroke-width:4px
style U fill:#666600,stroke:#333,stroke-width:4px
style D fill:#993300,stroke:#333,stroke-width:4px
style E fill:#993300,stroke:#333,stroke-width:4px
style F fill:#993300,stroke:#333,stroke-width:4px
style G fill:#993300,stroke:#333,stroke-width:4px
style A fill:#336666,stroke:#333,stroke-width:4px
style T fill:#336666,stroke:#333,stroke-width:4px
File added
man/figures/log_Optirrig.png

155 KiB

man/figures/logo_G-EAU.jpg

18.2 KiB

createStickers <- function() {
# Liste des packages requis
packages <- c("showtext", "sysfonts", "hexSticker")
# Vérifie et installe les packages manquants
for(pkg in packages){
if(!require(pkg, character.only = TRUE)){
install.packages(pkg)
library(pkg, character.only = TRUE)
}
}
# Configuration de showtext pour utiliser les polices Google
sysfonts::font_add_google("Raleway", "Raleway")
showtext::showtext_auto()
# Création du sticker
hexSticker::sticker("man/figures/logo_OptirrigCore.png",
s_x = 1, s_y = 1, s_width = 0.85,
package = "",
p_color = "#003366",
h_fill = "white",
h_color = "#003366",
filename = "man/figures/logo_OptirrigCore_sticker.png")
}
createStickers()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment