From 027f7709438d7663aa59c4f5b5e3b90ed0a65743 Mon Sep 17 00:00:00 2001 From: OngChia Date: Fri, 17 Jan 2025 14:49:18 +0100 Subject: [PATCH] cached_property for backend in Icon4pyRunConfig --- .../driver/src/icon4py/model/driver/icon4py_configuration.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/driver/src/icon4py/model/driver/icon4py_configuration.py b/model/driver/src/icon4py/model/driver/icon4py_configuration.py index 6d057a0edd..7bb7e9ffef 100644 --- a/model/driver/src/icon4py/model/driver/icon4py_configuration.py +++ b/model/driver/src/icon4py/model/driver/icon4py_configuration.py @@ -5,9 +5,9 @@ # # Please, refer to the LICENSE file in the root directory. # SPDX-License-Identifier: BSD-3-Clause - import dataclasses import datetime +import functools import logging from icon4py.model.atmosphere.diffusion import diffusion @@ -50,7 +50,7 @@ def __post_init__(self): f"Available backends are {', '.join([f'{k}' for k in model_backends.BACKENDS.keys()])}" ) - @property + @functools.cached_property def backend(self): return model_backends.BACKENDS[self.backend_name]