From fb66e7d2e9dcfe57f12fafb49b4d2e02d00eb4f9 Mon Sep 17 00:00:00 2001 From: ayushjariyal Date: Fri, 14 Feb 2025 18:42:38 +0530 Subject: [PATCH] updating code to pass all checks --- src/aiida/orm/nodes/data/array/xy.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/aiida/orm/nodes/data/array/xy.py b/src/aiida/orm/nodes/data/array/xy.py index e13cabd0e8..43c4a1dd47 100644 --- a/src/aiida/orm/nodes/data/array/xy.py +++ b/src/aiida/orm/nodes/data/array/xy.py @@ -186,6 +186,8 @@ def get_y(self) -> list[tuple[str, 'ndarray', str]]: def get_y_arraynames(self) -> list[str]: """Returns the user-provided names of the y-arrays.""" - y_names = getattr(self.base.attributes, 'y_names', None) - if y_names is None: + try: + y_names = self.base.attributes.get('y_names') + except (KeyError, AttributeError): raise NotExistent('No y names have been set yet!') + return y_names \ No newline at end of file