Skip to content
GitLab
    • Explore Projects Groups Topics Snippets
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • R Rsic2
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 3
    • Issues 3
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

En prévision de l'arrivée de la forge institutionnelle INRAE, nous vous invitons à créer vos nouveaux projets sur la forge MIA.

  • SIC2SIC2
  • Rsic2
  • Merge requests
  • !2
An error occurred while fetching the assigned milestone of the selected merge_request.

Resolve "Import initial conditions from a result to a new scenario/variant"

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Dorchies David requested to merge 4-import-initial-conditions-from-a-result-to-a-new-scenario-variant into main 3 years ago
  • Overview 0
  • Commits 4
  • Pipelines 0
  • Changes 3

Closes #4 (closed)

Edited 3 years ago by Dorchies David
Viewing commit 63ff2af1
Next
Show latest version
3 files
+ 81
− 0

    Preferences

    File browser
    Compare changes
  • 63ff2af1
    Dorchies David
    feat(set_initial_conditions): add function · 63ff2af1
    Dorchies David authored 3 years ago
    Refs #4
R/set_initial_conditions.R 0 → 100644
+ 44
− 0
  • View file @ 63ff2af1

  • Edit in single-file editor

  • Open in Web IDE

#' Import initial conditions
#'
#' Import initial conditions from a scenario/variant result calculation to a new scenario/variant.
#'
#' @param params [numeric], arguments passed to Edisic for importing initial conditions. See details
#' @param cfg
#'
#' @details `params` [numeric] vector of length 5. Each number correspond to:
#'
#' 1. number of the scenario from which import initial conditions
#' 1. number of the variant from which import initial conditions (Use "0" for no variant)
#' 1. Time in seconds of the initial conditions to import (Use "0" for a single permanent simulation with no time steps)
#' 1. number of the scenario where the initial conditions are exported to
#' 1. number of the variant where the initial conditions are exported to (Use "0" for no variant)
#'
#' @return
#' @export
#'
#' @examples
#' \dontrun{
#' # Import initial conditions from the scenario #1 without variant at time 0s
#' # to the variant #1 in the scenario #1
#' set_initial_conditions("1 0 0 1 1")
#' }
set_initial_conditions <- function(params, cfg = loadConfig()) {
if (!is.numeric(params) || length(params) != 5) {
stop("`params` should be a numeric of length 5")
}
sArgs <- paste(params, collapse = " ")
shell(
shQuote(
paste(
file.path(cfg$sic$path, cfg$sic$edisic),
shQuote(dirname(cfg$project$path), type = "cmd"),
"CI",
shQuote(basename(cfg$project$path), type = "cmd"),
sArgs
),
type = "cmd2"
),
wait = T,
translate = T
)
}
man/set_initial_conditions.Rd 0 → 100644
+ 36
− 0
  • View file @ 63ff2af1

  • Edit in single-file editor

  • Open in Web IDE

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/set_initial_conditions.R
\name{set_initial_conditions}
\alias{set_initial_conditions}
\title{Import initial conditions}
\usage{
set_initial_conditions(params, cfg = loadConfig())
}
\arguments{
\item{params}{\link{numeric}, arguments passed to Edisic for importing initial conditions. See details}
\item{cfg}{}
}
\value{
}
\description{
Import initial conditions from a scenario/variant result calculation to a new scenario/variant.
}
\details{
\code{params} \link{numeric} vector of length 5. Each number correspond to:
\enumerate{
\item number of the scenario from which import initial conditions
\item number of the variant from which import initial conditions (Use "0" for no variant)
\item Time in seconds of the initial conditions to import (Use "0" for a single permanent simulation with no time steps)
\item number of the scenario where the initial conditions are exported to
\item number of the variant where the initial conditions are exported to (Use "0" for no variant)
}
}
\examples{
\dontrun{
# Import initial conditions from the scenario #1 without variant at time 0s
# to the variant #1 in the scenario #1
set_initial_conditions("1 0 0 1 1")
}
}
NAMESPACE
+ 1
− 0
  • View file @ 63ff2af1

  • Edit in single-file editor

  • Open in Web IDE

# Generated by roxygen2: do not edit by hand
export(loadConfig)
export(set_initial_conditions)
Assignee
Dorchies David's avatar
Dorchies David
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
0
0 Participants
Reference:
Source branch: 4-import-initial-conditions-from-a-result-to-a-new-scenario-variant

Menu

Explore Projects Groups Topics Snippets