Skip to content

Commit ba56f46

Browse files
authored
Merge pull request #590 from FAIRmat-NFDI/add_bool_to_nxcharornumber
add bool to NX_CHAR_OR_NUMBER
2 parents 6ae322e + 105cd0d commit ba56f46

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/pynxtools/dataconverter/helpers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,11 +600,12 @@ def is_value_valid_element_of_enum(value, elist) -> Tuple[bool, list]:
600600
nx_int = (int, np.integer)
601601
nx_float = (float, np.floating)
602602
nx_number = nx_int + nx_float
603+
nx_bool = (bool, np.bool_)
603604

604605
NEXUS_TO_PYTHON_DATA_TYPES = {
605606
"ISO8601": (str,),
606607
"NX_BINARY": (bytes, bytearray, np.bytes_),
607-
"NX_BOOLEAN": (bool, np.bool_),
608+
"NX_BOOLEAN": nx_bool,
608609
"NX_CHAR": nx_char,
609610
"NX_DATE_TIME": (str,),
610611
"NX_FLOAT": nx_float,
@@ -616,7 +617,7 @@ def is_value_valid_element_of_enum(value, elist) -> Tuple[bool, list]:
616617
complex,
617618
np.complexfloating,
618619
),
619-
"NX_CHAR_OR_NUMBER": nx_char + nx_number,
620+
"NX_CHAR_OR_NUMBER": nx_char + nx_number + nx_bool,
620621
"NXDL_TYPE_UNAVAILABLE": (
621622
nx_char,
622623
), # Defaults to a string if a type is not provided.

0 commit comments

Comments
 (0)