Skip to content

Commit

Permalink
yet another change to appease plotoptions
Browse files Browse the repository at this point in the history
  • Loading branch information
scarlehoff committed Dec 4, 2024
1 parent 67ca8d4 commit fa3f92b
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions validphys2/src/validphys/commondataparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit fa3f92b

Please sign in to comment.