From 38e4ecae47c93a605eb51fd271da88745058865f Mon Sep 17 00:00:00 2001 From: Richard Styron Date: Fri, 11 Sep 2026 11:51:46 -0700 Subject: [PATCH] added save_plot documentation --- doc_src/source/example_configs/reference_config.yml | 1 + doc_src/source/yaml_config_file.rst | 10 ++++++++++ openquake/hme/core/core.py | 4 +++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/doc_src/source/example_configs/reference_config.yml b/doc_src/source/example_configs/reference_config.yml index c572118..6d49a6f 100644 --- a/doc_src/source/example_configs/reference_config.yml +++ b/doc_src/source/example_configs/reference_config.yml @@ -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 diff --git a/doc_src/source/yaml_config_file.rst b/doc_src/source/yaml_config_file.rst index 2833309..cd769e5 100644 --- a/doc_src/source/yaml_config_file.rst +++ b/doc_src/source/yaml_config_file.rst @@ -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: diff --git a/openquake/hme/core/core.py b/openquake/hme/core/core.py index a6b4833..5f446d2 100644 --- a/openquake/hme/core/core.py +++ b/openquake/hme/core/core.py @@ -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.