PHYEX 0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
pyphyex.phyex1d.cli Namespace Reference

Functions

 convert_option (cls_name, key, value, default)
 class_description (cls)
 physics_classes_help ()
 physics_options_help ()
 input_file (case)
 experiments_parser (description, epilog)
 experiments_from_args (args)
 runner_from_args (args)
 plot (ph1d, plot_args)
 main_run ()
 main_plot ()
 main_list ()
 main_2nc ()

Variables

str EXPERIMENTS_HELP
str RUN_EXAMPLES
str PLOT_HELP

Detailed Description

Command line clients: phyex1d-exp_run (execution of experiments), phyex1d-exp_plot (plot of
the results) and phyex1d-exp_list (list of the existing results)

Function Documentation

◆ class_description()

pyphyex.phyex1d.cli.class_description ( cls)
First line of the docstring of a class

Definition at line 45 of file cli.py.

◆ convert_option()

pyphyex.phyex1d.cli.convert_option ( cls_name,
key,
value,
default )
Conversion of a command line value, according to the type of the default value
of the option in the physics class
:param cls_name: name of the physics class (for error messages)
:param key: option name
:param value: string to convert
:param default: default value of the option
:return: converted value

Definition at line 22 of file cli.py.

Here is the caller graph for this function:

◆ experiments_from_args()

pyphyex.phyex1d.cli.experiments_from_args ( args)
List of experiment descriptions (for ExperimentRunner) from the --exp options

Definition at line 180 of file cli.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ experiments_parser()

pyphyex.phyex1d.cli.experiments_parser ( description,
epilog )
Parser with the arguments describing the experiments (common to run and plot)

Definition at line 161 of file cli.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ input_file()

pyphyex.phyex1d.cli.input_file ( case)
Path of the netCDF file describing the case
:param case: path to a netCDF file or name of an installed DEPHY-SCM case
             (CASE/SUBCASE)
:return: path to the netCDF file

Definition at line 145 of file cli.py.

Here is the caller graph for this function:

◆ main_2nc()

pyphyex.phyex1d.cli.main_2nc ( )
Entry point of the phyex1d-exp_2nc command: conversion of a result into netCDF

Definition at line 370 of file cli.py.

Here is the call graph for this function:

◆ main_list()

pyphyex.phyex1d.cli.main_list ( )
Entry point of the phyex1d-exp_list command: list of the existing results

Definition at line 346 of file cli.py.

Here is the call graph for this function:

◆ main_plot()

pyphyex.phyex1d.cli.main_plot ( )
Entry point of the phyex1d-exp_plot command: plot of the results of experiments

Definition at line 320 of file cli.py.

Here is the call graph for this function:

◆ main_run()

pyphyex.phyex1d.cli.main_run ( )
Entry point of the phyex1d-exp_run command: execution of experiments

Definition at line 306 of file cli.py.

Here is the call graph for this function:

◆ physics_classes_help()

pyphyex.phyex1d.cli.physics_classes_help ( )
List of the physics classes (with their description)

Definition at line 51 of file cli.py.

◆ physics_options_help()

pyphyex.phyex1d.cli.physics_options_help ( )
Description of the options of the physics classes (OPTIONS_HELP class attribute) with
their default values; classes having the same options are grouped

Definition at line 60 of file cli.py.

◆ plot()

pyphyex.phyex1d.cli.plot ( ph1d,
plot_args )
Plots the evolution of variables, or their profiles at given times
:param ph1d: ExperimentRunner instance
:param plot_args: arguments of a --plot option (file name, options and variables)

Definition at line 221 of file cli.py.

Here is the caller graph for this function:

◆ runner_from_args()

pyphyex.phyex1d.cli.runner_from_args ( args)
ExperimentRunner corresponding to the command line arguments

Definition at line 215 of file cli.py.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ EXPERIMENTS_HELP

str pyphyex.phyex1d.cli.EXPERIMENTS_HELP
Initial value:
1= """
2The case is given by the path to a netCDF file in the common format or by the name of
3an installed DEPHY-SCM case (CASE/SUBCASE, e.g. ARMCU/REF, see phyex1d-cases_install and
4phyex1d-cases_list).
5
6Each --exp option is followed by a list of key=value strings (without --exp, one
7experiment is defined with the default values).
8The keys common to all the physics classes are:
9- grid: Grid name or file name containing a grid description
10 (with '.grid' extension).
11- dt: Timestep (s)
12- name: experiment name
13- class: name of the class that implements a timestep among:
14""" + physics_classes_help() + """
15- attr: override an attribute definig the case, eg.: attr=radiation:on
16 (only some of the attributes are implemented)
17
18The other keys are options of the physics class:
19""" + physics_options_help() + """
20
21Results are stored in OUTPUT_DIR/<comparison name>/<experiment name>.hdf5 (OUTPUT_DIR is
22the current directory by default; quotes are removed, spaces and slashes are replaced by
23underscores).
24"""

Definition at line 80 of file cli.py.

◆ PLOT_HELP

str pyphyex.phyex1d.cli.PLOT_HELP
Initial value:
1= """
2The results are read in OUTPUT_DIR/<comparison name> (see phyex1d-exp_run); all the
3experiments having results are plotted, unless some are selected with --exp (their list is
4given by phyex1d-exp_list).
5
6Each --plot option is followed by the plot file name, then by options (key=value) and by
7the list of variables to plot. Variable names can contain wildcards (*, ? and [], to be
8quoted to prevent their expansion by the shell), e.g. 'bu_*_RC_*' for all the budgets of rc.
9By default, the time evolution is plotted; with the times option, profiles are plotted at
10the given output times. Options:
11- y_var: variable used for the y-axis (e.g. y_var=P)
12- title, xlabel, ylabel, legend: strings
13- only_param_tag: comma-separated list of experiment names
14- mfactor, linewidth: floats
15- enable_contourf, switch_cls, colorbar, clabel: True or False (time evolution only)
16- times: comma-separated list of output times in seconds (profiles)
17- color_by, style_by: var, scheme or time, dimension distinguished by the color or by the
18 line style (profiles only)
19- ymin, ymax: limits of the y-axis
20- vmin, vmax: limits of the plotted values
21- nonzero: threshold (float) to remove the negligible variables: a variable is not plotted
22 if its maximum absolute value (over the plotted times and experiments) is lower than
23 nonzero times the maximum of all the variables (0 to remove only the null variables)
24Examples:
25 phyex1d-exp_plot -o out --exp simple --plot rc.png y_var=P rc
26 phyex1d-exp_plot -o out --plot rc_prof.png y_var=P times=3600,7200 rc
27 phyex1d-exp_plot -o out --plot rc_bu.png y_var=P times=3600 nonzero=1e-3 'bu_*_RC_*'
28"""

Definition at line 115 of file cli.py.

◆ RUN_EXAMPLES

str pyphyex.phyex1d.cli.RUN_EXAMPLES
Initial value:
1= """Examples:
2- without comparison name (--name) and without experiment name (name key):
3 phyex1d-exp_run ARMCU/REF -o out --exp dt=60
4 results in out/""" + DEFAULT_COMP_NAME + """/Experiment.hdf5
5- with both names, and a case file:
6 phyex1d-exp_run case.nc -o out --name armcu --exp dt=60 name=simple class=SimplePhysicsTQ
7 results in out/armcu/simple.hdf5
8An experiment is not run again if its result file already exists (use --force).
9"""

Definition at line 105 of file cli.py.