Skip to content

Commit

Permalink
Don't overwrite default numpy bindings from liglow in record.io (gwas…
Browse files Browse the repository at this point in the history
…tro#4525)

* Don't overwrite default numpy bindings from liglow in record.io

* Change to not include any bindings that numpy already defines
  • Loading branch information
Collin Capano authored and lpathak97 committed Mar 13, 2024
1 parent babb065 commit 0ea27e8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pycbc/io/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@
# =============================================================================
#
# add ligolw_types to numpy sctypeDict
numpy.sctypeDict.update(ligolw_types.ToNumPyType)
# but don't include bindings that numpy already defines
numpy.sctypeDict.update({_k: _val
for (_k, _val) in ligolw_types.ToNumPyType.items()
if _k not in numpy.sctypeDict})

# 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:
Expand Down

0 comments on commit 0ea27e8

Please sign in to comment.