cape.pylava.options: Options interface for LAVA

cape.pylava.options: Options interface for cape,pylava

This is the LAVA-specific implementation of the CAPE options package, based on

class cape.pylava.options.Options(*args, **kw)

Options interface for cape.pylava

Call:
>>> opts = Options(fname=None, **kw)
Inputs:
fname: str

File to be read as a JSON file with comments

kw: dict

Dictionary of raw options

Outputs:
opts: cape.pylava.options.Options

Options interface

Versions:
  • 2024-09-30 @sneuhoff: v1.0

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

Get template for LAVA-Cartesion input file

Call:
>>> CartInputFile = opts.get_CartInputFile(j=None, i=None, **kw)
Inputs:
opts: Options

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:
CartInputFile: {None} | str

template for LAVA-Cartesion input file

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

Get LAVA architecture to run

Call:
>>> LAVASolver = opts.get_LAVASolver(j=None, i=None, **kw)
Inputs:
opts: RunControlOpts

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:
LAVASolver: 'cartesian' | {'curvilinear'} | 'unstructured'

LAVA architecture to run

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

Get folder from which to copy/link mesh files

Call:
>>> ConfigDir = opts.get_MeshConfigDir(j=None, i=None, **kw)
Inputs:
opts: MeshOpts

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:
ConfigDir: {None} | str

folder from which to copy/link mesh files

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

Get template LAVA input file (YAML/JSON)

Call:
>>> RunYAMLFile = opts.get_RunYAMLFile(j=None, i=None, **kw)
Inputs:
opts: Options

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:
RunYAMLFile: {None} | str

template LAVA input file (YAML/JSON)

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

Get path to superlava executable

Call:
>>> executable = opts.get_lava_executable(j=None, i=None, **kw)
Inputs:
opts: SuperlavaOpts

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:
executable: {'superlava'} | str

path to superlava executable

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

Get name of LAVA YAML file to use

Call:
>>> yamlfile = opts.get_lava_yamlfile(j=None, i=None, **kw)
Inputs:
opts: SuperlavaOpts

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:
yamlfile: {'run.yaml'} | str

name of LAVA YAML file to use

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

Get value of option “superlava”

Call:
>>> superlava = opts.get_superlava(j=None, i=None, **kw)
Inputs:
opts: RunControlOpts

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:
superlava: {None} | object

value of option “superlava”

init_post()

Initialization hook for Options

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

Options interface

Versions:
  • 2024-08-05 @sneuhoff: Version 1.0

select_runinputs_phase(j: int = 0, **kw)

Sample namelist at particular conditions

Call:
>>> d = opts.select_namelist(i)
Inputs:
opts: Options

Options interface

j: {0} | int

Phase index

Outputs:
d: dict

Namelist sampled for phase and case indices

Versions:
  • 2015-10-18 @ddalle: v1.0

  • 2023-05-16 @ddalle: v2.0; pyfun > select_namelist

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

Get template for LAVA-Cartesion input file

Call:
>>> opts.set_CartInputFile(CartInputFile, j=None, i=None, **kw)
Inputs:
opts: Options

options interface

CartInputFile: {None} | str

template for LAVA-Cartesion input file

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_LAVASolver(v, j=None, mode=None)

Get LAVA architecture to run

Call:
>>> opts.set_LAVASolver(LAVASolver, j=None, i=None, **kw)
Inputs:
opts: RunControlOpts

options interface

LAVASolver: 'cartesian' | {'curvilinear'} | 'unstructured'

LAVA architecture to run

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_MeshConfigDir(v, j=None, mode=None)

Get folder from which to copy/link mesh files

Call:
>>> opts.set_MeshConfigDir(ConfigDir, j=None, i=None, **kw)
Inputs:
opts: MeshOpts

options interface

ConfigDir: {None} | str

folder from which to copy/link mesh 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_RunYAMLFile(v, j=None, mode=None)

Get template LAVA input file (YAML/JSON)

Call:
>>> opts.set_RunYAMLFile(RunYAMLFile, j=None, i=None, **kw)
Inputs:
opts: Options

options interface

RunYAMLFile: {None} | str

template LAVA input file (YAML/JSON)

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_lava_executable(v, j=None, mode=None)

Get path to superlava executable

Call:
>>> opts.set_lava_executable(executable, j=None, i=None, **kw)
Inputs:
opts: SuperlavaOpts

options interface

executable: {'superlava'} | str

path to superlava executable

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_lava_yamlfile(v, j=None, mode=None)

Get name of LAVA YAML file to use

Call:
>>> opts.set_lava_yamlfile(yamlfile, j=None, i=None, **kw)
Inputs:
opts: SuperlavaOpts

options interface

yamlfile: {'run.yaml'} | str

name of LAVA YAML file to use

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_superlava(v, j=None, mode=None)

Get value of option “superlava”

Call:
>>> opts.set_superlava(superlava, j=None, i=None, **kw)
Inputs:
opts: RunControlOpts

options interface

superlava: {None} | object

value of option “superlava”

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