Skip to content

Commit

Permalink
EXPERIMENTAL: do not coerce bytes to str in FitsReader.read_struct.
Browse files Browse the repository at this point in the history
I think it'd be cleaner for the FITS writer and reader to round-trip
`str` without the Piff object implementations having to do any
coercion, but let's see if it works anyway.
  • Loading branch information
TallJimbo committed Jul 26, 2024
1 parent 24f3333 commit 2397430
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions piff/readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@ def read_struct(self, name):
data = self._fits[extname].read()
assert len(data) == 1
struct = dict([ (col, data[col][0]) for col in cols ])
for k, v in struct.items():
# We assume all bytes are supposed to be strs in read_struct, but
# not in read_table.
if isinstance(v, bytes):
struct[k] = v.decode()
return struct

def read_table(self, name, metadata=None):
Expand Down

0 comments on commit 2397430

Please sign in to comment.