From 881a9214071eed0b9d1b7239be0d383eb663dc06 Mon Sep 17 00:00:00 2001 From: Will Barnes Date: Sun, 25 Aug 2024 18:24:02 -0400 Subject: [PATCH] dem options no longer passed as nested dict --- src/ebtelplusplus/high_level.py | 3 +-- src/ebtelplusplus/models.py | 15 +++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/ebtelplusplus/high_level.py b/src/ebtelplusplus/high_level.py index 995d2f5..327e4eb 100644 --- a/src/ebtelplusplus/high_level.py +++ b/src/ebtelplusplus/high_level.py @@ -76,7 +76,6 @@ def build_configuration(total_time, loop_length, solver, physics, dem, heating): 'radiation_data_dir': get_pkg_data_path('radiation', package='ebtelplusplus.data'), **solver.to_dict(), **physics.to_dict(), - 'calculate_dem': dem.calculate_dem, - 'dem': dem.to_dict(), + **dem.to_dict(), 'heating': heating.to_dict(), } diff --git a/src/ebtelplusplus/models.py b/src/ebtelplusplus/models.py index 70cfb84..f372a51 100644 --- a/src/ebtelplusplus/models.py +++ b/src/ebtelplusplus/models.py @@ -93,22 +93,25 @@ class DemModel: Parameters ---------- calculate_dem - use_new_method + use_new_tr_method temperature_bins log_temperature_min log_temperature_max """ calculate_dem: bool = False - use_new_method: bool = True + use_new_tr_method: bool = True temperature_bins: int = 451 temperature_min: u.Quantity[u.K] = 10**4*u.K temperature_max: u.Quantity[u.K] = 10**8.5*u.K def to_dict(self): - config = dataclasses.asdict(self) - config['temperature_min'] = config['temperature_min'].to_value('K') - config['temperature_max'] = config['temperature_max'].to_value('K') - return config + return { + 'calculate_dem': self.calculate_dem, + 'dem_use_new_tr_method': self.use_new_tr_method, + 'dem_temperature_bins': self.temperature_bins, + 'dem_temperature_min': self.temperature_min.to_value('K'), + 'dem_temperature_max': self.temperature_max.to_value('K'), + } class HeatingEvent: