Skip to content

Commit

Permalink
Merge pull request #51 from fact-project/fix_byteorder
Browse files Browse the repository at this point in the history
Ignore arrays with byteorder "not-applicable" in to_native_byteorder
  • Loading branch information
maxnoe authored May 9, 2017
2 parents 2314a9e + 5ba69da commit 5bb2586
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fact/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ def write_data(df, file_path, key='data', use_hp5y=False, **kwargs):
def to_native_byteorder(array):
''' Convert numpy array to native byteorder '''

if array.dtype.byteorder not in ('=', native_byteorder):
# '|' : not-applicable, '=': native
if array.dtype.byteorder not in ('|', '=', native_byteorder):
return array.byteswap().newbyteorder()

return array
Expand Down

0 comments on commit 5bb2586

Please sign in to comment.