cape.pylch.options: Options interface for Loci/CHEM

cape.pylch.options: CAPE options specific to Loci/CHEM

This module provides defintions for and an interface to all options that are unique to :mod:`cape.pylcnh.

See also:
class cape.pylch.options.Options(*args, **kw)
get_MapBCFile(j=None, i=None, **kw)

Get name of the boundary condition map file

Call:
>>> MapBCFile = opts.get_MapBCFile(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:
MapBCFile: {None} | str

name of the boundary condition map file

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

Get value of option “ProjectName”

Call:
>>> ProjectName = opts.get_ProjectName(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:
ProjectName: {'pylch'} | str

value of option “ProjectName”

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

Get value of option “VarsFile”

Call:
>>> VarsFile = opts.get_VarsFile(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:
VarsFile: {None} | str

value of option “VarsFile”

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

Get path to Loci/CHEM executable

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

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

path to Loci/CHEM executable

get_vars_var(key: str, j: int | None = None, **kw) Any

Select a .vars file option

Roughly, this returns opts[key].

Call:
>>> val = opts.get_vars_var(key, j=None, **kw)
Inputs:
opts: Options

Options interface

key: str

Variable name

j: {None} | int

Phase index

Outputs:
val: object

Value from JSON options

Versions:
  • 2024-11-08 @ddalle: v1.0

select_vars_phase(j: int = 0, **kw) dict

Sample namelist at particular conditions

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

Options interface

j: {0} | int

Phase number

Outputs:
d: dict

Namelist sampled for phase and case indices

Versions:
  • 2024-11-08 @ddalle: v1.0

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

Get name of the boundary condition map file

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

options interface

MapBCFile: {None} | str

name of the boundary condition map 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_ProjectName(v, j=None, mode=None)

Get value of option “ProjectName”

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

options interface

ProjectName: {'pylch'} | str

value of option “ProjectName”

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

Get value of option “VarsFile”

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

options interface

VarsFile: {None} | str

value of option “VarsFile”

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

Get path to Loci/CHEM executable

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

options interface

executable: {'chem'} | str

path to Loci/CHEM 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_vars_var(key: str, val: Any, j: int | None = None)

Set a .vars file key for a specified phase or phases

Roughly, this sets opts["Vars"][key] or opts["Vars"][key][j] equal to val

Call:
>>> opts.set_vars_var(key, val, j=None)
Inputs:
opts: Options

Options interface

key: str

Variable name

val: object

Value from JSON options

j: {None} | int

Phase index

Versions:
  • 2024-11-08 @ddalle: v1.0