wolfhece.report.simplesimgpu

Create a report on a simple simulation from wolfgpu

Module Contents

wolfhece.report.simplesimgpu.cm2pts(cm)[source]

Convert centimeters to points for PyMuPDF.

One point equals 1/72 inches.

wolfhece.report.simplesimgpu.A4_rect()[source]

Return the A4 rectangle in PyMuPDF units.

(0, 0) is the top-left corner in PyMuPDF coordinates.

wolfhece.report.simplesimgpu.rect_cm(x, y, width, height)[source]

Create a rectangle in PyMuPDF units from centimeters.

(0, 0) is the top-left corner in PyMuPDF coordinates.

wolfhece.report.simplesimgpu.get_rect_from_text(text, width, fontsize=10, padding=5)[source]

Get a rectangle that fits the text in PyMuPDF units.

Parameters:
  • text – The text to fit in the rectangle.

  • width – The width of the rectangle in centimeters.

  • fontsize – The font size in points.

  • padding – Padding around the text in points.

Returns:

A PyMuPDF rectangle that fits the text.

wolfhece.report.simplesimgpu.list_to_html(list_items, font_size='10pt', font_family='Helvetica')[source]
wolfhece.report.simplesimgpu.list_to_html_aligned(list_items, font_size='10pt', font_family='Helvetica')[source]
class wolfhece.report.simplesimgpu.SimpleSimGPU_Report(sim: wolfgpu.simple_simulation.SimpleSimulation | pathlib.Path | str, **kwargs)[source]
_doc = None[source]
_summary[source]
_summary_versions()[source]

Find the versions of the simulation, wolfhece and the wolfgpu package

_summary_spatial_extent()[source]

Return the summary of the spatial extent of the simulation

_summary_number_of_cells()[source]

Return the summary of the number of cells in the simulation

_summary_time_evolution()[source]

Return the summary of the time evolution of the simulation

_summary_boundary_conditions()[source]

Return the summary of the boundary conditions of the simulation

_summary_infiltration()[source]

Return the summary of the infiltration conditions of the simulation

_figure_infiltration()[source]

Add the infiltration image to the PDF report

_summary_bathymetry()[source]

Return the summary of the bathymetry of the simulation

_summary_initial_conditions()[source]

Return the summary of the initial conditions of the simulation

_figure_histogram_waterdepth()[source]

Add the histogram of bathymetry to the PDF report

_figure_histogram_manning()[source]

Add the histogram of bathymetry to the PDF report

_summary_bridge()[source]

Return the summary of the bridge conditions of the simulation

_summary_warnings()[source]

Return the summary of the warnings of the simulation

_summary_errors()[source]

Return the summary of the errors of the simulation

_figure_model_extent()[source]

Get the bathymetry figure for the PDF report

summary()[source]

Create a dictionnary with the summary of the simulation

_layout()[source]

Set the layout of the PDF report.

Each group has a rectangle of 9cm width and 2.5 cm height.

Title rect is 16 cm width and 1.5 cm height. Version rect is 16 cm width and 1 cm height. Logo is at the top-right corner of the page (2 cm width x 3 cm height).

create_report()[source]

Create the PDF report for the Simple Simulation GPU

save_report(output_path: pathlib.Path | str = None)[source]

Save the report to a PDF file

property pdf_path[source]

Return the PDF document

class wolfhece.report.simplesimgpu.SimpleSimGPU_Report_wx(sim: wolfgpu.simple_simulation.SimpleSimulation | pathlib.Path | str, **kwargs)[source]

Bases: wolfhece.report.pdf.PDFViewer

Inheritance diagram of wolfhece.report.simplesimgpu.SimpleSimGPU_Report_wx

A sized frame.

Controls added to its content pane will automatically be added to the panes sizer.

_report[source]
on_close(event)[source]

Handle the close event of the frame

class wolfhece.report.simplesimgpu.SimpleSimGPU_Reports_wx(dir_or_sims: list[wolfgpu.simple_simulation.SimpleSimulation | pathlib.Path | str] | pathlib.Path, show: bool = True, **kwargs)[source]

List of Simple Simulations GPU

class wolfhece.report.simplesimgpu.SimpleSimGPU_Report_Compare(sims: list[wolfgpu.simple_simulation.SimpleSimulation | pathlib.Path | str] | pathlib.Path, **kwargs)[source]

Compare Multiple Simple Simulations GPU

_sims: list[wolfgpu.simple_simulation.SimpleSimulation][source]
_infos = [][source]
_report = None[source]
_summary_versions()[source]

Find the versions of the simulation, wolfhece and the wolfgpu package

_summary_array_shapes()[source]

Return the summary of the array shapes of the simulations

_summary_array_data()[source]

Return the summary of the array data of the simulations

_summary_resolution()[source]

Return the summary of the resolution of the simulations

_summary_boundary_conditions()[source]

Return the summary of the boundary conditions of the simulations

summary()[source]

Create a summary of the simulations

_html_table_compare(key: str, text: list)[source]

Create an HTML table to compare the simulations

One line for each parameter to compare. One column for each simulation. The first column is the parameter name. The first row is the simulation name.

_layout()[source]

Set the layout of the PDF report for the comparison.

create_report()[source]

Create the PDF report for the comparison

save_report(output_path: pathlib.Path | str = None)[source]

Save the report to a PDF file

property pdf_path[source]

Return the PDF document

class wolfhece.report.simplesimgpu.SimpleSimGPU_Report_Compare_wx(sims: list[wolfgpu.simple_simulation.SimpleSimulation | pathlib.Path | str], **kwargs)[source]

Bases: wolfhece.report.pdf.PDFViewer

Inheritance diagram of wolfhece.report.simplesimgpu.SimpleSimGPU_Report_Compare_wx

A sized frame.

Controls added to its content pane will automatically be added to the panes sizer.

_report[source]
on_close(event)[source]

Handle the close event to clean up resources