Skip to content

Command groups

Groups of components that SwanConfig takes as one field (startup, inpgrid, forcing, physics, output, lockup), with checks across their commands.

SWAN Components Group Module

This module provides group components for organizing SWAN model configurations in the ROMPY framework.

logger module-attribute

logger = logging.getLogger(__name__)

PROJECT_TYPE module-attribute

PROJECT_TYPE = Annotated[
    PROJECT, Field(description="Project component")
]

SET_TYPE module-attribute

SET_TYPE = Annotated[
    SET, Field(description="Set component")
]

MODE_TYPE module-attribute

MODE_TYPE = Annotated[
    MODE, Field(description="Mode component")
]

COORDINATES_TYPE module-attribute

COORDINATES_TYPE = Annotated[
    COORDINATES, Field(description="Coordinates component")
]

INPGRID_TYPE module-attribute

INPGRID_TYPE = Annotated[
    Union[REGULAR, CURVILINEAR, UNSTRUCTURED, WIND, ICE],
    Field(discriminator="model_type"),
]

NEGATINP_TYPE module-attribute

NEGATINP_TYPE = Annotated[
    NEGATINP,
    Field(description="Negative wind input component"),
]

QUADRUPL_TYPE module-attribute

QUADRUPL_TYPE = Annotated[
    QUADRUPL, Field(description="Quadruplets component")
]

VEGETATION_TYPE module-attribute

VEGETATION_TYPE = Annotated[
    VEGETATION, Field(description="Vegetation component")
]

MUD_TYPE module-attribute

MUD_TYPE = Annotated[
    MUD, Field(description="Mud component")
]

TURBULENCE_TYPE module-attribute

TURBULENCE_TYPE = Annotated[
    TURBULENCE, Field(description="Turbulence component")
]

LIMITER_TYPE module-attribute

LIMITER_TYPE = Annotated[
    LIMITER, Field(description="Limiter component")
]

OBSTACLE_TYPE module-attribute

OBSTACLE_TYPE = Annotated[
    OBSTACLES, Field(description="Obstacle group component")
]

SETUP_TYPE module-attribute

SETUP_TYPE = Annotated[
    SETUP, Field(description="Setup component")
]

DIFFRACTION_TYPE module-attribute

DIFFRACTION_TYPE = Annotated[
    DIFFRACTION, Field(description="Diffraction component")
]

SURFBEAT_TYPE module-attribute

SURFBEAT_TYPE = Annotated[
    SURFBEAT, Field(description="Surfbeat component")
]

SCAT_TYPE module-attribute

SCAT_TYPE = Annotated[
    SCAT, Field(description="Scattering component")
]

OFF_TYPE module-attribute

OFF_TYPE = Annotated[
    OFFS, Field(description="Deactivate components")
]

GEN_TYPE module-attribute

GEN_TYPE = Annotated[
    Union[GEN1, GEN2, GEN3],
    Field(
        description="Wave generation component",
        discriminator="model_type",
    ),
]

SSWELL_TYPE module-attribute

SSWELL_TYPE = Annotated[
    Union[SSWELL_ROGERS, SSWELL_ARDHUIN, SSWELL_ZIEGER],
    Field(
        description="Swell dissipation component",
        discriminator="model_type",
    ),
]

WCAPPING_TYPE module-attribute

WCAPPING_TYPE = Annotated[
    Union[WCAPPING_KOMEN, WCAPPING_AB],
    Field(
        description="Whitecapping component",
        discriminator="model_type",
    ),
]

BREAKING_TYPE module-attribute

BREAKING_TYPE = Annotated[
    Union[BREAKING_CONSTANT, BREAKING_BKD],
    Field(
        description="Wave breaking component",
        discriminator="model_type",
    ),
]

FRICTION_TYPE module-attribute

FRICTION_TYPE = Annotated[
    Union[
        FRICTION_JONSWAP,
        FRICTION_COLLINS,
        FRICTION_MADSEN,
        FRICTION_RIPPLES,
    ],
    Field(
        description="Bottom friction component",
        discriminator="model_type",
    ),
]

TRIAD_TYPE module-attribute

TRIAD_TYPE = Annotated[
    Union[TRIAD, TRIAD_DCTA, TRIAD_LTA, TRIAD_SPB],
    Field(
        description="Triad interactions component",
        discriminator="model_type",
    ),
]

SICE_TYPE module-attribute

SICE_TYPE = Annotated[
    Union[SICE, SICE_R19, SICE_D15, SICE_M18, SICE_R21B],
    Field(
        description="Sea ice component",
        discriminator="model_type",
    ),
]

BRAGG_TYPE module-attribute

BRAGG_TYPE = Annotated[
    Union[BRAGG, BRAGG_FT, BRAGG_FILE],
    Field(
        description="Bragg scattering component",
        discriminator="model_type",
    ),
]

FRAME_TYPE module-attribute

FRAME_TYPE = Annotated[
    FRAME, Field(description="Frame locations component")
]

GROUP_TYPE module-attribute

GROUP_TYPE = Annotated[
    GROUP, Field(description="Group locations component")
]

CURVE_TYPE module-attribute

CURVE_TYPE = Annotated[
    CURVES, Field(description="Curve locations component")
]

RAY_TYPE module-attribute

RAY_TYPE = Annotated[
    RAY, Field(description="Ray locations component")
]

ISOLINE_TYPE module-attribute

ISOLINE_TYPE = Annotated[
    ISOLINE,
    Field(description="Isoline locations component"),
]

QUANTITY_TYPE module-attribute

QUANTITY_TYPE = Annotated[
    QUANTITIES, Field(description="Quantity component")
]

OUTOPT_TYPE module-attribute

OUTOPT_TYPE = Annotated[
    OUTPUT_OPTIONS,
    Field(description="Output options component"),
]

TABLE_TYPE module-attribute

TABLE_TYPE = Annotated[
    TABLE, Field(description="Table write component")
]

SPECOUT_TYPE module-attribute

SPECOUT_TYPE = Annotated[
    SPECOUT, Field(description="Spectra write component")
]

NESTOUT_TYPE module-attribute

NESTOUT_TYPE = Annotated[
    NESTOUT, Field(description="Nest write component")
]

TEST_TYPE module-attribute

TEST_TYPE = Annotated[
    TEST, Field(description="Intermediate write component")
]

BLOCK_TYPE module-attribute

BLOCK_TYPE = Annotated[
    Union[BLOCK, BLOCKS],
    Field(
        description="Block write component",
        discriminator="model_type",
    ),
]

POINTS_TYPE module-attribute

POINTS_TYPE = Annotated[
    Union[POINTS, POINTS_FILE],
    Field(
        description="Points locations component",
        discriminator="model_type",
    ),
]

NGRID_TYPE module-attribute

NGRID_TYPE = Annotated[
    Union[NGRID, NGRID_UNSTRUCTURED],
    Field(
        description="Ngrid locations component",
        discriminator="model_type",
    ),
]

NEST_TYPE module-attribute

NEST_TYPE = Annotated[
    NEST,
    Field(description="Nest component (NGRID + NESTOUT)"),
]

COMPUTE_TYPE module-attribute

COMPUTE_TYPE = Annotated[
    Union[COMPUTE, COMPUTE_STAT, COMPUTE_NONSTAT],
    Field(
        description="Compute components",
        discriminator="model_type",
    ),
]

BaseGroupComponent pydantic-model

BaseGroupComponent(**data: Any)

Bases: BaseComponent

Base group component.

Base class for SWAN group components. This base class modifies the render() method to allow rendering of a list of components. It is not intended to be used directly but to be subclassed by other group components.

Fields:

model_type pydantic-field

model_type: Literal['group', 'GROUP'] = 'group'

Model type discriminator

render

render(*args, **kwargs) -> str

Override base class to allow rendering list of components.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

cmd abstractmethod

cmd() -> str | list

Return the string or list of strings to render the component to the CMD.

STARTUP pydantic-model

STARTUP(**data: Any)

Bases: BaseGroupComponent

Startup group component.

PROJECT ...
SET ...
MODE ...
COORDINATES ...

This group component is used to group individual startup components. Only fields that are explicitly prescribed are rendered by this group component.

Examples

from rompy_swan.components.startup import PROJECT, SET, MODE, COORDINATES
from rompy_swan.components.group import STARTUP
proj = PROJECT(nr="01")
set = SET(level=0.5, direction_convention="nautical")
mode = MODE(kind="nonstationary", dim="twodimensional")
coords = COORDINATES(kind=dict(model_type="spherical", projection="ccm"))
startup = STARTUP(
    project=proj,
    set=set,
    mode=mode,
    coordinates=coords,
)
print(startup.render())
PROJECT nr='01'

SET level=0.5 NAUTICAL

MODE NONSTATIONARY TWODIMENSIONAL

COORDINATES SPHERICAL CCM

Fields:

model_type pydantic-field

model_type: Literal['startup', 'STARTUP'] = 'startup'

Model type discriminator

project pydantic-field

project: Optional[PROJECT_TYPE] = None

set pydantic-field

set: Optional[SET_TYPE] = None

mode pydantic-field

mode: Optional[MODE_TYPE] = None

coordinates pydantic-field

coordinates: Optional[COORDINATES_TYPE] = None

cmd

cmd() -> str

Command file string for this component.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

render

render(*args, **kwargs) -> str

Override base class to allow rendering list of components.

FORCING pydantic-model

FORCING(**data: Any)

Bases: BaseGroupComponent

SWAN constant forcing group component.

WIND vel dir [cc]
ICE aice [hice]

This group component holds constant (non-gridded) forcing inputs. At most one WIND and one ICE instance may be provided; use the INPGRID-based components for spatially-varying inputs.

Examples

from rompy_swan.components.group import FORCING
forcing = FORCING(wind=dict(vel=10.0, dir=270.0))
print(forcing.render())
forcing = FORCING(
    wind=dict(vel=10.0, dir=270.0),
    ice=dict(aice=0.5, hice=1.5),
)
print(forcing.render())
WIND vel=10.0 dir=270.0
WIND vel=10.0 dir=270.0

ICE aice=0.5 hice=1.5

Fields:

Validators:

model_type pydantic-field

model_type: Literal['forcing', 'FORCING'] = 'forcing'

Model type discriminator

wind pydantic-field

wind: Optional[WIND] = None

Constant wind forcing

ice pydantic-field

ice: Optional[ICE] = None

Constant ice forcing

at_least_one pydantic-validator

at_least_one() -> FORCING

cmd

cmd() -> str | list

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

render

render(*args, **kwargs) -> str

Override base class to allow rendering list of components.

INPGRIDS pydantic-model

INPGRIDS(**data: Any)

Bases: BaseGroupComponent

SWAN input grids group component.

INPGRID ...
READGRID ...

INPGRID ...
READGRID ...

...

This group component is a convenience to allow defining and rendering a list of input grid components.

Examples

from rompy_swan.components.inpgrid import REGULAR, ICE
from rompy_swan.components.group import INPGRIDS
inpgrid_bottom = REGULAR(
    grid_type="bottom",
    excval=-99.0,
    xpinp=172.0,
    ypinp=-41.0,
    alpinp=0.0,
    mxinp=99,
    myinp=99,
    dxinp=0.005,
    dyinp=0.005,
    readinp=dict(fname1="bottom.txt"),
)
inpgrid_wind = REGULAR(
    grid_type="wind",
    excval=-99.0,
    xpinp=172.0,
    ypinp=-41.0,
    alpinp=0.0,
    mxinp=99,
    myinp=99,
    dxinp=0.005,
    dyinp=0.005,
    readinp=dict(fname1="wind.txt"),
    nonstationary=dict(
        tbeg="2019-01-01T00:00:00",
        tend="2019-01-07 00:00:00",
        delt=3600,
        dfmt="hr",
    ),
)
inpgrid_ice_cte = ICE(aice=0.8, hice=2.0)
inpgrids = INPGRIDS(inpgrids=[inpgrid_bottom, inpgrid_wind, inpgrid_ice_cte])
print(inpgrids.render())
INPGRID BOTTOM REGULAR xpinp=172.0 ypinp=-41.0 alpinp=0.0 mxinp=99 myinp=99 dxinp=0.005 dyinp=0.005 EXCEPTION excval=-99.0
READINP BOTTOM fac=1.0 fname1='bottom.txt' idla=1 nhedf=0 nhedt=0 nhedvec=0 FREE

INPGRID WIND REGULAR xpinp=172.0 ypinp=-41.0 alpinp=0.0 mxinp=99 myinp=99 dxinp=0.005 dyinp=0.005 EXCEPTION excval=-99.0 NONSTATIONARY tbeginp=20190101.000000 deltinp=1.0 HR &
    tendinp=20190107.000000
READINP WIND fac=1.0 fname1='wind.txt' idla=1 nhedf=0 nhedt=0 nhedvec=0 FREE

ICE aice=0.8 hice=2.0

Fields:

Validators:

model_type pydantic-field

model_type: Literal['inpgrids'] = 'inpgrids'

Model type discriminator

inpgrids pydantic-field

List of input grid components

ensure_unique_grid_type pydantic-validator

ensure_unique_grid_type(
    inpgrids: INPGRID_TYPE,
) -> INPGRID_TYPE

Ensure that each grid type is unique.

cmd

cmd() -> str | list

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

render

render(*args, **kwargs) -> str

Override base class to allow rendering list of components.

PHYSICS pydantic-model

PHYSICS(**data: Any)

Bases: BaseGroupComponent

Physics group component.

The physics group component is a convenience to allow specifying several individual components in a single command and check for consistency between them.

Exemples

from rompy_swan.components.group import PHYSICS
gen = {"model_type": "gen3", "source_terms": {"model_type": "komen"}}
phys = PHYSICS(gen=gen)
print(phys.render())
phys = PHYSICS(
    gen=dict(model_type="gen3", source_terms={"model_type": "st6c1"}),
    negatinp={"model_type": "negatinp", "rdcoef": 0.04},
    sswell={"model_type": "zieger"},
    breaking={"model_type": "constant", "alpha": 1.0, "gamma": 0.73},
    friction={"model_type": "jonswap", "cfjon": 0.038},
)
print(phys.render())
GEN3 KOMEN DRAG WU
GEN3 ST6 a1sds=4.7e-07 a2sds=6.6e-06 p1sds=4.0 p2sds=4.0 UP HWANG VECTAU U10PROXY windscaling=28.0 AGROW

SSWELL ZIEGER

NEGATINP rdcoef=0.04

BREAKING CONSTANT alpha=1.0 gamma=0.73

FRICTION JONSWAP CONSTANT cfjon=0.038

Fields:

Validators:

model_type pydantic-field

model_type: Literal['physics', 'PHYSICS'] = 'physics'

Model type discriminator

gen pydantic-field

gen: Optional[GEN_TYPE] = None

sswell pydantic-field

sswell: Optional[SSWELL_TYPE] = None

negatinp pydantic-field

negatinp: Optional[NEGATINP_TYPE] = None

wcapping pydantic-field

wcapping: Optional[WCAPPING_TYPE] = None

quadrupl pydantic-field

quadrupl: Optional[QUADRUPL_TYPE] = None

breaking pydantic-field

breaking: Optional[BREAKING_TYPE] = None

friction pydantic-field

friction: Optional[FRICTION_TYPE] = None

triad pydantic-field

triad: Optional[TRIAD_TYPE] = None

vegetation pydantic-field

vegetation: Optional[VEGETATION_TYPE] = None

mud pydantic-field

mud: Optional[MUD_TYPE] = None

sice pydantic-field

sice: Optional[SICE_TYPE] = None

turbulence pydantic-field

turbulence: Optional[TURBULENCE_TYPE] = None

bragg pydantic-field

bragg: Optional[BRAGG_TYPE] = None

limiter pydantic-field

limiter: Optional[LIMITER_TYPE] = None

obstacle pydantic-field

obstacle: Optional[OBSTACLE_TYPE] = None

setup pydantic-field

setup: Optional[SETUP_TYPE] = None

diffraction pydantic-field

diffraction: Optional[DIFFRACTION_TYPE] = None

surfbeat pydantic-field

surfbeat: Optional[SURFBEAT_TYPE] = None

scat pydantic-field

scat: Optional[SCAT_TYPE] = None

deactivate pydantic-field

deactivate: Optional[OFF_TYPE] = None

negatinp_only_with_zieger pydantic-validator

negatinp_only_with_zieger() -> PHYSICS

Log a warning if NEGATINP is used with a non-ZIEGER SSWELL.

cmd

cmd()

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

render

render(*args, **kwargs) -> str

Override base class to allow rendering list of components.

OUTPUT pydantic-model

OUTPUT(**data: Any)

Bases: BaseGroupComponent

Output group component.

FRAME 'sname' ...
GROUP 'sname' ...
CURVE 'sname' ...
RAY 'rname' ...
ISOLINE 'sname' 'rname' ...
POINTS 'sname ...
NESTS (list):
  - NEST 'sname':
      NGRID 'sname' ...
      NESTOUT 'sname' ...
  - NEST 'sname':
      NGRID 'sname' ...
      NESTOUT 'sname' ...
QUANTITY ...
OUTPUT OPTIONS ...
BLOCK 'sname' ...
TABLE 'sname' ...
SPECOUT 'sname' ...

This group component is used to define multiple types of output locations and write components in a single model. Only fields that are explicitly prescribed are rendered by this group component.

Note

The components prescribed are validated according to some constraints as defined in the SWAN manual:

  • The name 'sname' of each Locations component must be unique.
  • The Locations 'sname' assigned to each write component must be defined.
  • The BLOCK component must be associated with either a FRAME or GROUP.
  • The ISOLINE write component must be associated with a RAY component.
  • For nested grids, use the nests field which accepts a list of NEST components. Each NEST automatically couples NGRID and NESTOUT with matching snames.
  • Legacy ngrid and nestout fields are deprecated. Use nests instead for single or multiple nested grid definitions.

Examples:

from rompy_swan.components.output import POINTS, BLOCK, QUANTITIES, TABLE
from rompy_swan.components.group import OUTPUT
points = POINTS(sname="outpts", xp=[172.3, 172.4], yp=[-39, -39])
quantity = QUANTITIES(
    quantities=[
        dict(output=["depth", "hsign", "tps", "dir", "tm01"], excv=-9),
    ]
)
times = dict(tbeg="2012-01-01T00:00:00", delt="PT30M", tfmt=1, dfmt="min")
block = BLOCK(
    model_type="block",
    sname="COMPGRID",
    fname="./swangrid.nc",
    output=["depth", "hsign", "tps", "dir"],
    times=times,
)
table = TABLE(
    sname="outpts",
    format="noheader",
    fname="./swantable.nc",
    output=["hsign", "hswell", "dir", "tps", "tm01", "watlev", "qp"],
    times=times,
)
out = OUTPUT(
    points=points,
    quantity=quantity,
    block=block,
    table=table,
)
print(out.render())
POINTS sname='outpts' &
    xp=172.3 yp=-39.0 &
    xp=172.4 yp=-39.0

QUANTITY DEPTH HSIGN TPS DIR TM01 excv=-9.0

BLOCK sname='COMPGRID' fname='./swangrid.nc' &
    DEPTH &
    HSIGN &
    TPS &
    DIR &
    OUTPUT tbegblk=20120101.000000 deltblk=30.0 MIN

TABLE sname='outpts' NOHEADER fname='./swantable.nc' &
    HSIGN &
    HSWELL &
    DIR &
    TPS &
    TM01 &
    WATLEV &
    QP &
    OUTPUT tbegtbl=20120101.000000 delttbl=30.0 MIN

Fields:

Validators:

model_type pydantic-field

model_type: Literal['output', 'OUTPUT'] = 'output'

Model type discriminator

frame pydantic-field

frame: Optional[FRAME_TYPE] = None

group pydantic-field

group: Optional[GROUP_TYPE] = None

curve pydantic-field

curve: Optional[CURVE_TYPE] = None

ray pydantic-field

ray: Optional[RAY_TYPE] = None

isoline pydantic-field

isoline: Optional[ISOLINE_TYPE] = None

points pydantic-field

points: Optional[POINTS_TYPE] = None

nests pydantic-field

nests: Optional[list[NEST_TYPE]] = None

List of nested grid definitions (each couples NGRID + NESTOUT)

ngrid pydantic-field

ngrid: Optional[NGRID_TYPE] = None

quantity pydantic-field

quantity: Optional[QUANTITY_TYPE] = None

output_options pydantic-field

output_options: Optional[OUTOPT_TYPE] = None

block pydantic-field

block: Optional[BLOCK_TYPE] = None

table pydantic-field

table: Optional[TABLE_TYPE] = None

specout pydantic-field

specout: Optional[SPECOUT_TYPE] = None

nestout pydantic-field

nestout: Optional[NESTOUT_TYPE] = None

test pydantic-field

test: Optional[TEST_TYPE] = None

locations_set property

locations_set

List of specified location fields.

write_set property

write_set

List of specified write fields.

snames property

snames

List of snames from specified location components.

write_locations_exists pydantic-validator

write_locations_exists() -> OUTPUT

Ensure the location component requested by a write component exists.

locations_sname_unique pydantic-validator

locations_sname_unique() -> OUTPUT

Ensure same sname isn't used in more than one set of output locations.

block_with_frame_or_group pydantic-validator

block_with_frame_or_group() -> OUTPUT

Ensure Block is only defined for FRAME or GROUP locations.

isoline_ray_defined pydantic-validator

isoline_ray_defined() -> OUTPUT

Ensure the isoline ray has been defined.

migrate_legacy_ngrid_nestout pydantic-validator

migrate_legacy_ngrid_nestout() -> OUTPUT

Convert deprecated ngrid/nestout fields to nests.

Deprecated

Use the nests field instead. This validator will be removed in a future version once the legacy ngrid and nestout fields are dropped.

nests_snames_unique pydantic-validator

nests_snames_unique() -> OUTPUT

Ensure each nest has a unique sname.

cmd

cmd() -> list

Command file string for this component.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

render

render(*args, **kwargs) -> str

Override base class to allow rendering list of components.

LOCKUP pydantic-model

LOCKUP(**data: Any)

Bases: BaseComponent

Lockup group component.

COMPUTE ...
HOTFILE ...
COMPUTE ...
HOTFILE ...
...
STOP

This is a group component to specify SWAN "Lockup" commands including multiple COMPUTE commands that may or may not be interleaved with HOTFILE commands, and a final STOP command.

The computation depends on the SWAN mode (see command MODE):

  • stationary mode (SWAN's default): a single computation without times, COMPUTE.
  • nonstationary mode: computations at given times, either stationary (COMPUTE_STAT) or nonstationary (COMPUTE_NONSTAT).

Examples

from rompy_swan.components.group import LOCKUP
lockup = LOCKUP(compute=dict(model_type="compute"))
print(lockup.render())
lockup = LOCKUP(
    compute=dict(
        model_type="stat",
        times=dict(
            model_type="nonstationary",
            tbeg="1990-01-01T00:00:00",
            tend="1990-01-01T03:00:00",
            delt="PT1H",
            dfmt="hr",
        ),
        hotfile=dict(fname="hotfile"),
        hottimes=[-1],
    ),
)
print(lockup.render())
COMPUTE
STOP
COMPUTE STATIONARY time=19900101.000000
COMPUTE STATIONARY time=19900101.010000
COMPUTE STATIONARY time=19900101.020000
COMPUTE STATIONARY time=19900101.030000
HOTFILE fname='hotfile_19900101T030000'
STOP

Fields:

model_type pydantic-field

model_type: Literal['lockup', 'LOCKUP'] = 'lockup'

Model type discriminator

compute pydantic-field

compute: COMPUTE_TYPE

Compute components

cmd

cmd() -> list

Command file strings for this component.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

Suggest the closest field name for an unknown input key.

A field can be given by its name or, like in pydantic, by its alias.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

render

render(cmd: Optional[str | list] = None) -> str

Render the component to a string.

Parameters:

Name Type Description Default
cmd Optional[str | list]

Command string or list of command strings to render, by default self.cmd().

None

Returns:

Name Type Description
cdmstr str

The rendered command file component.