cape.pycart.options.archiveopts: Cart3D archiving options

This module provides Cart3D-specific modifications to the base archiving options module.

See also:
class cape.pycart.options.archiveopts.ArchiveOpts(*args, **kw)

Archiving options interface

Call:
>>> opts = ArchiveOpts(**kw)
Versions:
  • 2015-09-28 @ddalle: Version 1.0

  • 2016-03-01 @ddalle: Version 1.1; custom settings

  • 2022-10-21 @ddalle: Version 2.0; use cape.optdict

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: Version 1.0

get_TarAdapt(j=None, i=None, **kw)

Get archive option for adapt folders

Call:
>>> TarAdapt = opts.get_TarAdapt(j=None, i=None, **kw)
Inputs:
opts: ArchiveOpts

options interface

j: {None} | int

Phase index; use None to just return v

i: {None} | int | np.ndarray

opts.x index(es) to use with @expr, @map, etc.

vdef: {None} | object

Manual default

mode: {None} | 0 | 1 | 2 | 3

Warning mode code

0:

no checks

1:

validate silently

2:

validate and show warnings

3:

raise an exception if invalid

ring: {opts._optring[key]} | True | False

Override option to loop through phase inputs

listdepth: {0} | int > 0

Depth of list to treat as a scalar

x: {None} | dict

Ref conditions to use with @expr, @map, etc.; often a run matrix; used in combination with i

sample: {True} | False

Apply j, i, and other settings recursively if output is a list or dict

Outputs:
TarAdapt: 'full' | 'none' | {'restart'}

archive option for adapt folders

get_TarViz(j=None, i=None, **kw)

Get archive option for visualization files

Call:
>>> TarViz = opts.get_TarViz(j=None, i=None, **kw)
Inputs:
opts: ArchiveOpts

options interface

j: {None} | int

Phase index; use None to just return v

i: {None} | int | np.ndarray

opts.x index(es) to use with @expr, @map, etc.

vdef: {None} | object

Manual default

mode: {None} | 0 | 1 | 2 | 3

Warning mode code

0:

no checks

1:

validate silently

2:

validate and show warnings

3:

raise an exception if invalid

ring: {opts._optring[key]} | True | False

Override option to loop through phase inputs

listdepth: {0} | int > 0

Depth of list to treat as a scalar

x: {None} | dict

Ref conditions to use with @expr, @map, etc.; often a run matrix; used in combination with i

sample: {True} | False

Apply j, i, and other settings recursively if output is a list or dict

Outputs:
TarViz: 'full' | 'none' | {'restart'}

archive option for visualization files

get_nCheckPoint(j=None, i=None, **kw)

Get number of check point files to keep

Call:
>>> nCheckPoint = opts.get_nCheckPoint(j=None, i=None, **kw)
Inputs:
opts: ArchiveOpts

options interface

j: {None} | int

Phase index; use None to just return v

i: {None} | int | np.ndarray

opts.x index(es) to use with @expr, @map, etc.

vdef: {None} | object

Manual default

mode: {None} | 0 | 1 | 2 | 3

Warning mode code

0:

no checks

1:

validate silently

2:

validate and show warnings

3:

raise an exception if invalid

ring: {opts._optring[key]} | True | False

Override option to loop through phase inputs

listdepth: {0} | int > 0

Depth of list to treat as a scalar

x: {None} | dict

Ref conditions to use with @expr, @map, etc.; often a run matrix; used in combination with i

sample: {True} | False

Apply j, i, and other settings recursively if output is a list or dict

Outputs:
nCheckPoint: {2} | int

number of check point files to keep

init_post()

Initialization hook for OVERFLOW archiving options

Call:
>>> opts.init_post()
Inputs:
opts: ArchiveOpts

Archiving options interface

Versions:
  • 2022-10-21 @ddalle: Version 1.0

set_TarAdapt(v, j=None, mode=None)

Get archive option for adapt folders

Call:
>>> opts.set_TarAdapt(TarAdapt, j=None, i=None, **kw)
Inputs:
opts: ArchiveOpts

options interface

TarAdapt: 'full' | 'none' | {'restart'}

archive option for adapt folders

j: {None} | int

Phase index; use None to just return v

mode: {None} | 0 | 1 | 2 | 3

Warning mode code

0:

no checks

1:

validate silently

2:

validate and show warnings

3:

raise an exception if invalid

listdepth: {0} | int > 0

Depth of list to treat as a scalar

set_TarViz(v, j=None, mode=None)

Get archive option for visualization files

Call:
>>> opts.set_TarViz(TarViz, j=None, i=None, **kw)
Inputs:
opts: ArchiveOpts

options interface

TarViz: 'full' | 'none' | {'restart'}

archive option for visualization files

j: {None} | int

Phase index; use None to just return v

mode: {None} | 0 | 1 | 2 | 3

Warning mode code

0:

no checks

1:

validate silently

2:

validate and show warnings

3:

raise an exception if invalid

listdepth: {0} | int > 0

Depth of list to treat as a scalar

set_nCheckPoint(v, j=None, mode=None)

Get number of check point files to keep

Call:
>>> opts.set_nCheckPoint(nCheckPoint, j=None, i=None, **kw)
Inputs:
opts: ArchiveOpts

options interface

nCheckPoint: {2} | int

number of check point files to keep

j: {None} | int

Phase index; use None to just return v

mode: {None} | 0 | 1 | 2 | 3

Warning mode code

0:

no checks

1:

validate silently

2:

validate and show warnings

3:

raise an exception if invalid

listdepth: {0} | int > 0

Depth of list to treat as a scalar

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

Automatically convert dict to pyover ArchiveOpts

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

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

Outputs:
opts: ArchiveOpts

Instance of archiving options

Versions:
  • 2016-02-29 @ddalle: Version 1.0

  • 2022-10-21 @ddalle: Version 2.0; generic call