From cb47e0cb892ebdeb60bce4188aa668d5f03a4687 Mon Sep 17 00:00:00 2001 From: daanvaningen Date: Wed, 23 Oct 2024 14:10:13 +0200 Subject: [PATCH] fix interception settings in new schema version bug --- CHANGES.rst | 2 +- threedigrid_builder/interface/db.py | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 41fde0ab..0dbabe7e 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,7 +5,7 @@ Changelog of threedigrid-builder 1.20.1 (unreleased) ------------------- -- Nothing changed yet. +- Fix interception file settings not being read properly in new schema version. 1.20.0 (2024-10-14) diff --git a/threedigrid_builder/interface/db.py b/threedigrid_builder/interface/db.py index e8f75cd6..118072e0 100644 --- a/threedigrid_builder/interface/db.py +++ b/threedigrid_builder/interface/db.py @@ -199,13 +199,14 @@ def get_settings(self) -> dict: "friction_coefficient", default=AVERAGE if model_settings["friction_averaging"] else NO_AGG, ) - _set_initialization_type( - interception, - "interception", - file_field="interception_file", - type_field="interception_type", - default=NO_AGG, - ) + if interception: + _set_initialization_type( + interception, + "interception", + file_field="interception_file", + type_field="interception_type", + default=NO_AGG, + ) if interflow: _set_initialization_type(interflow, "porosity", default=NO_AGG) _set_initialization_type(