sierra.core.batchroot#

Functionality for generating root directory paths for a batch experiment.

See Runtime Directory Tree for details about the defined root directories in SIERRA.

Classes#

ExpRoot

Representation of the filesystem path containing all per-experiment data.

ExpRootLeaf

Representation of the "name" in pathlib parlance in ExpRoot.

PathSet

The set of filesystem paths under --sierra-root that SIERRA uses.

Functions#

from_cmdline(→ PathSet)

Generate directory paths directly from cmdline arguments.

from_exp(→ PathSet)

Regenerate directory pathroots from a batch experiment.

Module Contents#

class sierra.core.batchroot.ExpRoot(sierra_root: str, project: str, controller: str, scenario: str, leaf: ExpRootLeaf)[source]#

Representation of the filesystem path containing all per-experiment data.

class sierra.core.batchroot.ExpRootLeaf(bc: list[str], template_stem: str)[source]#

Representation of the "name" in pathlib parlance in ExpRoot.

static from_components(bc: list[str], template_stem: str) ExpRootLeaf[source]#

Create the leaf representation directory from the components.

static from_name(leaf: str) ExpRootLeaf[source]#

Parse the the directory name to extract leaf components.

"Name" here is pathlib parlance. Expected to be of the form:

<template stem>-[<criteria0>+<criteria1>]...

This function is the inverse of to_path().

to_path() pathlib.Path[source]#

Get the leaf as a pathlib.Path object.

class sierra.core.batchroot.PathSet[source]#

The set of filesystem paths under --sierra-root that SIERRA uses.

Collected here in the interest of DRY.

classmethod from_root(root: ExpRoot) PathSet[source]#

Create PathSet from an ExpRoot.

sierra.core.batchroot.from_cmdline(args: argparse.Namespace) PathSet[source]#

Generate directory paths directly from cmdline arguments.

sierra.core.batchroot.from_exp(sierra_root: str, project: str, batch_leaf: ExpRootLeaf, controller: str, scenario: str) PathSet[source]#

Regenerate directory pathroots from a batch experiment.

Args:

sierra_root: The value of --sierra-root.

project: The value of --project.

batch_leaf: The name of the directory that will be the root of the batch experiment (not including its parent).

controller: The value of --controller.

scenario: The value of --scenario.