cape.cfdx.options.reportopts: Automated report options

This module interfaces options for generating reports. Since many of the report options are common to different solvers, much of the report generation content is controlled here.

The function ReportOpts.SetSubfigDefaults() contains an extensive set of default options for each subfigure type. However, the docstring does not contain an outline or table of these, so interested users can refer to the JSON documentation or read the source code for that function.

class cape.cfdx.options.reportopts.ReportOpts(*args, **kw)

Dictionary-based interface for Reports section

Versions:
  • 2016-30-02 @ddalle: v1.0

  • 2023-04-28 @ddalle: v2.0; converted to OptionsDict

get_FigList() list

Get list of figures for a report

Call:
>>> figs = opts.get_FigList()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
figs: list[str]

List of figures by name

Versions:
  • 2015-03-08 @ddalle: v1.0

  • 2023-04-20 @ddalle: v2.0; Updates for OptionsDict

get_FigOpt(fig: str, opt: str, **kw)

Retrieve an option for a figure

Call:
>>> val = opts.get_FigOpt(fig, opt)
Inputs:
opts: cape.options.Options

Options interface

fig: str

Name of figure

opt: str

Name of option to retrieve

Outputs:
val: object

Sweep option value

Versions:
  • 2023-04-27 @ddalle: v1.0

get_ReportErrorFigures(report: str)

Get list of figures for cases with ERROR status

Call:
>>> figs = opts.get_ReportErrorFigList(report)
Inputs:
opts: cape.options.Options

Options interface

report: str

Name of report

Outputs:
figs: list[str]

List of figures in the report

Versions:
  • 2015-03-08 @ddalle: v1.0

get_ReportList(j=None, **kw)

Get list of reports available to create

Call:
>>> reps = opts.get_ReportList()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
reps: list[str]

List of reports by name

Versions:
  • 2015-03-08 @ddalle: v1.0

  • 2023-04-20 @ddalle: v2.0; simple OptionsDict method

get_ReportOpt(report: str, opt: str, **kw)

Get named option for a specific report

Call:
>>> val = opts.get_ReportOpt(report, opt, **kw)
Inputs:
opts: cape.options.Options

Options interface

report: str

Name of report

opt: str

Name of option

Outputs:
val: object

Value of opt

Versions:
  • 2023-04-27 @ddalle: v1.0

get_SubfigBaseType(sfig: str)

Get root type for an individual subfigure

Call:
>>> t = opts.get_SubfigBaseType(sfig)
Inputs:
opts: cape.options.Options

Options interface

sfig: str

Name of subfigure

Outputs:
t: str

Subfigure parent type

Versions:
  • 2015-03-08 @ddalle: v1.0

get_SubfigCascade(sfig: str)

Return full set of optsion from subfig and its parents

Call:
>>> sfigopts = opts.get_SubfigCasecasde(sfig)
Inputs:
opts: cape.options.Options

Options interface

sfig: str

Name of subfigure

Outputs:
sfigopts: dict

Options for subfigure sfig

Versions:
  • 2015-03-08 @ddalle: v1.0

  • 2023-05-10 @ddalle: v2.0; optdict rewrites

get_SubfigList() list

Get list of available subfigures for a report

Call:
>>> figs = opts.get_SubfigList()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
sfigs: list[str]

List of subfigures by name

Versions:
  • 2015-03-08 @ddalle: v1.0

  • 2023-04-20 @ddalle: v2.0; Updates for OptionsDict

get_SubfigOpt(sfig: str, opt: str, j=None, **kw)

Retrieve an option for a subfigure

Call:
>>> val = opts.get_SubfigOpt(sfig, opt, j=None, **kw)
Inputs:
opts: cape.options.Options

Options interface

sfig: str

Name of subfigure

opt: str

Name of option to retrieve

j: {None} | int

Phase index

Outputs:
val: object

Sweep option value

Versions:
  • 2023-04-27 @ddalle: v1.0

get_SweepList() list

Get list of sweeps for a report

Call:
>>> fswps = opts.get_SweepList()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
figs: list[str]

List of figures by name

Versions:
  • 2015-05-28 @ddalle: v1.0

  • 2023-04-20 @ddalle: v2.0; Updates for OptionsDict

get_SweepOpt(sweep: str, opt: str, **kw)

Retrieve an option for a sweep

Call:
>>> val = opts.get_SweepOpt(sweep, opt)
Inputs:
opts: cape.options.Options

Options interface

sweep: str

Name of sweep

opt: str

Name of option to retrieve

Outputs:
val: object

Sweep option value

Versions:
  • 2015-05-28 @ddalle: v1.0

  • 2023-04-27 @ddalle: v2.0; use optdict

preprocess_dict(a)

Custom preprocessing for ReportOpts

Take the global "Archive" option if present and apply it to each individual report.

Call:
>>> opts.preprocess_dict(a)
Inputs:
opts: ReportOpts

Options interface

a: dict

Dictionary of options to merge into opts

Versions:
  • 2023-06-22 @ddalle: v1.0

class cape.cfdx.options.reportopts.FigureOpts(*args, **kw)

Options for a single report figure definition

This class controls the options that define a single report figure. That includes several figure-specific options and a list of subfigures to include in the figure. It controls each subsection of the Report > Figures CAPE options.

See also:
class cape.cfdx.options.reportopts.SubfigOpts(*args, **kw)

Options for a single report subfigure definition

This class controls the options that define a single report subfigure. This includes all the options that define what the subfigure should include. It controls each subsection of the Report > Subfigures CAPE options.

There are many subclasses of SubfigOpts that contain options appropriate for each subfigure type.

See also:
class cape.cfdx.options.reportopts.SweepOpts(*args, **kw)

Options for a single report sweep definition

This class controls the options that define a single report sweep. That includes the constraints that divide a run matrix into subsets and a list of figures to include for each individual subset. It controls each subsection of the Report > Sweeps CAPE options.

See also:
class cape.cfdx.options.reportopts.SingleReportOpts(*args, **kw)

Options to define title and list of figures for a single report

Versions:
  • 2023-04-20 @ddalle: v1.0

class cape.cfdx.options.reportopts.FigureCollectionOpts(*args, **kw)

Options for a collection of figure definitions

This class is a dict of SubfigOpts instances, and any there are no limitations on the keys. It controls the Report > Figures section of the full CAPE options interface.

See also:
get_FigOpt(fig: str, opt: str, **kw)

Retrieve an option for a figure

Call:
>>> val = opts.get_FigOpt(fig, opt)
Inputs:
opts: cape.options.Options

Options interface

fig: str

Name of figure

opt: str

Name of option to retrieve

Outputs:
val: object

Sweep option value

Versions:
  • 2023-04-27 @ddalle: v1.0

class cape.cfdx.options.reportopts.SweepCollectionOpts(*args, **kw)

Options for a collection of report sweep definitions

This class is a dict of SweepOpts instances, and any there are no limitations on the keys. It controls the Report > Sweeps section of the full CAPE options interface.

See also:
get_SweepOpt(sweep: str, opt: str, **kw)

Retrieve an option for a sweep

Call:
>>> val = opts.get_SweepOpt(sweep, opt)
Inputs:
opts: cape.options.Options

Options interface

sweep: str

Name of sweep

opt: str

Name of option to retrieve

Outputs:
val: object

Sweep option value

Versions:
  • 2015-05-28 @ddalle: v1.0

  • 2023-04-27 @ddalle: v2.0; use optdict

class cape.cfdx.options.reportopts.SubfigCollectionOpts(*args, **kw)

Options for a collection of subfigure definitions

This class is a dict of SubfigOpts instances, and any there are no limitations on the keys. It controls the Report > Subfigures section of the full CAPE options interface.

See also:
get_SubfigBaseType(sfig: str)

Get root type for an individual subfigure

Call:
>>> t = opts.get_SubfigBaseType(sfig)
Inputs:
opts: cape.options.Options

Options interface

sfig: str

Name of subfigure

Outputs:
t: str

Subfigure parent type

Versions:
  • 2015-03-08 @ddalle: v1.0

get_SubfigCascade(sfig: str)

Return full set of optsion from subfig and its parents

Call:
>>> sfigopts = opts.get_SubfigCasecasde(sfig)
Inputs:
opts: cape.options.Options

Options interface

sfig: str

Name of subfigure

Outputs:
sfigopts: dict

Options for subfigure sfig

Versions:
  • 2015-03-08 @ddalle: v1.0

  • 2023-05-10 @ddalle: v2.0; optdict rewrites

get_SubfigOpt(sfig: str, opt: str, j=None, **kw)

Retrieve an option for a subfigure

Call:
>>> val = opts.get_SubfigOpt(sfig, opt, j=None, **kw)
Inputs:
opts: cape.options.Options

Options interface

sfig: str

Name of subfigure

opt: str

Name of option to retrieve

j: {None} | int

Phase index

Outputs:
val: object

Sweep option value

Versions:
  • 2023-04-27 @ddalle: v1.0