polaris.Component

class polaris.Component(name)[source]

The base class for housing all the tasks for a given component, such as ocean, landice, or seaice

Variables:
  • name (str) – the name of the component

  • tasks (dict) – A dictionary of tasks in the component with the subdirectories of the tasks in the component as keys. Setup only: this is empty in a component that has been unpickled (see __getstate__()).

  • steps (dict) – A dictionary of steps in the component with the subdirectories of the steps in the component as keys. Setup only, like tasks.

  • configs (dict) – A dictionary of the shared configs in the component with the filepaths the configs are written to as keys. Setup only, like tasks.

  • cached_files (dict) – A dictionary that maps from output file names in steps within tasks to cached files in the polaris_cache database for the component. These file mappings are read in from cached_files.json in the component.

__init__(name)[source]

Create a new container for the tasks for a given component

Parameters:

name (str) – the name of the component

Methods

__init__(name)

Create a new container for the tasks for a given component

add_config(config)

Add a shared config to the component

add_step(step)

Add a step to the component

add_task(task)

Add a task to the component

build_model(config, machine)

Build the model for this component.

check_model_version(config)

Check that the model this component will run is compatible with this version of polaris.

configure(config, steps)

Configure the component

get_available_resources([placement])

Get available resources from the active parallel system

get_or_create_shared_config(filepath[, create])

Get a shared config from the component if it exists, otherwise build and add it.

get_or_create_shared_step(step_cls, subdir, ...)

Get a shared step from the component if it exists, otherwise create and add it.

has_model()

Whether this component has a model executable, and therefore whether options like the path to that executable apply to it.

open_model_dataset(filename, config, **kwargs)

Open the given dataset, mapping variable and dimension names from Omega to MPAS-Ocean names if appropriate

remove_step(step)

Remove the given step from this component

run_parallel_command(args, cpus_per_task, ...)

Run a command using the active parallel system

set_parallel_system(config)

Construct and store the active parallel system for this component

write_model_dataset(ds, filename, config)

Write out the given dataset, mapping dimension and variable names from MPAS-Ocean to Omega names if appropriate