polaris.tasks.ocean.analysis.AnalysisTask

class polaris.tasks.ocean.analysis.AnalysisTask(component, config, name, range_section)[source]

A task of the ocean analysis suite

A task is a thin grouping over shared steps and introduces no directory level of its own. Its steps are built from config options rather than fixed at construction, so that a user who asks for a different range of years gets steps in different directories – which have never run, and so run – without having to delete anything or pass a flag.

Variables:
  • range_section (str) – The config section holding the start_year and end_year this task’s steps are keyed on

  • publish_task (polaris.tasks.ocean.analysis.PublishTask or None) – The task that publishes this task’s products, which has to rebuild its step whenever this one rebuilds its steps

__init__(component, config, name, range_section)[source]

Create the task and its steps

Parameters:
  • component (polaris.tasks.ocean.Ocean) – The ocean component the task belongs to

  • config (polaris.config.PolarisConfigParser) – The config parser shared by every analysis task

  • name (str) – The name of the task, which is also its subdirectory under analysis

  • range_section (str) – The config section holding the start_year and end_year this task’s steps are keyed on

Methods

__init__(component, config, name, range_section)

Create the task and its steps

add_step([step, subdir, symlink, run_by_default])

Add a step to the task and component (if not already present)

configure()

Build the steps again now that the user's config file has been read

remove_step(step)

Remove the given step from this task and the component

set_shared_config(config[, link])

Replace the task's config parser with the shared config parser

year_range()

Get the range of simulation years this task's steps cover