cape.cfdx.report: Automated CFD report interface¶
cape.cfdx.report: Automated CFD report interface¶
The Cape module for generating automated results reports using PDFLaTeX
provides a single class cape.cfdx.report.Report, which creates
a handle for the tex file and creates folders containing individual
figures for each case. The cape.cfdx.report.Report class is a
sort of dual-purpose object that contains a file interface using
cape.filecntl.tex.Tex combined with a capability to create
figures for each case or sweep of cases mostly based on
cape.cfdx.dataBook.
An automated report is a multi-page PDF generated using PDFLaTeX. Usually, each CFD case has one or more pages dedicated to results for that case. The user defines a list of figures, each with its own list of subfigures, and these are generated for each case in the run matrix (subject to any command-line constraints the user may specify). Types of subfigures include
Table of the values of the input variables for this case
Table of force and moment values and statistics
Iterative histories of forces or moments (for one or more coefficients)
Iterative histories of residuals
Images using a Tecplot layout
Many more
In addition, the user may also define “sweeps,” which analyze groups of cases defined by user-specified constraints. For example, a sweep may be used to plot results as a function of Mach number for sets of cases having matching angle of attack and sideslip angle. When using a sweep, the report contains one or more pages for each sweep (rather than one or more pages for each case).
Reports are usually created using system commands of the following format.
The basis report class contains almost all of the capabilities needed
for generating the reports, and so the derivative classes such as
cape.pycart.report.Report, caep.pyfun.report.Report,
and cape.pyover.report.Report contain very little additional
content.
The class has an immense number of methods, which can be somewhat
grouped into bookkeeping methods and plotting methods. The main
user-facing methods are cape.cfdx.report.Report.UpdateCases() and
cape.cfdx.report.Report.UpdateSweep(). Each
type of subfigure has its own method,
for example cape.cfdx.report.Report.SubfigPlotCoeff() for
"PlotCoeff" or cape.cfdx.report.Report.SubfigPlotL2() for
"PlotL2".
- See also:
cape.cfdx.options.Report
- class cape.cfdx.report.Report(cntl, rep)¶
Interface for automated report generation
- Call:
>>> R = Report(cntl, rep)
- Inputs:
- cntl:
cape.cntl.Cntl CAPE run matrix control instance
- rep:
str Name of report to update
- cntl:
- Outputs:
- R:
cape.cfdx.report.Report Automated report interface
- R.cntl:
cape.cntl.Cntl Overall solver control interface
- R.rep:
str Name of report, same as rep
- R.opts:
cape.cfdx.options.Report.Report Options specific to report rep
- R.cases:
dict(cape.tex.Tex) Dictionary of LaTeX handles for each single-case page
- R.sweeps:
dict(cape.tex.Tex) Dictionary of LaTeX handles for each single-sweep page
- R.tex:
cape.tex.Tex Handle to main LaTeX file
- R:
- Versions:
2015-03-10
@ddalle: v1.02015-10-15
@ddalle: v1.1;cfdxversion
- CheckSubfigStatus(sfig, rc, n)¶
Check whether or not to update a subfigure and print status
- Call:
>>> q = R.CheckSubfigStatus(sfig, rc, n)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of subfigure to check
- rc:
dict Dictionary from
report.json- n:
int|None Current iteration number
- R:
- Outputs:
- q:
True|False Whether or not to update the subfigure
- q:
- Versions:
2016-10-25
@ddalle: v1.0
- CheckSweepSubfigStatus(sfig, rc, fruns, nIter)¶
Check whether or not to update a subfigure and print status
- Call:
>>> q = R.CheckSweepSubfigStatus(sfig, I, rc, fruns, nIter)
- Inputs:
- Outputs:
- q:
True|False Whether or not to update the subfigure
- q:
- Versions:
2016-10-25
@ddalle: v1.0
- CleanUpCases(I=None, cons=[])¶
Clean up case folders
- Call:
>>> R.CleanUpCases(I=None, cons=[])
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- I:
list[int] List of case indices
- cons:
list[str] List of constraints to define what cases to update
- R:
- Versions:
2015-05-29
@ddalle: v1.0
- CleanUpSweeps(I=None, cons=[])¶
Clean up the folders for all sweeps
- Call:
>>> R.CleanUpSweeps(I=None, cons=[])
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- I:
list[int] List of case indices
- cons:
list[str] List of constraints to define what cases to update
- R:
- Versions:
2015-05-29
@ddalle: v1.0
- EvalVar(v, i)¶
Eval expression,
$machtox.mach[i], etc.- Call:
>>> v = R.EvalVar(txt, i)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- txt:
str String, with
$as sigil for variables to expand- i:
int Case index
- R:
- Outputs:
- v:
str Input string with sigils expanded and evaluated
- v:
- Versions:
2016-10-31
@ddalle: v1.0
- GetCoSweepIndices(fswp, i0, comp, cons=[], targ=None)¶
Get indices of a target matching local sweep constraints
- Call:
>>> I = R.GetTargetSweepIndices(fswp, i0, comp, cons, targ)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- fswp:
str Name of sweep to update
- i0:
int Index of ref point in R.cntl.DataBook.x
- targ: {
None} |str Name of the target in data book to use (if any)
- R:
- Outputs:
- I:
numpy.ndarray[int] List of target data indices
- I:
- Versions:
2015-06-03
@ddalle: v1.0
- GetFigureList(i, fswp=None)¶
Get list of figures for a report or sweep page
- GetSubfigRefComponent(sfig)¶
Get handle for data book component for a sweep subfigure
- Call:
>>> DBc = R.GetSubfigRefComponent(sfig)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of subfigure
- R:
- Outputs:
- DBc:
cape.cfdx.dataBook.DBBase Component data book
- DBc:
- Versions:
2017-04-23
@ddalle: v1.0
- GetSweepIndices(fswp, I=None, cons=[], comp=None)¶
Divide cases into individual sweeps
- Call:
>>> J = R.GetSweepIndices(fswp, I=None, cons=[], comp=None)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- fswp:
str Name of sweep to update
- I:
list[int] List of case indices
- cons:
list[str] List of constraints to define what cases to update
- comp: {
None} |str Optional name of DataBook component (useful for TriqFM components, which may have a different trajectory)
- R:
- Outputs:
- Versions:
2015-05-29
@ddalle: v1.0
- GetTargetSweepIndices(fswp, i0, targ, cons=[])¶
Get indices of target matching a local sweep’s constraint
- Call:
>>> I = R.GetTargetSweepIndices(fswp, i0, targ)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- fswp:
str Name of sweep to update
- i0:
int Index of point in R.cntl.DataBook.x to use as reference
- targ:
int Name of the target in data book to use
- R:
- Outputs:
- I:
numpy.ndarray[int] List of target data indices
- I:
- Versions:
2015-06-03
@ddalle: v1.0
- HasCaseFigures()¶
Check if there are any case figures for this report
- Call:
>>> q = R.HasCaseFigures()
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- R:
- Outputs:
- q:
bool Whether any of report’s figure lists has nonzero length
- q:
- Versions:
2015-06-03
@ddalle: v1.02025-05-15
@ddalle: v1.1; fix for fig lists == None
- LinkVizFiles(sfig=None, i=None)¶
Create links to appropriate visualization files
- Call:
>>> R.LinkVizFiles(sfig, i)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of subfigure
- i:
int Case index
- R:
- Versions:
2016-02-06
@ddalle: v1.02017-01-07
@ddalle: v1.1; add sfig and i inputs
- OpenMain()¶
Open the primary LaTeX file or write skeleton if necessary
- Call:
>>> R.OpenMain()
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- R:
- Versions:
2015-03-08
@ddalle: v1.0
- PrepTecplotColorMaps(tec, sfig, i)¶
Customize color maps for a Tecplot layout
- Call:
>>> R.PrepTecplotColorMaps(tec, sfig, i)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- tec:
cape.filecntl.tecplot.Tecscript Tecplot layout interface (modified in place)
- sfig:
str Name of subfigure for accessing options
- i:
int Case index
- R:
- Versions:
2017-01-05
@ddalle: v1.0
- PrepTecplotContourLevels(tec, sfig, i)¶
Customize contour levels for a Tecplot layout
- Call:
>>> R.PrepTecplotContourLevels(tec, sfig, i)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- tec:
cape.filecntl.tecplot.Tecscript Tecplot layout interface (modified in place)
- sfig:
str Name of subfigure for accessing options
- i:
int Case index
- R:
- Versions:
2017-01-05
@ddalle: v1.0
- PrepTecplotLayoutKeys(tec, sfig, i)¶
Set any parameters for Tecplot layout
- Call:
>>> R.PrepTecplotLayoutKeys(tec, sfig, i)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- tec:
cape.filecntl.tecplot.Tecscript Tecplot layout interface (modified in place)
- sfig:
str Name of subfigure for accessing options
- i:
int Case index
- R:
- Versions:
2017-03-23
@ddalle: v1.0
- PrepTecplotLayoutVars(tec, sfig, i)¶
Set any variables for Tecplot layout
- Call:
>>> R.PrepTecplotLayoutVars(tec, sfig, i)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- tec:
cape.filecntl.tecplot.Tecscript Tecplot layout interface (modified in place)
- sfig:
str Name of subfigure for accessing options
- i:
int Case index
- R:
- Versions:
2016-10-31
@ddalle: v1.0
- PrepTecplotSlicePosition(tec, sfig, i)¶
Set slice position for Tecplot layout
- Call:
>>> R.PrepTecplotSlicePosition(tec, sfig, i)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- tec:
cape.filecntl.tecplot.Tecscript Tecplot layout interface (modified in place)
- sfig:
str Name of subfigure for accessing options
- i:
int Case index
- R:
- Versions:
2016-10-31
@ddalle: v1.0
- ReadCaseFM(comp)¶
Read iterative history for a component
This function needs to be customized for each solver
- Call:
>>> FM = R.ReadCaseFM(comp)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- comp:
str Name of component to read
- R:
- Outputs:
- FM:
None|cape.cfdx.dataBook.CaseFM Case iterative force & moment history for one component
- FM:
- Versions:
2015-10-16
@ddalle: v1.0
- ReadCaseJSON()¶
Read the JSON file which contains the current statuses
- Call:
>>> rc = R.ReadCaseJSON()
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- R:
- Outputs:
- rc:
dict Dictionary of subfigure definitions and status
- rc:
- Versions:
2016-10-25
@ddalle: v1.0
- ReadCaseResid(sfig=None)¶
Read iterative residual history for a component
This function needs to be customized for each solver
- Call:
>>> hist = R.ReadCaseResid()
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- R:
- Outputs:
- hist:
None|cape.cfdx.dataBook.CaseResid Case iterative residual history for one case
- hist:
- Versions:
2015-10-16
@ddalle: v1.0
- ReadDBComp(comp, targ=None)¶
Read a data book component and return it
- Call:
>>> DBc = R.ReadDBComp(comp, targ=None)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- comp:
str Name of data book component
- targ: {
None} |str Name of target, if any
- R:
- Outputs:
- DBc:
None|cape.cfdx.dataBook.DBBase Individual component data book or
Noneif not found
- DBc:
- Versions:
2017-04-20
@ddalle: v1.0
- ReadDataBook(fsrc='data')¶
Read the data book if necessary for a specific sweep
- Call:
>>> R.ReadDataBook(fsrc="data")
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- fsrc: {
"data"} |"trajectory"|str Data book trajectory source
- R:
- Versions:
2015-05-29
@ddalle: v1.0
- ReadLineLoad(comp, i, targ=None, update=False)¶
Read line load for a case
- Call:
>>> LL = R.ReadLineLoad(comp, i, targ=None, update=False)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- comp:
str Name of line load component
- i:
int Case number
- targ: {
None} |str Name of target data book to read, if not
None- update:
True| {False} Whether to attempt an update if case not in data book
- R:
- Outputs:
- LL:
cape.cfdx.lineLoad.CaseLL Individual case line load interface
- LL:
- Versions:
2016-06-10
@ddalle: v1.02017-04-05
@ddalle: v1.1;cfdxversion
- ReadTecscript(fsrc)¶
Read a Tecplot script interface
- Call:
>>> R.ReadTecscript(fsrc)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- fscr:
str Name of file to read
- R:
- Versions:
2016-10-25
@ddalle: v1.0
- ReadTriqFM(comp, fsrc='data', targ=None)¶
Read a TriqFM data book if necessary for a specific sweep
- Call:
>>> DBF = R.ReadTriqFM(comp, fsrc="data", targ=None)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- comp:
str Name of TriqFM component
- fsrc: {
"data"} |"trajectory"|str Data book trajectory source
- targ: {
None} |str Name of target data book, if any
- R:
- Outputs:
- DBF:
cape.cfdx.pointSensor.DBTriqFM Patch loads data book
- DBF:
- Versions:
2017-04-05
@ddalle: v1.0
- ReadTriqPoint(grp, pt, targ=None)¶
Read a point sensor
- Call:
>>> DBP = R.ReadTriqPoint(grp, pt, targ=None)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- grp:
str Name of TriqPoint group
- pt:
str Name of the TriqPoint sensor
- targ: {
None} |str Name of target data book, if any
- R:
- Outputs:
- DBF:
cape.cfdx.pointSensor.DBTriqFM Point sensor group data book
- DBF:
- Versions:
2018-02-09
@ddalle: v1.0
- RemoveCase(i)¶
Remove case folder or tar
- Call:
>>> R.RemoveCase(i)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- i:
int Case index
- R:
- Versions:
2023-06-06
@aburkhea: v1.0
- RemoveCases(I=None, cons=[], **kw)¶
Remove case folders or tars
- Call:
>>> R.RemoveCases(I=None, cons=[])
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- I:
list[int] List of case indices
- cons:
list(str) List of constraints to define what cases to remove
- R:
- Versions:
2023-06-06
@aburkhea: v1.0
- SaveSubfigs(i, fswp=None)¶
Save the current text of subfigures
- Call:
>>> R.SaveSubfigs(i) >>> R.SaveSubfigs(I, fswp)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- i:
int Case index
- I:
numpy.ndarray[int] List of case indices
- fswp:
str Name of sweep
- R:
- Attributes:
- Versions:
2017-05-27
@ddalle: v1.0
- SetHeaderStatus(i)¶
Set header to state iteration progress and summary status
- Call:
>>> R.SetHeaderStatus(i)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- i:
int Case index
- R:
- Versions:
2014-03-08
@ddalle: v1.0
- SubfigCaption(sfig, cdef=None)¶
Get a caption for a subfigure
This relies on the options Caption and CaptionComponent. A Caption specification creates a full caption, while the CaptionComponent creates a prefix. The default caption has the format Component/Coefficient if applicable, and otherwise uses sfig.
- Call:
>>> fcpt = R.SubfigCaption(sfig, cdef=None)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of sfigure to update
- cdef: {
None} |str Default caption
- R:
- Outputs:
- fcpt:
str Caption
- fcpt:
- Versions:
2017-03-31
@ddalle: v1.0
- SubfigConditions(sfig, I, q=True)¶
Create lines for a “Conditions” subfigure
- Call:
>>> lines = R.SubfigConditions(sfig, i, q=True) >>> lines = R.SubfigConditions(sfig, I, q=True)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of sfigure to update
- i:
int Case index
- I:
numpy.ndarray[int] List of case indices
- q:
True|False Whether or not to update images
- R:
- Versions:
2014-03-08
@ddalle: v1.02014-06-02
@ddalle: Added range capability
- SubfigContourCoeff(sfig, fswp, I, q)¶
Create a contour plot of results from several cases
- Call:
>>> R.SubfigSweepCoeff(sfig, fswp, I, q)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of sfigure to update
- fswp:
str Name of sweep
- I:
numpy.ndarray[int] List of indices in the sweep
- q:
True|False Whether or not to update images
- R:
- Versions:
2017-04-17
@ddalle: v1.0
- SubfigFormatAxes(sfig, ax)¶
Apply formatting options to an
AxesSubplotinstance- Call:
>>> R.SubfigFormatAxes(sfig, ax)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of subfigure to update
- ax:
matplotlib.axes._subplots.AxesSubplot Axis handle
- R:
- Versions:
2017-10-12
@ddalle: v1.0
- SubfigFunction(sfig, I)¶
Apply a generic Python function to a subfigure definition
- Call:
>>> R.SubfigFunction(sfig, i) >>> R.SubfigFunction(sfig, I)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of subfigure to initialize
- i:
int Case index
- I:
np.ndarray[int] Case index
- R:
- Versions:
2017-06-22
@ddalle: v1.0
- SubfigImage(sfig, i, q)¶
Create image based on a file present in the case folder
- SubfigInit(sfig)¶
Create the initial lines of a subfigure
- Call:
>>> lines = R.SubfigInit(sfig)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of subfigure to initialize
- R:
- Outputs:
- Versions:
2016-01-16
@ddalle: v1.0
- SubfigParaviewLayout(sfig, i, q)¶
Create image based on a Paraview Python script
- SubfigPlotCoeff(sfig, i, q)¶
Create plot for a coefficient and input lines int LaTeX file
- Call:
>>> lines = R.SubfigPlotCoeff(sfig, i, q)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of subfigure to update
- i:
int Case index
- q:
True|False Whether or not to update images
- R:
- Versions:
2015-03-09
@ddalle: v1.0
- SubfigPlotL1(sfig, i, q)¶
Create plot for L1 residual
- Call:
>>> lines = R.SubfigPlotL1(sfig, i, q)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of sfigure to update
- i:
int Case index
- q:
True|False Whether or not to update images
- R:
- Versions:
2014-03-09
@ddalle: v1.02015-11-25
@ddalle: Moved contents toSubfigPlotResid()
- SubfigPlotL2(sfig, i, q)¶
Create plot for L2 residual
- Call:
>>> lines = R.SubfigPlotL2(sfig, i, q)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of sfigure to update
- i:
int Case index
- q:
True|False Whether or not to update images
- R:
- Versions:
2015-11-25
@ddalle: v1.0
- SubfigPlotLInf(sfig, i, q)¶
Create plot for L2 residual
- Call:
>>> lines = R.SubfigPlotL2(sfig, i, q)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of sfigure to update
- i:
int Case index
- q:
True|False Whether or not to update images
- R:
- Versions:
2015-11-25
@ddalle: v1.0
- SubfigPlotLabel(sfig, k)¶
Get line label for subfigure plot
- Call:
>>> lbl = R.SubfigPlotLabel(sfig, k)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of sfigure to update
- k:
int Plot index
- q:
True|False Whether or not to update images
- R:
- Outputs:
- lbl:
str Plot label
- lbl:
- Versions:
2015-06-04
@ddalle: v1.0
- SubfigPlotLineLoad(sfig, i, q)¶
Create plot for a sectional loads profile
- Call:
>>> lines = R.SubfigPlotLineLoad(sfig, i, q)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of subfigure to update
- i:
int Case index
- q:
True|False Whether or not to update images
- R:
- Versions:
2016-06-10
@ddalle: v1.0
- SubfigPlotLineLoadGroup(sfig, fswp, I, q)¶
Plot a line load for a group of cases
- Call:
>>> R.SubfigPlotLineLoadGroup(sfig, fswp, I, q)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of sfigure to update
- fswp:
str Name of sweep
- I:
numpy.ndarray[int] List of indices in the sweep
- q:
True|False Whether or not to update images
- R:
- Versions:
2017-04-23
@ddalle: v1.0
- SubfigPlotResid(sfig, i, q, c=None)¶
Create plot for named residual
- Call:
>>> lines = R.SubfigPlotResid(sfig, i, c=None)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of sfigure to update
- i:
int Case index
- q:
True|False Whether or not to update images
- c:
str Name of residual to plot (defaults to option from JSON)
- R:
- Versions:
2014-03-09
@ddalle: v1.02015-11-25
@ddalle: Forked fromSubfigPlotL1()
- SubfigPlotTurbResid(sfig, i, q)¶
Create plot for turbulence residual
- Call:
>>> lines = R.SubfigPlotTurbResid(sfig, i, q)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of sfigure to update
- i:
int Case index
- q:
True|False Whether or not to update images
- R:
- Versions:
2015-11-25
@ddalle: v1.0
- SubfigSummary(sfig, i, q=True)¶
Create lines for a “Summary” subfigure
- Call:
>>> lines = R.SubfigSummary(sfig, i, q=True)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of sfigure to update
- i:
int Case index
- q:
True|False Whether or not to update images
- R:
- Versions:
2014-03-09
@ddalle: v1.0
- SubfigSweepCases(sfig, fswp, I, q=True)¶
Create lines for a “SweepConditions” subfigure
- Call:
>>> lines = R.SubfigSweepCases(sfig, fswp, I)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of sfigure to update
- fswp:
str Name of sweep
- I:
numpy.ndarray[int] Case indices
- q:
True|False Whether or not to update images
- R:
- Outputs:
- lines:
str List of lines in the subfigure
- lines:
- Versions:
2015-06-02
@ddalle: v1.0
- SubfigSweepCoeff(sfig, fswp, I, q)¶
Plot a sweep of a coefficient over several cases
- Call:
>>> R.SubfigSweepCoeff(sfig, fswp, I, q)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of sfigure to update
- fswp:
str Name of sweep
- I:
numpy.ndarray[int] List of indices in the sweep
- q:
True|False Whether or not to update images
- R:
- Versions:
2015-05-28
@ddalle: v1.0
- SubfigSweepCoeffHist(sfig, fswp, I, q)¶
Plot a histogram of a coefficient over several cases
- Call:
>>> R.SubfigSweepCoeffHist(sfig, fswp, I)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of sfigure to update
- fswp:
str Name of sweep
- I:
numpy.ndarray[int] List of indices in the sweep
- q:
True|False Whether or not to redraw images
- R:
- Versions:
2016-01-16
@ddalle: v1.0 (SubfigSweepPointHist)2018-02-13
@ddalle: v1.0
- SubfigSweepConditions(sfig, fswp, i, q=True)¶
Create lines for a “SweepConditions” subfigure
- Call:
>>> lines = R.SubfigSweepConditions(sfig, fswp, I, q)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of sfigure to update
- fswp:
str Name of sweep
- i:
int Case index
- q:
True|False Whether or not to update images
- R:
- Outputs:
- lines:
str List of lines in the subfigure
- lines:
- Versions:
2015-05-29
@ddalle: v1.02015-06-02
@ddalle: v1.1; add min/max values
- SubfigSwitch(sfig, i, lines, q)¶
Switch function to find the correct subfigure function
This function may need to be defined for each CFD solver
- Call:
>>> lines = R.SubfigSwitch(sfig, i, lines, q)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of subfigure to update
- i:
int Case index
- lines:
list[str] List of lines already in LaTeX file
- q:
True|False Whether or not to regenerate subfigure
- R:
- Outputs:
- Versions:
2016-10-25
@ddalle: v1.0, fromUpdateSubfig()
- SubfigTargetPlotLabel(sfig, k, targ)¶
Get line label for subfigure plot
- Call:
>>> lbl = R.SubfigPlotLabel(sfig, k, targ)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of sfigure to update
- k:
int Plot index
- targ:
str Name of target
- R:
- Outputs:
- lbl:
str Plot label for target plot
- lbl:
- Versions:
2015-06-04
@ddalle: v1.0
- SubfigTargets(sfig)¶
Return list of targets (by name) for a subfigure
- Call:
>>> targs = R.SubfigTargets(sfig)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of sfigure to update
- R:
- Outputs:
- Versions:
2015-06-04
@ddalle: v1.0
- SubfigTecplotLayout(sfig, i, q)¶
Create image based on a Tecplot layout file
- Call:
>>> lines = R.SubfigTecplotLayout(sfig, i)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of sfigure to update
- i:
int Case index
- R:
- Versions:
2016-09-06
@ddalle: v1.02016-10-05
@ddalle: Added “FieldMap” option2016-10-25
@ddalle: Firstcapeversion
- SweepSubfigSwitch(sfig, fswp, I, lines, q)¶
Switch function to find the correct subfigure function
This function may need to be defined for each CFD solver
- Call:
>>> lines = R.SubfigSwitch(sfig, fswp, I, lines)
- Inputs:
- Outputs:
- Versions:
2016-10-25
@ddalle: v1.0, fromUpdateSubfig()
- UpdateCase(i)¶
Open, create if necessary, and update LaTeX file for a case
- Call:
>>> R.UpdateCase(i)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- i:
int Case index
- R:
- Versions:
2015-03-08
@ddalle: v1.02023-10-21
@ddalle: v1.1; allow arbitray depth
- UpdateCaseSubfigs(fig, i)¶
Update subfigures for a case figure fig
- Call:
>>> lines = R.UpdateCaseSubfigs(fig, i)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- fig:
str Name of figure to update
- i:
int Case index
- R:
- Outputs:
- Versions:
2015-05-29
@ddalle: v1.0
- UpdateCases(I=None, **kw)¶
Update several cases and add the lines to the master LaTeX file
- Call:
>>> R.UpdateCases(I=None, **kw)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- I:
list[int] List of case indices
- cons:
list[str] List of constraints to define what cases to update
- R:
- Versions:
2015-03-10
@ddalle: v1.02015-05-22
@ddalle: v1.1; move compile call
- UpdateFigure(fig, i, fswp=None)¶
Write the figure and update the contents as needed for fig
- Call:
>>> R.UpdateFigure(fig, i) >>> R.UpdateFigure(fig, I, fswp)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- fig:
str Name of figure to update
- i:
int Case index
- I:
numpy.ndarray[int] List of case indices
- fswp:
str Name of sweep
- R:
- Versions:
2014-03-08
@ddalle: v1.02015-05-29
@ddalle: v1.1; include sweeps2016-10-25
@ddalle: v1.2; add checks
- UpdateReport(**kw)¶
Update a report based on the list of figures
- Call:
>>> R.UpdateReport(I) >>> R.UpdateReport(cons=[])
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- I:
list[int] List of case indices
- cons:
list[str] List of constraints to define what cases to update
- R:
- Versions:
2015-05-22
@ddalle: v1.0
- UpdateSweep(fswp, I=None, cons=[])¶
Update the pages of a sweep
- Call:
>>> R.UpdateSweep(fswp, I)
- Inputs:
- Versions:
2015-05-29
@ddalle: v1.02015-06-11
@ddalle: Added minimum cases per page
- UpdateSweepPage(fswp, I, IT=[])¶
Update one page of a sweep for an automatic report
- Call:
>>> R.UpdateSweepPage(fswp, I, IT=[])
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- fswp:
str Name of sweep to update
- I:
numpy.ndarray[int] List of cases in this sweep
- IT:
list(numpy.ndarray[int]) List of correspond indices for each target
- R:
- Versions:
2015-05-29
@ddalle: v1.02023-10-21
@ddalle: v1.1; allow arbitrary depth
- UpdateSweepSubfigs(fig, fswp, I)¶
Update subfigures for a sweep figure fig
- Call:
>>> lines = R.UpdateSweepSubfigs(fig, fswp, I)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- fig:
str Name of figure to update
- fswp:
str Name of sweep
- I:
numpy.ndarray[int] List of case indices in the subsweep
- R:
- Outputs:
- Versions:
2015-05-29
@ddalle: v1.02016-10-25
@ddalle: v1.1; move some to SubfigSwitch()
- UpdateSweeps(I=None, cons=[], **kw)¶
Update pages of the report related to data book sweeps
- Call:
>>> R.UpdateSweeps(I=None, cons=[], **kw)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- I:
list[int] List of case indices
- cons:
list[str] List of constraints to define what cases to update
- R:
- Versions:
2015-05-28
@ddalle: v1.0
- WriteCaseJSON(rc)¶
Write the current status to
report.json- Call:
>>> R.WriteCaseJSON(rc)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- rc:
dict Dictionary of subfigure definitions and status
- R:
- Versions:
2016-10-25
@ddalle: v1.0
- WriteCaseSkeleton(i)¶
Initialize LaTeX file for case i
- Call:
>>> R.WriteCaseSkeleton(i, frun)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- i:
int Case index
- R:
- Versions:
2014-03-08
@ddalle: v1.02015-10-15
@ddalle: v1.1;cfdxversion
- WriteScientific(v, decimals=8)¶
Convert value or string to scientific notation
The typical behavior is
1.4e-5–>1.4\times10^{-5}- Call:
>>> word = R.WriteScientific(v, decimals=8)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- v:
str|float|int Value to be translated, preferably a string
- decimals: {
8} |int> 4 Round floats at \(10^{-d}\)
- R:
- Outputs:
- word:
str String with substitutions made
- word:
- Versions:
2017-04-11
@ddalle: v1.0
- WriteSkeleton()¶
Create and write preamble for master LaTeX file for report
- Call:
>>> R.WriteSkeleton()
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- R:
- Versions:
2015-03-08
@ddalle: v1.0
- WriteSweepSkeleton(fswp, i)¶
Initialize LaTeX file for sweep fswp beginning w/ case i
- Call:
>>> R.WriteSweepSkeleton(fswp, i)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- i:
int Case index
- R:
- Versions:
2015-05-29
@ddalle: v1.02015-10-15
@ddalle: Generic version
- cd(fdir: str)¶
Interface to
os.chdir(), respecting “Archive” optionThis function can only change one directory at a time.
- Call:
>>> R.cd(fdir)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- fdir:
str Name of directory to change to
- R:
- Versions:
2015-03-08
@ddalle: v1.0
- save_figure(sfig=None, h=None)¶
Write out image files in varous formats
- Call:
>>> R.save_figure(sfig, sfig, h)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of subfigure
- h:
matplotlib.figure Matplotlib figure handle
- R:
- Output:
- fimg:
str Figure name
- fimg:
- Versions:
2023-06-06
@jmeeroff: First version