From d06167371a5b9048ccfe22fc9bba840438bc1c66 Mon Sep 17 00:00:00 2001 From: Anselm Hahn Date: Sun, 21 Jan 2024 20:06:25 +0100 Subject: [PATCH] refactor: :recycle: Update model_dump() method calls --- spectrafit/api/test/test_cmd_model.py | 2 +- spectrafit/plugins/notebook.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/spectrafit/api/test/test_cmd_model.py b/spectrafit/api/test/test_cmd_model.py index de88706f4..59779eaa7 100644 --- a/spectrafit/api/test/test_cmd_model.py +++ b/spectrafit/api/test/test_cmd_model.py @@ -76,7 +76,7 @@ def test_global_fit() -> None: """Test for global fitting settings of CMD Model.""" result = CMDModelAPI(infile="") result.global_ = 1 - assert result.dict()["global_"] == 1 + assert result.model_dump()["global_"] == 1 def test_sha256() -> None: diff --git a/spectrafit/plugins/notebook.py b/spectrafit/plugins/notebook.py index 84670e383..3d992b770 100644 --- a/spectrafit/plugins/notebook.py +++ b/spectrafit/plugins/notebook.py @@ -369,8 +369,8 @@ def update_layout_axes( fig.update_layout( title=args_plot.title, legend_title=args_plot.legend_title, - legend=args_plot.legend.dict(), - font=args_plot.font.dict(), + legend=args_plot.legend.model_dump(), + font=args_plot.font.model_dump(), showlegend=args_plot.show_legend, width=args_plot.size[0], height=height, @@ -939,7 +939,9 @@ class refers to the `Pydantic`-Definition of the `SpectraFit` class. @property def pre_process(self) -> None: """Pre-processing class.""" - self.df, _pre_statistic = PreProcessing(df=self.df, args=self.args_pre.dict())() + self.df, _pre_statistic = PreProcessing( + df=self.df, args=self.args_pre.model_dump() + )() self.pre_statistic = _pre_statistic["data_statistic"] self.df_pre = self.df.copy()