cape.pycart.options.Archive: pyCart Archiving Options

Options interface for archiving one or more Cart3D solutions that was managed by pyCart. Archiving generally means two tasks:

  1. Copy requested files to a backup location (such as a tape drive or other external location), possibly in groups that have been put into tar balls (usually .tar so that archives can be modified later).

  2. Clean up run folder after archiving by deleting files unnecessary for post-processing

For the most part, cases can only be archived after it has the status PASS. See cape.cntl.Cntl.DisplayStatus() and the run matrix file format for more information, but generally this requires the case running at least the requested number of iterations and marked with a p in the run matrix file.

However, there are a few options that delete files as solutions complete phases. These options are intended for automatically deleting previous check-point files as more become available. For example, it is usually acceptable to keep only two solution files around, so deleting the third newest solution file is allowable.

Archiving actions can be issued from the command line via the commands such as the following. Subsetting options are all available to this command.

$ pycart --archive [OPTIONS]
See Also:
class cape.pycart.options.Archive.Archive(**kw)

Dictionary-based interfaced for options specific to folder management

Call:
>>> opts = Archive(**kw)
Versions:
  • 2015-09-28 @ddalle: Subclassed to CAPE

  • 2016-03-01 @ddalle: Upgraded custom settings

apply_ArchiveTemplate()

Apply named template to set default files to delete/archive

Call:
>>> opts.apply_ArchiveTemplate()
Inputs:
opts: pyCart.options.Options

Options interface

Versions:
  • 2016-02-29 @ddalle: First version

get_TarAdapt()

Return the archive format for adapt folders

Call:
>>> fmt = opts.get_TarAdapt()
Inputs:
opts: pyCart.options.Options

Options interface

Outputs:
fmt: "" | {"tar"} | "gzip" | "bz2"

Archive format

Versions:
  • 2015-01-10 @ddalle: First version

get_TarViz()

Return the archive format for visualization files

Call:
>>> fmt = opts.get_TarViz()
Inputs:
opts: pyCart.options.Options

Options interface

Outputs:
fmt: "" | {"tar"} | "gzip" | "bz2"

Archive format

Versions:
  • 2015-01-10 @ddalle: First version

get_nCheckPoint(i=None)

Return the number of check point files to keep

Call:
>>> nchk = opts.get_nCheckPoint(i=None)
Inputs:
opts: pyCart.options.Options

Options interface

i: int

Phase number

Outputs:
nchk: int

Number of check files to keep (all if 0)

Versions:
  • 2015-01-10 @ddalle: First version

set_TarAdapt(fmt='tar')

Set the archive format for adapt folders

Call:
>>> opts.set_TarAdapt(fmt)
Inputs:
opts: pyCart.options.Options

Options interface

fmt: "" | {"tar"} | "gzip" | "bz2"

Archive format

Versions:
  • 2015-01-10 @ddalle: First version

set_TarViz(fmt='tar')

Set the archive format for visualization files

Call:
>>> opts.set_TarViz(fmt)
Inputs:
opts: pyCart.options.Options

Options interface

fmt: "" | {"tar"} | "gzip" | "bz2"

Archive format

Versions:
  • 2015-01-10 @ddalle: First version

set_nCheckPoint(nchk=2, i=None)

Set the number of check point files to keep

Call:
>>> opts.set_nCheckPoint(nchk)
Inputs:
opts: pyCart.options.Options

Options interface

nchk: int

Number of check files to keep (all if 0)

i: int

Phase number

Versions:
  • 2015-01-10 @ddalle: First version

cape.pycart.options.Archive.auto_Archive(opts)

Automatically convert dict to cape.pycart.options.Archive.Archive

Call:
>>> opts = auto_Archive(opts)
Inputs:
opts: dict

Dict of either global, “RunControl” or “Archive” options

Outputs:
opts: pyCart.options.Archive.Archive

Instance of archiving options

Versions:
  • 2016-02-29 @ddalle: First version