From 986d6a5973f829b56bd169e39cc147299d43e6db Mon Sep 17 00:00:00 2001 From: Vitesh Shah Date: Mon, 27 Nov 2023 15:34:02 +0100 Subject: [PATCH] compare the bytes types better --- python/tests/test_Result.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/python/tests/test_Result.py b/python/tests/test_Result.py index e81955cbe..16127e20b 100644 --- a/python/tests/test_Result.py +++ b/python/tests/test_Result.py @@ -485,8 +485,6 @@ class TestResult: if not np.array_equal(ref_val,actual_val): error_messages.append("Common attributes in datasets of CellData do not match") - # TODO: check for the array of PhaseTypes too. However, currently phase is assumed Primary by default. - # check crystal structure array results_crystal_structure = np.array(results_file[ensemble_label + '/CrystalStructures']) ref_crystal_structure = np.array(ref_file[ensemble_label + '/CrystalStructures']) @@ -497,7 +495,8 @@ class TestResult: results_phase_name = np.array(results_file[ensemble_label + '/PhaseName']) ref_phase_name = ['Unknown Phase Type'] ref_phase_name.extend(i for i in result.visible['phases']) - if not results_phase_name == np.array(ref_phase_name,dtype=bytes): + ref_phase_name = [bytes(i,encoding='utf-8') for i in ref_phase_name] + if not np.all(results_phase_name == np.array(ref_phase_name,dtype=object)): error_messages.append('Phase names are different') # check attributes ensemble matrix