Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc_src/source/example_configs/reference_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ config:
investigation_time: 40. # [optional] Duration in years; defaults
# to seis_catalog duration
annualize: True # [optional] Annualize rates; default True
# save_plot: outputs/model_mfd.png # [optional] Save the plot to this file

# Maximum Magnitude Check (sanity check)
# Checks whether the model can produce earthquakes as large as the
Expand Down
10 changes: 10 additions & 0 deletions doc_src/source/yaml_config_file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,22 @@ This optional section configures report generation. Currently there is one
option, the ``basic`` HTML report, which aggregates all test and evaluation
results into maps, plots, and tables.

Report-producing tests and evaluations may include ``save_plot`` in their own
configuration. Set it to a filename to save the generated plot; it defaults
to ``false``.

.. code-block:: yaml

report:
basic:
outfile: outputs/report.html

config:
model_framework:
gem:
N_test:
save_plot: outputs/n_test.png


.. _output:

Expand Down
4 changes: 3 additions & 1 deletion openquake/hme/core/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ def read_yaml_config(
yaml_config: Openable, fill_fields: bool = True, validate: bool = True
) -> dict:
"""
Reads a model test configuration file (YAML).
Reads a model test configuration file (YAML). Report-producing tests and
evaluations may set ``save_plot`` to a plot filename to save their plots;
it defaults to ``False``.

:param yaml_config:
path or file-like object in the YAML format.
Expand Down
Loading