cape.pycart.manage: Manage pyCart case folders

This module is a derivative of the main solution folder management module cape.manage. It provides Cart3D-specific versions of the three top-level functions, which each correspond to a primary command-line option.

Function

Command-line

CleanFolder()

--clean

ArchiveFolder()

--archive

SkeletonFolder()

--skeleton

The Cart3D-specific versions of these commands use the function pyCart.options.Archive.auto_Archive(), which apply the default settings appropriate to pyCart. Because this module was the first folder management version created, it does not rely heavily on cape.manage. This module sets

# Subdirectories
fsub = ['adapt??']

which tells the management functions to also look inside the adaptation solutions while archiving if they are present.

The --unarchive command does not require any specific customizations for Cart3D, and the generic version of cape.manage.UnarchiveFolder() is just called directly.

See also:
cape.pycart.manage.ArchiveFolder(opts)

Archive a folder to a backup location and clean up the folder if requested

Call:
>>> pyCart.manage.ArchiveFolder(opts)
Inputs:
opts: pyCart.options.Options

Options interface of pyCart management interface

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

cape.pycart.manage.CheckArchive(ftar)

Check if an archive already exists

Call:
>>> q = pyCart.manage.CheckArchive(ftar)
Inputs:
ftar: str

Full path to archive folder

Outputs:
q: bool

Returns True if ftar exists

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

cape.pycart.manage.ClearCheck(n=1)

Clear old check.????? and check.??????.td

Call:
>>> pyCart.manage.ClearCheck(n=1)
Inputs:
n: int

Keep the last n check points.

Versions:
  • 2014-12-31 @ddalle: First version

  • 2015-01-10 @ddalle: Added n setting

cape.pycart.manage.ClearCheck_iStart(nkeep=1, istart=0)

Clear check files that were created since iteration istart

Call:
>>> pyCart.manage.ClearCheck_iStart(nkeep=1, istart=0)
Inputs:
nkeep: int

Number of most recent check files to keep

istart: int

Do not delete check files prior to iteration istart

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

cape.pycart.manage.ExpandAdapt(opts)

Expand adaptXX.tar` files

Call:
>>> pyCart.manage.ExpandAdapt(fmt="tar")
Inputs:
opts: pyCart.options.Options

Options interface

opts.get_ArchiveFormat(): {"tar"} | "gzip" | "bz2"

Format, can be ‘tar’, ‘gzip’, or ‘bzip’

Versions:
  • 2014-11-12 @ddalle: First version

  • 2015-01-10 @ddalle: Added format as an option

cape.pycart.manage.ManageFilesPost(opts=None)

Delete or group files and folders after creating archive

Call:
>>> pyCart.manage.ManageFilesPost(opts=None)
Inputs:
opts: pyCart.options.Options | dict

Options interface for archiving

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

cape.pycart.manage.ManageFilesPre(opts=None)

Delete or group files and folders before creating archive

Call:
>>> pyCart.manage.ManageFilesPre(opts=None)
Inputs:
opts: pyCart.options.Options | dict

Options interface for archiving

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

cape.pycart.manage.ManageFilesProgress(opts=None)

Delete or group files and folders at end of each run

Call:
>>> pyCart.manage.ManageFilesProgress(opts=None)
Inputs:
opts: pyCart.options.Options | dict

Options interface for archiving

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

cape.pycart.manage.SkeletonFolder()

Clean up a folder of everything but the essentials

Call:
>>> pyCart.manage.SkeletonFolder()
Versions:
  • 2015-01-11 @ddalle: First version

cape.pycart.manage.TarAdapt(opts)

Replace adaptXX folders with a tarball except for most recent

For example, if there are 3 adaptations in the current folder, the following substitutions will be made.

  • adapt00/ –> adapt00.tar

  • adapt01/ –> adapt01.tar

  • adapt02/ –> adapt02.tar

  • adapt03/

The most recent adaptation is left untouched, and the old folders are deleted.

Call:
>>> pyCart.manage.TarAdapt(opts)
Inputs:
opts: pyCart.options.Options

Options interface

opts.get_TarAdapt(): {"restart"} | "full" | "none"

Archiving action to take

opts.get_ArchiveFormat(): {"tar"} | "gzip" | "bz2"

Format, can be ‘tar’, ‘gzip’, or ‘bzip’

Versions:
  • 2014-11-12 @ddalle: First version

  • 2015-01-10 @ddalle: Added format as an option

  • 2015-12-02 @ddalle: Options

cape.pycart.manage.TarViz(opts)

Add all visualization surface and cut plane TecPlot files to tar balls

This reduces file count by tarring Components.i.*.plt and cutPlanes.*.plt.

Call:
>>> pyCart.manage.TarViz(opts)
Inputs:
opts: pyCart.options.Options

Options interface

opts.get_TarViz(): "restart" | {"full"} | "none"

Archiving action to take

opts.get_ArchiveFormat(): {"tar"} | "gzip" | "bz2"

Format, can be ‘tar’, ‘gzip’, or ‘bzip’

Versions:
  • 2014-12-18 @ddalle: First version

  • 2015-01-10 @ddalle: Added format as an option