From fa3f92b912853b9cc608cfc3f81673ab805d2ceb Mon Sep 17 00:00:00 2001 From: juacrumar Date: Wed, 4 Dec 2024 07:49:36 +0100 Subject: [PATCH] yet another change to appease plotoptions --- validphys2/src/validphys/commondataparser.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/validphys2/src/validphys/commondataparser.py b/validphys2/src/validphys/commondataparser.py index cfb146690f..7e4875d997 100644 --- a/validphys2/src/validphys/commondataparser.py +++ b/validphys2/src/validphys/commondataparser.py @@ -37,7 +37,7 @@ """ import dataclasses -from functools import cached_property, cache +from functools import cache, cached_property import logging from operator import attrgetter from pathlib import Path @@ -652,10 +652,6 @@ def is_ported_dataset(self): if self.ported_from is None: return False - # If it is using a legacy variant and has a ported_from field, then it is a ported one - if self.applied_variant is not None and self.applied_variant.startswith("legacy"): - return True - # If not using a legacy variant, we consider it ported if the kin variables are still k1,k2,k3 return {"k1", "k2", "k3"} == set(self.kinematic_coverage) @@ -740,6 +736,18 @@ def _plotting_options_set(self): new_line_by.append(self.digest_plotting_variable(var)) self.plotting.line_by = new_line_by + # And do it also within the normalize dictionary + if self.plotting.normalize is not None: + # Copy the normalize dictionary and update the figure and line by + tmp = dict(self.plotting.normalize) + tmp["figure_by"] = [] + tmp["line_by"] = [] + for var in self.plotting.normalize.get("figure_by", []): + tmp["figure_by"].append(self.digest_plotting_variable(var)) + for var in self.plotting.normalize.get("line_by", []): + tmp["line_by"].append(self.digest_plotting_variable(var)) + self.plotting.normalize = tmp + self.plotting.already_digested = True return self.plotting