Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • startR startR
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 29
    • Issues 29
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 7
    • Merge requests 7
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Earth SciencesEarth Sciences
  • startRstartR
  • Merge requests
  • !231

Draft: Develop multiple steps

  • Review changes

  • Download
  • Patches
  • Plain diff
Open aho requested to merge develop-multiple_steps into master Dec 21, 2023
  • Overview 1
  • Commits 3
  • Pipelines 1
  • Changes 3

This is some progress of multiple steps. It is just one idea, but there may be many ways to build this development. Here is a script and you can see the planned structure.

  repos <- "/esarchive/exp/ecmwf/system5_m1/monthly_mean/tas_f6h/$var$_$sdate$.nc"
  var <- 'tas'
  sdate <- c('20170101', '20170201')
  data <- Start(dat = repos,
                var = var,
                sdate = c('20170101'), #, '20170401'),
                ensemble = 'all', #indices(1),
                time = 'all', #indices(1), 
                latitude = indices(1:50), #'all',
                longitude = indices(1:100),  #'all',
                return_vars = list(time = c('sdate'), 
                                   longitude = NULL, latitude = NULL),
                retrieve = FALSE
               )

  # fun1: add noise to time
  fun1 <- function(x) {
    # [time]
    x + rnorm(length(x))
  }

  # fun2: average over ensemble
  fun2 <- function(x) {
    # [ensemble]
    mean(x)
  }

  step1 <- Step(fun1, target_dims = c('time'),
                      output_dims = c('time'))
  step2 <- Step(fun2, target_dims = c('ensemble'),
                      output_dims = NULL)

  wf <- AddStep(inputs = data, step_fun = list(step_a = step1, step_b = step2))

  #NOT WORKING YET
  res <- Compute(wf,
                 chunks = list(step_a = list(ensemble = 2),
                               step_b = list(time = 2)))
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: develop-multiple_steps