From 76e919c20b7c53dd5deadeedd0388bf0e4f2321d Mon Sep 17 00:00:00 2001 From: Daniel Huppmann Date: Thu, 19 Dec 2024 13:35:05 +0100 Subject: [PATCH] Apply suggestions from code review by @phackstock Co-authored-by: Philip Hackstock <20710924+phackstock@users.noreply.github.com> --- nomenclature/codelist.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nomenclature/codelist.py b/nomenclature/codelist.py index bfaa9214..0283487f 100644 --- a/nomenclature/codelist.py +++ b/nomenclature/codelist.py @@ -7,7 +7,7 @@ import pandas as pd import yaml from pyam import IamDataFrame -from pyam.utils import is_list_like, write_sheet, pattern_match, to_list +from pyam.utils import is_list_like, write_sheet, pattern_match from pydantic import BaseModel, ValidationInfo, field_validator from pydantic_core import PydanticCustomError @@ -622,7 +622,7 @@ def validate_units( (variable, unit, self.mapping[variable].unit) for variable, unit in unit_mapping.items() if variable in self.variables - and unit not in to_list(self.mapping[variable].unit) + and unit not in self.mapping[variable].units ]: lst = [ f"'{v}' - expected: {'one of ' if isinstance(e, list) else ''}"