Skip to content

Commit 91b4fef

Browse files
committed
Do not coerce bytes to str in FitsReader.read_struct.
This appears to be unnecessary; fitsio is already taking care that at least the kinds of strings we're using already round-trip.
1 parent 24f3333 commit 91b4fef

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

piff/readers.py

+1-8
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
import fitsio
2222
import galsim
23-
import numpy as np
2423

2524

2625
class FitsReader:
@@ -63,13 +62,7 @@ def read_struct(self, name):
6362
cols = self._fits[extname].get_colnames()
6463
data = self._fits[extname].read()
6564
assert len(data) == 1
66-
struct = dict([ (col, data[col][0]) for col in cols ])
67-
for k, v in struct.items():
68-
# We assume all bytes are supposed to be strs in read_struct, but
69-
# not in read_table.
70-
if isinstance(v, bytes):
71-
struct[k] = v.decode()
72-
return struct
65+
return dict([ (col, data[col][0]) for col in cols ])
7366

7467
def read_table(self, name, metadata=None):
7568
"""Load a table as a numpy array.

0 commit comments

Comments
 (0)