From 230852c0a314407f07be8146274efc70167ab866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hampus=20N=C3=A4sstr=C3=B6m?= Date: Thu, 14 Nov 2024 10:48:16 +0100 Subject: [PATCH] Changed repeats to not is_scalar in merge_sections (#136) Updated `merge_sections` util function to work with the latest nomad-lab version --- src/nomad_measurements/utils.py | 2 +- tests/{test_utils.py => test_first_utils.py} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename tests/{test_utils.py => test_first_utils.py} (100%) diff --git a/src/nomad_measurements/utils.py b/src/nomad_measurements/utils.py index ec60a06d..dd0be820 100644 --- a/src/nomad_measurements/utils.py +++ b/src/nomad_measurements/utils.py @@ -90,7 +90,7 @@ def merge_sections( # noqa: PLR0912 elif ( quantity.is_scalar and section.m_get(quantity) != update.m_get(quantity) - or quantity.repeats + or not quantity.is_scalar and (section.m_get(quantity) != update.m_get(quantity)).any() ): warning = f'Merging sections with different values for quantity "{name}".' diff --git a/tests/test_utils.py b/tests/test_first_utils.py similarity index 100% rename from tests/test_utils.py rename to tests/test_first_utils.py