mpylab.env.tem.e0y_report module

Report collection and rendering for evaluated TEM/GTEM e0y data.

exception mpylab.env.tem.e0y_report.E0yReportError

Bases: ValueError

Raised when an e0y report section cannot be created.

mpylab.env.tem.e0y_report.collect_e0y_report_data(tem, description)

Collect renderer-neutral data for one evaluated e0y dataset.

Parameters:
  • tem (TEMCell) – Measurement history containing evaluated e0y data.

  • description (str) – Key in tem.processedData_e0y.

Returns:

Report mapping containing source and geometry metadata, frequency coverage, probe-axis mapping, per-frequency summaries, per-point values, and measured-to-analytical comparison rows.

Return type:

dict

Raises:

E0yReportError – If the selected dataset is unavailable or contains no frequency data.

mpylab.env.tem.e0y_report.iter_e0y_pdf_figures(report)

Yield figures for the e0y section of a combined PDF.

Parameters:

report (mapping) – Renderer-neutral e0y report data.

Yields:

matplotlib.figure.Figure – Summary page followed by available e0y comparison plots. The caller owns each yielded figure and must close it.

mpylab.env.tem.e0y_report.write_e0y_figures(report, figures_dir, formats=('svg',))

Write standalone e0y figures.

Parameters:
  • report (mapping) – Renderer-neutral e0y report data.

  • figures_dir (path-like) – Destination directory. It is created when necessary.

  • formats (iterable of str, optional) – Requested image formats. Only "svg" and "png" create files.

Returns:

Mapping from stable figure names to lists of generated paths. Figures whose required data are unavailable are omitted, and all created Matplotlib figures are closed before returning.

Return type:

dict

mpylab.env.tem.e0y_report.write_e0y_html(report, output_dir, figure_paths, table_paths)

Write the standalone HTML page for one e0y section.

Parameters:
  • report (mapping) – Renderer-neutral e0y report data.

  • output_dir (path-like) – Existing section directory in which index.html is written.

  • figure_paths (mapping) – Figure-name mapping returned by write_e0y_figures(). Paths must be below output_dir.

  • table_paths (mapping) – Table-name mapping returned by write_e0y_tables(). Paths must be below output_dir.

Returns:

Path to the generated index.html page.

Return type:

pathlib.Path

mpylab.env.tem.e0y_report.write_e0y_report_data(report, output_dir, formats=('html', 'svg'))

Write one collected e0y report section.

Parameters:
  • report (mapping) – Renderer-neutral data returned by collect_e0y_report_data().

  • output_dir (path-like) – Section destination with generated tables and figures subdirectories.

  • formats (iterable of str, optional) – Section formats "html", "svg", and "png". HTML without an explicit image format adds SVG assets. A combined PDF is assembled separately from iter_e0y_pdf_figures().

Returns:

Generated output directory, table paths, and figure paths, plus the HTML path when requested.

Return type:

dict

mpylab.env.tem.e0y_report.write_e0y_tables(report, tables_dir)

Write machine-readable TSV tables for one e0y section.

Parameters:
  • report (mapping) – Renderer-neutral data returned by collect_e0y_report_data().

  • tables_dir (path-like) – Destination directory. It is created when the first table is written.

Returns:

Mapping from stable table names to paths for summary, frequency data, point data, and analytical comparison data.

Return type:

dict