cape.cfdx.archive.Archive: Case archiving options

This module provides a class to access options relating to archiving folders that were used to run CFD analysis.

The class provided in this module, cape.options.Archive.Archive, is loaded in the "RunControl" section of the JSON file and the cape.options.runControl.RunControl class.

class cape.cfdx.options.Archive.Archive

Dictionary-based interfaced for options specific to folder management

Call:
>>> opts = cape.options.Archive.Archive(**kw)
Inputs:
kw: dict

Dictionary of archive options

Outputs:
opts: cape.options.Archive.Archive

Archive options interface

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

add_ArchiveArchiveFiles(farch)

Add to the list of files to copy to archive

Call:
>>> opts.add_ArchiveArchiveFiles(farch)
>>> opts.add_ArchiveArchiveFiles(larch)
Inputs:
opts: cape.options.Options

Options interface

farch: str

File or file glob to archive

larch: list[str]

List of file or file globs to add to list

Versions:
  • 2016-12-09 @ddalle: First version

add_ArchivePostDeleteDirs(fpost)

Add to the list of folders to delete after archiving

Call:
>>> opts.add_ArchivePostDeleteDirs(fpost)
>>> opts.add_ArchivePostDeleteDirs(lpost)
Inputs:
opts: cape.options.Options

Options interface

fpost: str

Folder or file glob to add to list

lpost: str

List of folders or globs of folders to add to list

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

add_ArchivePostDeleteFiles(fpost)

Add to the list of files to delete after archiving

Call:
>>> opts.add_ArchivePostDeleteFiles(fpost)
>>> opts.add_ArchivePostDeleteFiles(lpost)
Inputs:
opts: cape.options.Options

Options interface

fpost: str

File or file glob to add to list

lpost: list[str]

List of files or file globs to add to list

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

add_ArchivePostTarDirs(fpost)

Add to the folders of groups to tar after archiving

Call:
>>> opts.add_ArchivePostTarDirs(fpost)
>>> opts.add_ArchivePostTarDirs(lpost)
Inputs:
opts: cape.options.Options

Options interface

fpost: str

Folder or folder glob to add to list

lpost: str

List of folders or globs of folders to add to list

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

add_ArchivePostTarGroups(fpost)

Add to the list of groups to tar before archiving

Call:
>>> opts.add_ArchivePostTarGroups(fpost)
>>> opts.add_ArchivePostTarGroups(lpost)
Inputs:
opts: cape.options.Options

Options interface

fpost: str

File glob to add to list

lpost: str

List of globs of files to add to list

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

add_ArchivePostUpdateFiles(fpost)

Add to dict of files of which to keep only n

Call:
>>> opts.add_ArchivePostUpdateFiles(fpost)
>>> opts.add_ArchivePostUpdateFiles(lpost)
Inputs:
opts: cape.options.Options

Options interface

fpost: str

Folder or folder glob to add to list

lpost: str

List of folders or globs of folders to add to list

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

add_ArchivePreDeleteDirs(fpre)

Add to the list of folders to delete before archiving

Call:
>>> opts.add_ArchivePreDeleteDirs(fpre)
>>> opts.add_ArchivePreDeleteDirs(lpre)
Inputs:
opts: cape.options.Options

Options interface

fpre: str

Folder or file glob to add to list

lpre: str

List of folders or globs of folders to add to list

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

add_ArchivePreDeleteFiles(fpre)

Add to the list of files to delete before archiving

Call:
>>> opts.add_ArchivePreDeleteFiles(fpre)
>>> opts.add_ArchivePreDeleteFiles(lpre)
Inputs:
opts: cape.options.Options

Options interface

fpre: str

File or file glob to add to list

lpre: list[str]

List of files or file globs to add to list

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

add_ArchivePreTarDirs(fpre)

Add to the folders of groups to tar before archiving

Call:
>>> opts.add_ArchivePreTarDirs(fpre)
>>> opts.add_ArchivePreTarDirs(lpre)
Inputs:
opts: cape.options.Options

Options interface

fpre: str

Folder or folder glob to add to list

lpre: str

List of folders or globs of folders to add to list

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

add_ArchivePreTarGroups(fpre)

Add to the list of groups to tar before archiving

Call:
>>> opts.add_ArchivePreTarGroups(fpre)
>>> opts.add_ArchivePreTarGroups(lpre)
Inputs:
opts: cape.options.Options

Options interface

fpre: str

File glob to add to list

lpre: str

List of globs of files to add to list

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

add_ArchivePreUpdateFiles(fpre)

Add to dict of files of which to keep only n

Call:
>>> opts.add_ArchivePreUpdateFiles(fpre)
>>> opts.add_ArchivePreUpdateFiles(lpre)
Inputs:
opts: cape.options.Options

Options interface

fpre: str

Folder or folder glob to add to list

lpre: str

List of folders or globs of folders to add to list

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

add_ArchiveProgressArchiveFiles(fpro)

Add to dict of files of which to keep only n

Call:
>>> opts.add_ArchiveProgressArchiveFiles(fpro)
>>> opts.add_ArchiveProgressArchiveFiles(lpro)
Inputs:
opts: cape.options.Options

Options interface

fpro: str

Folder or folder glob to add to list

lpo: str

List of folders or globs of folders to add to list

Versions:
  • 2016-03-14 @ddalle: First version

add_ArchiveProgressDeleteDirs(fpro)

Add to the list of folders to delete at end of each run

Call:
>>> opts.add_ArchiveProgressDeleteDirs(fpro)
Inputs:
opts: cape.options.Options

Options interface

fpro: str | list[str]

File glob or list of file globs to add

Versions:
  • 2016-03-14 @ddalle: First version

add_ArchiveProgressDeleteFiles(fpro)

Add to the list of files to delete at end of each run

Call:
>>> opts.add_ArchiveProgressDeleteFiles(fpro)
Inputs:
opts: cape.options.Options

Options interface

fpro: str | list[str]

File glob or list of file globs to add

Versions:
  • 2016-03-14 @ddalle: First version

add_ArchiveProgressTarDirs(fpro)

Add to the list of folders to tar at the end of each run

Call:
>>> opts.add_ArchiveProgressTarDirs(fpro)
Inputs:
opts: cape.options.Options

Options interface

fpro: str | list[str]

File glob or list of file globs to add

Versions:
  • 2016-03-14 @ddalle: First version

add_ArchiveProgressTarGroups(fpro)

Add to the list of file groups to tar at the end of each run

Call:
>>> opts.add_ArchiveProgressTarGroups(fpro)
Inputs:
opts: cape.options.Options

Options interface

fpro: str | list[str]

File glob or list of file globs to add

Versions:
  • 2016-03-14 @ddalle: First version

add_ArchiveProgressUpdateFiles(fpro)

Add to the list of files to update at end of each run

Call:
>>> opts.add_ArchiveProgressUpdateFiles(fpro)
Inputs:
opts: cape.options.Options

Options interface

fpro: str | list[str]

File glob or list of file globs to add

Versions:
  • 2016-03-14 @ddalle: First version

add_ArchiveSkeletonDirs(fskel)

Add to the list of folders to keep after skeleton action

Call:
>>> opts.add_ArchiveSkeletonKeepFiles(fskel)
Inputs:
opts: cape.options.Options

Options interface

fskel: str | list[str]

File glob or list of file globs to add

Versions:
  • 2017-12-14 @ddalle: First version

add_ArchiveSkeletonFiles(fskel)

Add to the list of files to keep after skeleton action

Call:
>>> opts.add_ArchiveSkeletonKeepFiles(fskel)
Inputs:
opts: cape.options.Options

Options interface

fskel: str | list[str]

File glob or list of file globs to add

Versions:
  • 2017-12-13 @ddalle: First version

add_ArchiveSkeletonTailFiles(fskel)

Add to the list of file-tailing instructions for skeleton action

Call:
>>> opts.add_ArchiveSkeletonTailFiles(fskel)
Inputs:
opts: cape.options.Options

Options interface

fskel: dict | list (dict)

Additional file tail instructions

Versions:
  • 2017-12-13 @ddalle: First version

add_ArchiveSkeletonTarDirs(fskel)

Add to the list of folder-tarring instructions for skeleton action

Call:
>>> opts.add_ArchiveSkeletonTarDirs(fskel)
Inputs:
opts: cape.options.Options

Options interface

fskel: dict | list (dict)

Additional folders to tar

Versions:
  • 2017-12-13 @ddalle: First version

add_to_key(key, fpre)

Add to the folders of groups to tar before archiving

Call:
>>> opts.add_to_key(key, fpre)
>>> opts.add_to_key(key, lpre)
Inputs:
opts: cape.options.Options

Options interface

key: str

Name of the key to update

fpre: str

Folder or folder glob to add to list

lpre: str

List of folders or globs of folders to add to list

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

apply_umask()

Apply the permissions filter

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

Options interface

Versions:
  • 2015-09-27 @ddalle: First version

get_ArchiveAction()

Return the action to take after finishing a case

Call:
>>> fcmd = opts.get_ArchiveAction()
Inputs:
opts: pyCart.options.Options

Options interface

Outputs:
fcmd: {“”} | “skeleton” | “rm” | “archive”

Type of archiving action to take

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

get_ArchiveArchiveFiles()

Get list of files to copy to archive, in addition to tar balls

Call:
>>> fglob = opts.get_ArchiveArchiveFiles()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
fglob: list[str]

List of file wild cards to delete after archiving

Versions:
  • 2016-12-09 @ddalle: First version

get_ArchiveCmd()

Get archiving command

Call:
>>> cmd = opts.get_ArchiveCmd()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
cmd: list[str]

Tar command and appropriate flags

Versions:
  • 2016-03-01 @ddalle: First version

get_ArchiveExtension()

Get archive extension

Call:
>>> ext = opts.get_ArchiveExtenstion()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
ext: str | {tar} | tgz | bz | bz2 | zip

Archive extension

Versions:
  • 2016-03-01 @ddalle: First version

get_ArchiveFolder()

Return the path to the archive

Call:
>>> fdir = opts.get_ArchiveFolder()
Inputs:
opts: pyCart.options.Options

Options interface

Outputs:
fdir: str

Path to root directory of archive

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

get_ArchiveFormat()

Return the format for folder archives

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

Options interface

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

Archive format

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

get_ArchivePostDeleteDirs()

Get list of folders to delete after archiving

Call:
>>> fglob = opts.get_ArchivePostDeleteDirs()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
fglob: list[str]

List of globs of folders to delete after archiving

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

get_ArchivePostDeleteFiles()

Get list of files to delete after archiving

Call:
>>> fglob = opts.get_ArchivePreDeleteFiles()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
fglob: list[str]

List of file wild cards to delete after archiving

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

get_ArchivePostTarDirs()

Get list of folders to tar after archiving

Call:
>>> fglob = opts.get_ArchivePostTarDirs()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
fglob: list[str]

List of globs of folders to delete fter archiving

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

get_ArchivePostTarGroups()

Get list of files to tar prior to archiving

Call:
>>> fglob = opts.get_ArchivePostTarGroups()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
fglob: list[str]

List of file wild cards to delete before archiving

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

get_ArchivePostUpdateFiles()

Get dict of files of which to keep only n

Call:
>>> fglob = opts.get_ArchivePostUpdateFiles()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
fglob: list[str]

List of file wild cards to delete before archiving

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

get_ArchivePreDeleteDirs()

Get list of folders to delete before archiving

Call:
>>> fglob = opts.get_ArchivePreDeleteDirs()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
fglob: list[str]

List of file wild cards to delete before archiving

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

get_ArchivePreDeleteFiles()

Get list of files to delete before archiving

Call:
>>> fglob = opts.get_ArchivePreDeleteFiles()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
fglob: list[str]

List of file wild cards to delete before archiving

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

get_ArchivePreTarDirs()

Get list of folders to tar prior to archiving

Call:
>>> fglob = opts.get_ArchivePreTarDirs()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
fglob: list[str]

List of file wild cards to delete before archiving

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

get_ArchivePreTarGroups()

Get list of files to tar prior to archiving

Call:
>>> fglob = opts.get_ArchivePreTarGroups()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
fglob: list[str]

List of file wild cards to delete before archiving

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

get_ArchivePreUpdateFiles()

Get dict of files of which to keep only n

Call:
>>> fglob = opts.get_ArchivePreUpdateFiles()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
fglob: list[str]

List of file wild cards to delete before archiving

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

get_ArchiveProgressArchiveFiles()

Get dict of files to archive at end of each run

Call:
>>> fglob = opts.get_ArchiveProgressArchiveFiles()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
fglob: list[str]

List of file wild cards to delete before archiving

Versions:
  • 2016-03-14 @ddalle: First version

get_ArchiveProgressDeleteDirs()

Get list of folders to delete at end of each run

Call:
>>> fglob = opts.get_ArchiveProgressDeleteDirs()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
fglob: list[str]

List of globs of folder names to delete at the end of each run

Versions:
  • 2016-03-14 @ddalle: First version

get_ArchiveProgressDeleteFiles()

Get list of files to delete at end of each run

Call:
>>> fglob = opts.get_ArchiveProgressDeleteFiles()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
fglob: list[str]

List of file globs to delete at the end of each run

Versions:
  • 2016-03-14 @ddalle: First version

get_ArchiveProgressTarDirs()

Get list of folders to tar at the end of each run

Call:
>>> fglob = opts.get_ArchiveProgressTarDirs()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
fglob: list[str]

List of globs of folder names to delete at the end of each run

Versions:
  • 2016-03-14 @ddalle: First version

get_ArchiveProgressTarGroups()

Get list of file groups to tar at the end of each run

Call:
>>> fglob = opts.get_ArchiveProgressTarGroups()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
fglob: list[str]

List of globs of folder names to delete at the end of each run

Versions:
  • 2016-03-14 @ddalle: First version

get_ArchiveProgressUpdateFiles()

Get list of files to update at end of each run

Call:
>>> fglob = opts.get_ArchiveProgressUpdateFiles()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
fglob: list[str]

List of globs of folder names to delete at the end of each run

Versions:
  • 2016-03-14 @ddalle: First version

get_ArchiveSkeletonDirs()

Get the list of folders to keep during skeleton action

Call:
>>> fglob = opts.get_ArchiveSkeletonDirs()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
fglob: list[str]

List of file globs to keep around after archiving

Versions:
  • 2017-12-14 @ddalle: First version

get_ArchiveSkeletonFiles()

Get the list of files to keep during skeleton action

Call:
>>> fglob = opts.get_ArchiveSkeletonFiles()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
fglob: list[str]

List of file globs to keep around after archiving

Versions:
  • 2017-12-13 @ddalle: First version

get_ArchiveSkeletonTailFiles()

Get the list of files to tail before deletion during skeleton action

Call:
>>> fglob = opts.get_ArchiveSkeletonTailFiles()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
fglob: list (str | dict)

List of file globs/dicts to tail before deletion

Versions:
  • 2017-12-13 @ddalle: First version

get_ArchiveSkeletonTarDirs()

Get list of folders to tar before deletion during skeleton action

Call:
>>> fglob = opts.get_ArchiveSkeletonTarDirs()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
fglob: list[str]

List of folders to tar and then delete during skeleton action

Versions:
  • 2017-12-13 @ddalle: First version

get_ArchiveTemplate()

Return the archive type; determines what is deleted before archiving

Note that all types except "full" will delete files from the working folder before archiving. However, archiving actions, including the preliminary deletions, only take place if the case is marked PASS.

  • "full": Archives all contents of run directory

  • "best": Deletes all previous adaptation folders

  • "viz": Deletes all Mesh*.c3d files and check files

  • "hist": Deletes all mesh, tri, and TecPlot files

Call:
>>> atype = opts.get_ArchiveType()
Inputs:
opts: pyCart.options.Options

Options interface

Outputs:
fcmd: {“full”} | “viz” | “best” | “hist”

Name of archive type

Versions:
  • 2015-02-16 @ddalle: First version

get_ArchiveType()

Return the archive type; whether or not to save as a single tar ball

  • "full": Archives all contents of the case as one tar ball

  • "sub": Archive case as group of tar balls/files

Call:
>>> atype = opts.get_ArchiveType()
Inputs:
opts: pyCart.options.Options

Options interface

Outputs:
fcmd: {“full”} | “sub”

Name of archive type

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

get_RemoteCopy()

Return the command used for remote copying

Call:
>>> fcmd = opts.get_RemoteCopy()
Inputs:
opts: pyCart.options.Options

Options interface

Outputs:
fcmd: {“scp”} | “rsync” | “shiftc –wait”

Command to use for archiving

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

get_TarPBS()

Return the archive format for adapt folders

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

Options interface

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

Archive format

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

get_UnarchiveCmd()

Get command to unarchive

Call:
>>> cmd = opts.get_UnarchiveCmd()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
cmd: list[str]

Untar command and appropriate flags

Versions:
  • 2016-03-01 @ddalle: First version

get_dmask()

Get the permissions to assign to new folders

Call:
>>> dmask = opts.get_dmask()
Inputs:
opts pyCart.options.Options

Options interface

Outputs:
umask: int

File permissions mask

Versions:
  • 2015-09-27 @ddalle: First version

get_umask()

Get the current file permissions mask

The default value is the read from the system

Call:
>>> umask = opts.get_umask(umask=None)
Inputs:
opts pyCart.options.Options

Options interface

Outputs:
umask: oct

File permissions mask

Versions:
  • 2015-09-27 @ddalle: First version

mkdir(fdir)

Make a directory with the correct permissions

Call:
>>> opts.mkdir(fdir)
Inputs:
opts: cape.options.Options

Options interface

fdir: str

Directory to create

Versions:
  • 2015-09-27 @ddalle: First version

set_ArchiveAction(fcmd='full')

Set the action to take after finishing a case

Call:
>>> opts.set_ArchiveAction(fcmd)
Inputs:
opts: pyCart.options.Options

Options interface

fcmd: {“”} | “skeleton” | “rm” | “archive”

Type of archiving action to take

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

set_ArchiveFolder(fdir='')

Set the path to the archive

Call:
>>> opts.set_ArchiveFolder(fdir)
Inputs:
opts: pyCart.options.Options

Options interface

fdir: str

Path to root directory of archive

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

set_ArchiveFormat(fmt='tar')

Set the format for folder archives

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

Options interface

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

Archive format

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

set_ArchiveTemplate(atype='full')

Set the archive type; determines what is deleted before archiving

Call:
>>> opts.set_ArchiveTemplate(atype)
Inputs:
opts: pyCart.options.Options

Options interface

atype: {“full”} | “viz” | “best” | “hist”

Name of archive template

Versions:
  • 2015-02-16 @ddalle: First version

  • 2016-02-29 @ddalle: Moved from previous ArchiveType

set_ArchiveType(atype='full')

Set the archive type; determines what is deleted before archiving

Call:
>>> opts.set_ArchiveType(atype)
Inputs:
opts: pyCart.options.Options

Options interface

atype: {“full”} | “sub”

Name of archive type

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

set_RemoteCopy(fcmd='scp')

Set the command used for remote copying

Call:
>>> opts.set_RemoteCopy(fcmd)
Inputs:
opts: pyCart.options.Options

Options interface

fcmd: {“scp”} | “rsync” | “shiftc”

Type of archiving action to take

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

set_TarPBS(fmt='tar')

Set the archive format for adapt folders

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

Options interface

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

Archive format

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

set_umask(umask)

Set the current file permissions mask

Call:
>>> umask = opts.get_umask(umask=None)
Inputs:
opts pyCart.options.Options

Options interface

Outputs:
umask: oct

File permissions mask

Versions:
  • 2015-09-27 @ddalle: First version

cape.cfdx.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