armi.cases.suite module

The CaseSuite object is responsible for running, and executing a set of user inputs. Many entry points redirect into CaseSuite methods, such as clone, compare, and submit

Used in conjunction with the Case object, CaseSuite can be used to collect a series of cases and submit them to a cluster for execution. Furthermore, a CaseSuite can be used to gather executed cases for post-analysis.

CaseSuites should allow Cases to be added from totally separate directories. This is useful for plugin-informed in-use testing as well as other things.

See also

armi.cases.case

An individual item of a case suite.

class armi.cases.suite.CaseSuite(cs)[source]

Bases: object

A CaseSuite is a collection of possibly related Case objects.

A CaseSuite is intended to be both a pre-processing and post-processing tool to facilitate case generation and analysis. Under most circumstances one may wish to subclass a CaseSuite to meet the needs of a specific calculation.

A CaseSuite is a collection that is keyed off Case titles.

add(case)[source]

Add a Case object to the CaseSuite

Case objects within a CaseSuite must have unique title attributes, a KeyError will be raised

remove(case)[source]

Remove a case from a suite.

discover(rootDir=None, patterns=None, ignorePatterns=None, recursive=True)[source]

Finds case objects by searching for a pattern of inputs, and adds them to the suite.

This searches for CaseSettings input files and loads them to create Case objects.

Parameters
  • rootDir (str, optional) – root directory to search for settings files

  • patterns (list of str, optional) – file pattern to use to filter file names

  • ignorePatterns (list of str, optional) – file patterns to exclude matching file names

  • recursive (bool, optional) – if True, recursively search for settings files

echoConfiguration()[source]

Print information about this suite to the run log.

Notes

Some of these printouts won’t make sense for all users, and may make sense to be delegated to the plugins/app.

clone(oldRoot=None)[source]

Clone a CaseSuite to a new place.

Creates a clone for each case within a CaseSuite. If oldRoot is not specified, then each case clone is made in a directory with the title of the case. If oldRoot is specified, then a relative path from oldRoot will be used to determine a new relative path to the current directory oldRoot.

Parameters

oldRoot (str (optional)) – root directory of original case suite used to help filter when a suite contains one or more cases with the same case title.

Notes

By design, a CaseSuite has no location dependence; this allows any set of cases to compose a CaseSuite. The thought is that the post-analysis capabilities without restricting a root directory could be beneficial. For example, this allows one to perform analysis on cases analyzed by Person A and Person B, even if the analyses were performed in completely different locations. As a consequence, when you want to clone, we need to infer a “root” of the original cases to attempt to mirror whatever existing directory structure there may have been.

run()[source]

Run each case, one after the other.

compare(that, exclusion: Optional[Sequence[str]] = None, weights=None, tolerance=0.01, timestepMatchup=None) int[source]

Compare one case suite with another.

Return type

The number of problem differences encountered.

writeInputs()[source]

Write inputs for all cases in the suite.

See also

clone

Similar to this but doesn’t let you write out new geometry or blueprints objects.

static writeTable(tableResults)[source]

Write a table summarizing the test differences.