API reference¶
This page provides an auto-generated summary of the compass
API. For more
details and examples, refer to the relevant sections in the main part of the
documentation.
MPAS Cores¶
compass framework¶
Command-line interface¶
Entry point for the main script |
list¶
|
List the available test cases |
|
setup¶
|
Set up one or more test cases |
|
Set up one or more test cases |
clean¶
|
Set up one or more test cases |
suite¶
|
Set up a test suite |
|
Clean up a test suite by removing its test cases and run script |
run¶
|
Run the given test suite or test case |
|
Used by the framework to run a step when |
cache¶
|
Cache one or more compass output files for use in a cached variant of the test case or step |
Base Classes¶
mpas_core¶
|
The base class for housing all the tests for a given MPAS core, such as ocean, landice or sw (shallow water) |
|
Add a test group to the MPAS core |
testgroup¶
|
The base class for test groups, which are collections of test cases with a common purpose (e.g. global ocean, baroclinic channel, Greenland, or EISMINT2). |
|
Add a test case to the test group |
testcase¶
|
The base class for test cases---such as a decomposition, threading or restart test---that are made up of one or more steps |
Modify the configuration options for this test case. |
|
This method is deprecated. |
|
Test cases can override this method to perform validation of variables and timers |
|
|
Add a step to the test case |
step¶
|
The base class for a step of a test cases, such as setting up a mesh, creating an initial condition, or running the MPAS core forward in time. |
|
Update the resources for the subtask. |
|
Constrain |
Set up the test case in the work directory, including downloading any dependencies. |
|
Update attributes of the step at runtime before calling the |
|
|
Run the step. |
|
Add an input file to the step (but not necessarily to the MPAS model). |
|
Add the output file that must be produced by this step and may be made available as an input to steps, perhaps in other test cases. |
make a link to the model executable and add it to the inputs |
|
|
Add a file with updates to namelist options to the step to be parsed when generating a complete namelist file if and when the step gets set up. |
|
Add the namelist replacements to be parsed when generating a namelist file if and when the step gets set up. |
|
Update an existing namelist file with additional options. |
|
Modify the namelist so the number of PIO tasks and the stride between them consistent with the number of nodes and cores (one PIO task per node). |
|
Add a streams file to the step to be parsed when generating a complete streams file if and when the step gets set up. |
|
Update the streams files during the run phase of this step using the given template and replacements. |
config¶
A "meta" config parser that keeps a dictionary of config parsers and their sources to combine when needed. |
io¶
|
Download a file from a URL to the given path or path name |
|
From https://stackoverflow.com/a/55742015/7728169 Create a symbolic link named link_name pointing to target. |
|
A replacement for deprecated |
logging¶
|
Log the module path and file path of a call to a method, e.g.. |
mesh¶
|
A base class for steps that create a JIGSAW spherical mesh |
Add output files |
|
Finish up the step. |
|
Save the cell width field on a lon/lat grid to |
|
|
A step for creating a quasi-uniform JIGSAW mesh with a constant approximate cell width. |
Add JIGSAW options based on config options |
|
Run this step of the test case |
|
A function for creating cell width array for this mesh on a regular latitude-longitude grid. |
|
Build the JIGSAW mesh. |
|
|
A step for creating an icosahedral JIGSAW mesh |
Add JIGSAW options based on config options |
|
Run this step of the test case |
|
Make the JIGSAW mesh. |
|
A function for creating cell width array for this mesh on a regular latitude-longitude grid. |
|
|
Find the number of subdivisions of an icosahedron to achieve a resolution as close as possible to |
|
Get the approximate cell width for an icosahedral mesh given either a number of subdivisions of the icosahedron. |
model¶
|
Run the model after determining the number of tasks and threads |
|
Partition the domain for the requested number of tasks |
|
Make a graph file from the MPAS mesh for use in the Metis graph partitioning software |
mpas_cores¶
Get a list of all collections of tests for MPAS cores |
parallel¶
|
Get the number of total cores and nodes available for running steps |
|
If the system has Slurm, find out the |
|
Run a subprocess with the given command-line arguments and resources |
provenance¶
|
Write a file with provenance, such as the git version, conda packages, command, and test cases, to the work directory |
validate¶
|
Compare variables between files in the current test case and/or with the baseline results. |
|
Compare variables between files in the current test case and/or with the baseline results. |