From f8ec2ade77a27a7218918aa0c9e472ff498a73bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Wei=C3=9Fenborn?= Date: Sat, 16 Oct 2021 15:01:22 +0200 Subject: [PATCH] Fix test --- .../builtin/io/yml/test/test_save_model.py | 46 +++++++------------ .../builtin/io/yml/test/test_save_scheme.py | 18 ++++---- 2 files changed, 26 insertions(+), 38 deletions(-) diff --git a/glotaran/builtin/io/yml/test/test_save_model.py b/glotaran/builtin/io/yml/test/test_save_model.py index 4705defc0..c00b1e37b 100644 --- a/glotaran/builtin/io/yml/test/test_save_model.py +++ b/glotaran/builtin/io/yml/test/test_save_model.py @@ -2,7 +2,7 @@ from typing import TYPE_CHECKING -from glotaran.examples.sequential import model +from glotaran.examples.sequential_spectral_decay import MODEL from glotaran.io import load_model from glotaran.io import save_model @@ -11,47 +11,35 @@ want = """dataset: - dataset1: + dataset_1: group: default - initial_concentration: j1 - irf: irf1 + irf: gaussian_irf megacomplex: - - m1 + - megacomplex_sequential_decay dataset_groups: default: link_clp: null residual_function: variable_projection -default-megacomplex: decay -initial_concentration: - j1: - compartments: - - s1 - - s2 - - s3 - exclude_from_normalize: [] - parameters: - - j.1 - - j.0 - - j.0 +default-megacomplex: decay-sequential irf: - irf1: + gaussian_irf: backsweep: false center: irf.center normalize: true type: gaussian width: irf.width -k_matrix: - k1: - matrix: - (s2, s1): kinetic.1 - (s3, s2): kinetic.2 - (s3, s3): kinetic.3 megacomplex: - m1: + megacomplex_sequential_decay: + compartments: + - species_1 + - species_2 + - species_3 dimension: time - k_matrix: - - k1 - type: decay + rates: + - rates.species_1 + - rates.species_2 + - rates.species_3 + type: decay-sequential """ @@ -61,7 +49,7 @@ def test_save_model( """Check all files exist.""" model_path = tmp_path / "testmodel.yml" - save_model(file_name=model_path, format_name="yml", model=model) + save_model(file_name=model_path, format_name="yml", model=MODEL) assert model_path.is_file() assert model_path.read_text() == want diff --git a/glotaran/builtin/io/yml/test/test_save_scheme.py b/glotaran/builtin/io/yml/test/test_save_scheme.py index 00266e81c..700f45dfb 100644 --- a/glotaran/builtin/io/yml/test/test_save_scheme.py +++ b/glotaran/builtin/io/yml/test/test_save_scheme.py @@ -4,9 +4,9 @@ import xarray as xr -from glotaran.examples.sequential import dataset -from glotaran.examples.sequential import model -from glotaran.examples.sequential import parameter +from glotaran.examples.sequential_spectral_decay import DATASET +from glotaran.examples.sequential_spectral_decay import MODEL +from glotaran.examples.sequential_spectral_decay import PARAMETER from glotaran.io import load_scheme from glotaran.io import save_dataset from glotaran.io import save_model @@ -35,16 +35,16 @@ def test_save_scheme(tmp_path: Path): scheme = Scheme( - model, - parameter, - {"dataset_1": dataset}, + MODEL, + PARAMETER, + {"dataset_1": DATASET}, model_file="m.yml", parameters_file="p.csv", data_files={"dataset_1": "d.nc"}, ) - save_model(model, tmp_path / "m.yml") - save_parameters(parameter, tmp_path / "p.csv") - save_dataset(dataset, tmp_path / "d.nc") + save_model(MODEL, tmp_path / "m.yml") + save_parameters(PARAMETER, tmp_path / "p.csv") + save_dataset(DATASET, tmp_path / "d.nc") scheme_path = tmp_path / "testscheme.yml" save_scheme(file_name=scheme_path, format_name="yml", scheme=scheme)