From 6311b4a4749fa3f065384fdbf4bbc45aeed38a00 Mon Sep 17 00:00:00 2001 From: Collin Capano Date: Tue, 10 Oct 2023 11:22:58 -0400 Subject: [PATCH] Don't overwrite default numpy bindings from liglow in record.io --- pycbc/io/record.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pycbc/io/record.py b/pycbc/io/record.py index e4c3d5128c2..83725cb70d1 100644 --- a/pycbc/io/record.py +++ b/pycbc/io/record.py @@ -46,7 +46,11 @@ # ============================================================================= # # add ligolw_types to numpy sctypeDict -numpy.sctypeDict.update(ligolw_types.ToNumPyType) +# but don't including float -> float32 and int -> int32 bindings, so as not +# to change numpy defaults +numpy.sctypeDict.update({_k: _val + for (_k, _val) in ligolw_types.ToNumPyType.items() + if _k != 'float' and _k != 'int'}) # Annoyingly, numpy has no way to store NaNs in an integer field to indicate # the equivalent of None. This can be problematic for fields that store ids: