From 6e205cdcbe895a6c1a42f0b7113c50907d968835 Mon Sep 17 00:00:00 2001 From: NicolaCourtier <45851982+NicolaCourtier@users.noreply.github.com> Date: Tue, 22 Oct 2024 17:08:24 +0100 Subject: [PATCH 1/3] Allow different lengths for validation plots --- pybop/plot/problem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pybop/plot/problem.py b/pybop/plot/problem.py index 3a644fb5c..0e21e1169 100644 --- a/pybop/plot/problem.py +++ b/pybop/plot/problem.py @@ -73,7 +73,7 @@ def quick(problem, problem_inputs: Inputs = None, show=True, **layout_kwargs): ) plot_dict.traces.append(target_trace) - if isinstance(problem, FittingProblem): + if isinstance(problem, FittingProblem) and len(model_output) == len(target_output): # Compute the standard deviation as proxy for uncertainty plot_dict.sigma = np.std(model_output[i] - target_output[i]) From 582ed46c1bc398f61a3afd8d44cc6e1c4a4d88a1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 16:11:56 +0000 Subject: [PATCH 2/3] style: pre-commit fixes --- pybop/plot/problem.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pybop/plot/problem.py b/pybop/plot/problem.py index 0e21e1169..306c06da9 100644 --- a/pybop/plot/problem.py +++ b/pybop/plot/problem.py @@ -73,7 +73,9 @@ def quick(problem, problem_inputs: Inputs = None, show=True, **layout_kwargs): ) plot_dict.traces.append(target_trace) - if isinstance(problem, FittingProblem) and len(model_output) == len(target_output): + if isinstance(problem, FittingProblem) and len(model_output) == len( + target_output + ): # Compute the standard deviation as proxy for uncertainty plot_dict.sigma = np.std(model_output[i] - target_output[i]) From 28ac412c74ad019690bbeb6f54742cb42409d6a9 Mon Sep 17 00:00:00 2001 From: NicolaCourtier <45851982+NicolaCourtier@users.noreply.github.com> Date: Tue, 22 Oct 2024 17:25:42 +0100 Subject: [PATCH 3/3] Fix condition --- pybop/plot/problem.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pybop/plot/problem.py b/pybop/plot/problem.py index 306c06da9..3cc4ba020 100644 --- a/pybop/plot/problem.py +++ b/pybop/plot/problem.py @@ -73,8 +73,8 @@ def quick(problem, problem_inputs: Inputs = None, show=True, **layout_kwargs): ) plot_dict.traces.append(target_trace) - if isinstance(problem, FittingProblem) and len(model_output) == len( - target_output + if isinstance(problem, FittingProblem) and len(model_output[i]) == len( + target_output[i] ): # Compute the standard deviation as proxy for uncertainty plot_dict.sigma = np.std(model_output[i] - target_output[i])