Skip to content

Commit

Permalink
fix string issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnitz committed Sep 4, 2024
1 parent 82ee2b6 commit fc135de
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions bin/all_sky_search/pycbc_coinc_statmap
Original file line number Diff line number Diff line change
Expand Up @@ -508,9 +508,9 @@ f.attrs['hierarchical_removal_iterations'] = h_iterations

# Write whether hierarchical removals were removed against the
# inclusive background or the exclusive background. Have to use
# numpy.string_ datatype.
# numpy.bytes_ datatype.
if h_iterations != 0:
hrm_method = args.hierarchical_removal_against
f.attrs['hierarchical_removal_method'] = numpy.string_(hrm_method)
f.attrs['hierarchical_removal_method'] = numpy.bytes_(hrm_method)

logging.info("Done")
4 changes: 2 additions & 2 deletions bin/all_sky_search/pycbc_sngls_statmap
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,10 @@ f.attrs['hierarchical_removal_iterations'] = h_iterations

# Write whether hierarchical removals were removed against the
# inclusive background or the exclusive background. Have to use
# numpy.string_ datatype.
# numpy.bytes_ datatype.
if h_iterations != 0:
hrm_method = args.hierarchical_removal_against
f.attrs['hierarchical_removal_method'] = numpy.string_(hrm_method)
f.attrs['hierarchical_removal_method'] = numpy.bytes_(hrm_method)

logging.info("Done")

2 changes: 1 addition & 1 deletion pycbc/io/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,7 @@ def _isstring(dtype):
"""Given a numpy dtype, determines whether it is a string. Returns True
if the dtype is string or unicode.
"""
return dtype.type == numpy.unicode_ or dtype.type == numpy.string_
return dtype.type == numpy.unicode_ or dtype.type == numpy.bytes_


def aliases_from_fields(fields):
Expand Down

0 comments on commit fc135de

Please sign in to comment.