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.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:
- class cape.cfdx.report.Report(cntl, rep)¶
Interface for automated report generation
- Call:
>>> R = cape.cfdx.report.Report(cntl, rep)
- Inputs:
- cntl:
cape.cntl.Cntl Master Cape settings interface
- 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-07
@ddalle: Started2015-03-10
@ddalle: First version2015-10-15
@ddalle: Basis version
- 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: First version
- 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:
- R:
cape.cfdx.report.Report Automated report interface
- I:
list[int] List of case indices
- sfig:
str Name of subfigure to check
- rc:
dict Dictionary from
report.json- fruns:
list(str) List of cases in the sweep
- nIter:
list[int] List of iterations for each case
- R:
- Outputs:
- q:
True|False Whether or not to update the subfigure
- q:
- Versions:
2016-10-25
@ddalle: First version
- 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: First version
- 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: First version
- EvalVar(v, i)¶
Evaluate a variable, expanding
$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: First version
- GetCoSweepIndices(fswp, i0, comp, cons=[], targ=None)¶
Return indices of a target data set that correspond to sweep constraints from a data book point
- Call:
>>> I = R.GetTargetSweepIndices(fswp, i0, comp, cons=[], targ=None)
- 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: {
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: First version
- GetFigureList(i, fswp=None)¶
Get list of figures for a report or sweep page
- Call:
>>> figs = R.GetFigureList(i) >>> figs = R.GetFigureList(I, fswp)
- Inputs:
- i:
int Case index
- I:
numpy.ndarray[int] List of case indices
- fswp:
str Name of sweep
- i:
- Outputs:
- figs:
list List of figure names
- figs:
- Versions:
2017-05-27
@ddalle: First version
- 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: First version
- 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:
- J:
list(numpy.ndarray[int]) List of sweep index lists
- J:
- Versions:
2015-05-29
@ddalle: First version
- GetTargetSweepIndices(fswp, i0, targ, cons=[])¶
Return indices of a target data set that correspond to sweep constraints from a data book point
- 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: First version
- 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 or not any of report figure lists has nonzero length
- q:
- Versions:
2015-06-03
@ddalle: First version
- 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: First version2017-01-07
@ddalle: Added 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: First version
- 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: First version
- 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: First version
- 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: First version
- 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: First version
- 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: First version
- 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:
Noneorcape.cfdx.dataBook.CaseFMderivative Case iterative force & moment history for one component
- FM:
- Versions:
2015-10-16
@ddalle: First version
- 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: First version
- 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:
Noneorcape.cfdx.dataBook.CaseResidderivative Case iterative residual history for one case
- hist:
- Versions:
2015-10-16
@ddalle: First version
- 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: First version
- 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: First version
- 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 or not 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: First version2017-04-05
@ddalle: Moved fromcape.pycart->cape
- ReadTecscript(fsrc)¶
Read a Tecplot script interface
- Call:
>>> R.ReadTecscript(fsrc)
- Inputs:
- R:
pyCart.report.Report Automated report interface
- fscr:
str Name of file to read
- R:
- Versions:
2016-10-25
@ddalle: First version
- 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: First version
- 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: First version
- 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:
- R.subfigs:
dict(list) List of LaTeX lines in each subfigure by name
- R.subfigs:
- Versions:
2017-05-27
@ddalle: First version
- 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: First version
- 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: First version
- 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: First version2014-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: First version
- 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: First version
- 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: First version
- SubfigImage(sfig, i, q)¶
Create image based on a file that is present in the case folder
- Call:
>>> lines = R.SubfigImage(sfig, i, q)
- Inputs:
- R:
pyCart.report.Report Automated report interface
- sfig:
str Name of sfigure to update
- i:
int Case index
- q:
bool Unused option whether or not to do work
- R:
- Versions:
2017-04-05
@ddalle: First version
- 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:
- lines:
list(str) Formatting lines to initialize a subfigure common to all types
- lines:
- Versions:
2016-01-16
@ddalle: First version
- SubfigParaviewLayout(sfig, i, q)¶
Create image based on a Paraview Python script
- Call:
>>> lines = R.SubfigParaviewLayout(sfig, i, q)
- Inputs:
- R:
pyCart.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-22
@ddalle: First version
- 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: First version
- 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: First version2015-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: First version
- 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: First version
- 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: First version
- 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: First version
- 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: First version
- 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: First version2015-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: First version
- 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: First version
- 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: First version
- 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: First version
- 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: First version (SubfigSweepPointHist)2018-02-13
@ddalle: Generic coefficient histograms
- 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: First version2015-06-02
@ddalle: 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:
- lines:
list(str) Updated list of lines for LaTeX file
- lines:
- Versions:
2016-10-25
@ddalle: First version, 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: First version
- 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:
- targs:
list(str) List of target names
- targs:
- Versions:
2015-06-04
@ddalle: First version
- 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: First version2016-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:
- R:
cape.cfdx.report.Report Automated report interface
- sfig:
str Name of subfigure to update
- fswp:
str Name of sweep
- I:
numpy.ndarray(list) List of case indices in the subsweep
- lines:
list(str) List of lines already in LaTeX file
- q:
True|False Whether or not to regenerate subfigure
- R:
- Outputs:
- lines:
list(str) Updated list of lines for LaTeX file
- lines:
- Versions:
2016-10-25
@ddalle: First version, 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: First version
- 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:
- lines:
list(str) List of lines for LaTeX file
- lines:
- Versions:
2015-05-29
@ddalle: First version
- 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: First version2015-05-22
@ddalle: Moved compilation portion to UpdateReport
- UpdateFigure(fig, i, fswp=None)¶
Write the figure and update the contents as necessary 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: First version2015-05-29
@ddalle: Extended to include sweeps2016-10-25
@ddalle: Checking
- 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: First version
- UpdateSweep(fswp, I=None, cons=[])¶
Update the pages of a sweep
- Call:
>>> R.UpdateSweep(fswp, I)
- 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
- R:
- Versions:
2015-05-29
@ddalle: First version2015-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: First version
- 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:
- lines:
list(str) List of lines for LaTeX file
- lines:
- Versions:
2015-05-29
@ddalle: First version2016-10-25
@ddalle: Passed handling to SweepSubfigSwitch
- 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: Started
- 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: First version
- 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: First version2015-10-15
@ddalle: Generic version
- WriteScientific(v, decimals=8)¶
Convert value or string to scientific notation
The typical behavior is
1.4e-5–>1.4 imes10^{-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: First version
- 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: First version
- WriteSweepSkeleton(fswp, i)¶
Initialize LaTeX file for sweep fswp beginning with 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: First version2015-10-15
@ddalle: Generic version
- cd(fdir)¶
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: First version
- mkdir(fdir)¶
Create a folder with the correct umask
Relies on
R.umask- Call:
>>> R.mkdir(fdir)
- Inputs:
- R:
cape.cfdx.report.Report Automated report interface
- fdir:
str Name of folder to make
- R:
- Versions:
2015-10-15
@ddalle: First versoin
- 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