Skip to content

config

Define configuration variables for StagPy.

See stagpy.args for additional definitions related to the command line interface.

CONFIG_LOCAL module-attribute

CONFIG_LOCAL = Path('.stagpy.toml')

Path of local configuration file.

Common dataclass

Bases: Section

General options.

config class-attribute instance-attribute

config: bool = command_flag('print config options')

Core dataclass

Bases: Section

Core control.

path class-attribute instance-attribute

path: Path = path_entry(
    path=".",
    cli_short="p",
    doc="path of StagYY run directory or par file",
)

read_parameters_dat class-attribute instance-attribute

read_parameters_dat: bool = switch_opt(
    True, None, "enable reading parameters.dat"
)

outname class-attribute instance-attribute

outname: str = entry(
    val="stagpy",
    cli_short="n",
    doc="output file name prefix",
)

shortname class-attribute instance-attribute

shortname: bool = switch_opt(
    False, None, "output file name is only prefix"
)

timesteps class-attribute instance-attribute

timesteps: Sequence[Union[int, slice]] = entry(
    doc="timesteps slice", in_file=False, cli_short="t"
)

snapshots class-attribute instance-attribute

snapshots: Sequence[Union[int, slice]] = entry(
    default=[-1],
    doc="snapshots slice",
    in_file=False,
    cli_short="s",
)

Plot dataclass

Bases: Section

Plotting.

ratio class-attribute instance-attribute

ratio: Optional[float] = entry(
    doc="force aspect ratio of field plot", in_file=False
)

raster class-attribute instance-attribute

raster: bool = switch_opt(
    True, None, "rasterize field plots"
)

format class-attribute instance-attribute

format: str = entry(
    val="pdf", doc="figure format (pdf, eps, svg, png)"
)

vmin class-attribute instance-attribute

vmin: Optional[float] = entry(
    doc="minimal value on plot", in_file=False
)

vmax class-attribute instance-attribute

vmax: Optional[float] = entry(
    doc="maximal value on plot", in_file=False
)

cminmax class-attribute instance-attribute

cminmax: bool = switch_opt(
    False, "C", "constant min max across plots"
)

isolines class-attribute instance-attribute

isolines: Sequence[float] = entry(
    doc="list of isoline values", in_file=False
)

mplstyle class-attribute instance-attribute

mplstyle: Sequence[str] = entry(
    default="stagpy-paper",
    doc="list of matplotlib styles",
    in_file=False,
)

xkcd class-attribute instance-attribute

xkcd: bool = command_flag('use the xkcd style')

Scaling dataclass

Bases: Section

Dimensionalization.

yearins class-attribute instance-attribute

yearins: float = entry(
    val=31540000.0, in_cli=False, doc="year in seconds"
)

ttransit class-attribute instance-attribute

ttransit: float = entry(
    val=1780000000000000.0,
    in_cli=False,
    doc="transit time in My",
)

time_in_y class-attribute instance-attribute

time_in_y: bool = switch_opt(
    True, None, "dimensional time is in year"
)

vel_in_cmpy class-attribute instance-attribute

vel_in_cmpy: bool = switch_opt(
    True, None, "dimensional velocity is in cm/year"
)

factors class-attribute instance-attribute

factors: Dict[str, str] = entry(
    val_factory=lambda: {"s": "M", "m": "k", "Pa": "G"},
    in_cli=False,
    doc="custom factors",
)

FieldSec dataclass

Bases: Section

Field command.

plot class-attribute instance-attribute

plot: Sequence[Sequence[Sequence[str]]] = entry(
    default="T,stream",
    cli_short="o",
    doc="variables to plot (see stagpy var)",
)

perturbation class-attribute instance-attribute

perturbation: bool = switch_opt(
    False, None, "plot departure from average profile"
)

shift class-attribute instance-attribute

shift: Optional[int] = entry(
    doc="shift plot horizontally", in_file=False
)

timelabel class-attribute instance-attribute

timelabel: bool = switch_opt(
    False, None, "add label with time"
)

colorbar class-attribute instance-attribute

colorbar: bool = switch_opt(
    True, None, "add color bar to plot"
)

ix class-attribute instance-attribute

ix: Optional[int] = entry(
    doc="x-index of slice for 3D fields", in_file=False
)

iy class-attribute instance-attribute

iy: Optional[int] = entry(
    doc="y-index of slice for 3D fields", in_file=False
)

iz class-attribute instance-attribute

iz: Optional[int] = entry(
    doc="z-index of slice for 3D fields", in_file=False
)

isocolors class-attribute instance-attribute

isocolors: Sequence[str] = entry(
    doc="list of colors for isolines"
)

cmap class-attribute instance-attribute

cmap: Dict[str, str] = entry(
    val_factory=lambda: {
        "T": "RdBu_r",
        "eta": "viridis_r",
        "rho": "RdBu",
        "sII": "plasma_r",
        "edot": "Reds",
    },
    in_cli=False,
    doc="custom colormaps",
)

RprofSec dataclass

Bases: Section

Rprof command.

plot class-attribute instance-attribute

plot: Sequence[Sequence[Sequence[str]]] = entry(
    default="Tmean",
    cli_short="o",
    doc="variables to plot (see stagpy var)",
)

style class-attribute instance-attribute

style: str = entry(val='-', doc='matplotlib line style')

average class-attribute instance-attribute

average: bool = switch_opt(
    False, "a", "plot temporal average"
)

grid class-attribute instance-attribute

grid: bool = switch_opt(False, 'g', 'plot grid')

depth class-attribute instance-attribute

depth: bool = switch_opt(
    False, "d", "depth as vertical axis"
)

Time dataclass

Bases: Section

Time command.

plot class-attribute instance-attribute

plot: Sequence[Sequence[Sequence[str]]] = entry(
    default="Nutop,ebalance,Nubot.Tmean",
    cli_short="o",
    doc="variables to plot (see stagpy var)",
)

style class-attribute instance-attribute

style: str = entry(val='-', doc='matplotlib line style')

compstat class-attribute instance-attribute

compstat: Sequence[str] = entry(
    doc="compute mean and rms of listed variables",
    in_file=False,
)

tstart class-attribute instance-attribute

tstart: Optional[float] = entry(
    doc="beginning time", in_file=False
)

tend class-attribute instance-attribute

tend: Optional[float] = entry(doc="end time", in_file=False)

fraction class-attribute instance-attribute

fraction: Optional[float] = entry(
    doc="ending fraction of series to process",
    in_file=False,
)

marktimes class-attribute instance-attribute

marktimes: Sequence[float] = entry(
    doc="list of times where to put a mark",
    in_file=False,
    cli_short="M",
)

marksteps class-attribute instance-attribute

marksteps: Sequence[Union[int, slice]] = entry(
    doc="list of steps where to put a mark",
    in_file=False,
    cli_short="T",
)

marksnaps class-attribute instance-attribute

marksnaps: Sequence[Union[int, slice]] = entry(
    doc="list of snaps where to put a mark",
    in_file=False,
    cli_short="S",
)

Refstate dataclass

Bases: Section

Refstate command.

plot class-attribute instance-attribute

plot: Sequence[str] = entry(
    default="T",
    cli_short="o",
    doc="variables to plot (see stagpy var)",
)

style class-attribute instance-attribute

style: str = entry(val='-', doc='matplotlib line style')

Plates dataclass

Bases: Section

Plates command.

plot class-attribute instance-attribute

plot: Sequence[Sequence[Sequence[str]]] = entry(
    default="c.T.v2-v2.dv2-v2.topo_top",
    cli_short="o",
    doc="variables to plot, can be a surface field, field, or dv2",
)

field class-attribute instance-attribute

field: str = entry(
    val="eta", doc="field to plot with plates info"
)

stress class-attribute instance-attribute

stress: bool = switch_opt(
    False,
    None,
    "plot deviatoric stress instead of velocity on field plots",
)

continents class-attribute instance-attribute

continents: bool = switch_opt(
    True, None, "whether to shade continents"
)

vzratio class-attribute instance-attribute

vzratio: float = entry(
    val=0.0,
    doc="Ratio of mean vzabs used as threshold for plates limits",
)

nbplates class-attribute instance-attribute

nbplates: bool = switch_opt(
    False, None, "plot number of plates as function of time"
)

distribution class-attribute instance-attribute

distribution: bool = switch_opt(
    False, None, "plot plate size distribution"
)

zoom class-attribute instance-attribute

zoom: Optional[float] = entry(
    doc="zoom around surface", in_file=False
)

Info dataclass

Bases: Section

Info command.

output class-attribute instance-attribute

output: Sequence[str] = entry(
    default="t,Tmean,vrms,Nutop,Nubot",
    cli_short="o",
    doc="time series to print",
)

Var dataclass

Bases: Section

Var command.

field class-attribute instance-attribute

field: bool = command_flag('print field variables')

sfield class-attribute instance-attribute

sfield: bool = command_flag("print surface field variables")

rprof class-attribute instance-attribute

rprof: bool = command_flag('print rprof variables')

time class-attribute instance-attribute

time: bool = command_flag('print time variables')

refstate class-attribute instance-attribute

refstate: bool = command_flag('print refstate variables')

ConfSection dataclass

Bases: Section

Config command.

create class-attribute instance-attribute

create: bool = command_flag('create config file')

Completions dataclass

Bases: Section

Shell completion scripts.

bash class-attribute instance-attribute

bash: bool = command_flag('generate bash completion')

zsh class-attribute instance-attribute

zsh: bool = command_flag('generate zsh completion')

Config dataclass

Bases: ConfigBase

StagPy configuration.

common instance-attribute

common: Common

core instance-attribute

core: Core

plot instance-attribute

plot: Plot

scaling instance-attribute

scaling: Scaling

field instance-attribute

field: FieldSec

rprof instance-attribute

rprof: RprofSec

time instance-attribute

time: Time

refstate instance-attribute

refstate: Refstate

plates instance-attribute

plates: Plates

info instance-attribute

info: Info

var instance-attribute

var: Var

config instance-attribute

config: ConfSection

completions instance-attribute

completions: Completions