From d65afaa456cc57e0286ca6427c8aef52e1b41e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Sierro?= Date: Tue, 26 Sep 2023 08:14:04 +0200 Subject: [PATCH] quickfixes, ready for full dispersion rewrite --- src/scgenerator/parameter.py | 4 ++-- src/scgenerator/plotting.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/scgenerator/parameter.py b/src/scgenerator/parameter.py index fde6c64..14fbc56 100644 --- a/src/scgenerator/parameter.py +++ b/src/scgenerator/parameter.py @@ -15,7 +15,7 @@ import numpy as np from scgenerator.const import MANDATORY_PARAMETERS, __version__ from scgenerator.evaluator import Evaluator, EvaluatorError from scgenerator.io import CustomEncoder, DataFile, custom_decode_hook -from scgenerator.operators import Qualifier, SpecOperator +from scgenerator.operators import Qualifier, SpecOperator, VariableQuantity T = TypeVar("T") DISPLAY_INFO = {} @@ -409,7 +409,7 @@ class Parameters: worker_num: int = Parameter(positive(int)) # computed - linear_operator: SpecOperator = Parameter(is_function, can_pickle=False) + linear_operator: VariableQuantity = Parameter(is_function, can_pickle=False) nonlinear_operator: SpecOperator = Parameter(is_function, can_pickle=False) conserved_quantity: Qualifier = Parameter(is_function, can_pickle=False) fft: Callable[[np.ndarray], np.ndarray] = Parameter(is_function, can_pickle=False) diff --git a/src/scgenerator/plotting.py b/src/scgenerator/plotting.py index 2407319..bd67f9a 100644 --- a/src/scgenerator/plotting.py +++ b/src/scgenerator/plotting.py @@ -1165,6 +1165,8 @@ def summary_plot( if z is None: z = np.arange(specs.shape[0]) + elif len(z) > specs.shape[0]: + z = z[:specs.shape[0]] if wl_range is None: imin, imax = math.span_above(wl_int, wl_int.max() * 1e-6)