pyimcom.diagnostics.report

PyIMCOM diagnostic report base classes.

Classes

ReportSection

Section of the validataion report.

ValidationReport

An entire validation report, encompassing multiple sections.

Classes

ReportSection

Contains a report section.

ValidationReport

Contains the validation report.

Module Contents

class ReportSection(rpt)[source]

Contains a report section.

Parameters:

rpt (pyimcom.diagnostics.report.ValidationReport) – The report that this section belongs to.

tex[source]

LaTeX source.

Type:

str

data[source]

Machine readable data block, to be embedded in the report.

Type:

str

result[source]

Result of test (N/A for not completed).

Type:

str

__init__()[source]

Constructor

infile()[source]

Construct the input file name for a given block.

build()[source]

Build this report section.

Notes

The build method can be redefined in inherited classes, but should keep the signature. The optional nblockmax is used to restrict to a maximum size nblockmax x nblockmax sub-mosaic (this is mostly used for testing if you want to see if your section compiles without waiting for everything to run).

stem[source]
fnsuffix[source]
LegacyName[source]
cfg[source]
dstem[source]
datadir[source]
datastem[source]
datastem_from_dir[source]
tmp_dir[source]
tex = Multiline-String[source]
Show Value
"""
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
"""
data = ''[source]
result = 'N/A'[source]
infile(in_x, in_y)[source]

Get the input file name for a given block.

Parameters:
  • in_x (int) – Horizontal position of the block.

  • in_y (int) – Vertical position of the block.

Returns:

File name.

Return type:

str

build(nblockmax=100)[source]

Builds report section. Intended to be overwritten.

Parameters:

nblockmax (int, optional) – Maximum block size allowed.

Return type:

None

class ValidationReport(fname, dstem, clear_all=False, tmp_dir=None)[source]

Contains the validation report.

Parameters:
  • fname (str) – Block file name.

  • dstem (str) – Stem for output files.

  • clear_all (bool, optional) – Removes existing files.

  • tmp_dir (str or str-like, optional) – If specified, a temporary directory (usually on-node storage) for temporary files.

tex[source]

LaTeX source, dictionary with keys ‘preamble’, ‘head’, ‘body’, ‘appendix’, and ‘end’.

Type:

dict of str

stem[source]

Stem for the input files.

Type:

str

suffix

Suffix for the input files.

Type:

str

LegacyName[source]

Legacy naming convention for the input files with _map.fits? Should be False in the future.

Type:

bool

cfg[source]

The configuration used to generate the mosaic.

Type:

pyimcom.config.Config

dstem[source]

Stem for output files.

Type:

str

datadir[source]

Directory for associated data files.

Type:

str

datastem[source]

Stem for associated datafiles.

Type:

str

datastem_from_dir[source]

Stem for datafiles, local from compilation directory (for inclusion in LaTeX).

Type:

str

__init__()[source]

Constructor.

addsections()[source]

Add sections to the report.

texout()[source]

Generate LaTeX output.

writeto()[source]

Writes to a file.

compile()[source]

Compile the LaTeX source into a PDF.

Notes

Reports that use tmp_dir should check if it exists. Also, they should clean up after themselves. This is different from dstem (which is for intended new output files).

cfg[source]
dstem[source]
tmp_dir = None[source]
datadir[source]
datastem[source]
datastem_from_dir[source]
LegacyName = False[source]
stem[source]
fnsuffix = '.fits'[source]
tex[source]
addsections(sectionlist)[source]

Add the list of sections to the report.

Parameters:

sectionlist (list of pyimcom.diagnostics.report.ReportSection) – Sections to add to the report.

Return type:

None

texout()[source]

Returns the entire LaTeX file as one string.

writeto()[source]

Write the LaTeX file.

compile(ntimes=2, warn_pdf_err=False)[source]

Compile the LaTeX into a PDF.

Parameters:
  • ntimes (int, optional) – Number of times to compile (may have to run twice to get all the references).

  • warn_pdf_err (bool, optional) – If True, compilation failures result in a warning. If False (default), result in an exception.

Return type:

None