8000 Fix big-endian buffer not supported on little-endian compiler bug (#921) · km2mishra/pvlib-python@a1e8134 · GitHub
[go: up one dir, main page]

Skip to content

Commit a1e8134

Browse files
authored
Fix big-endian buffer not supported on little-endian compiler bug (pvlib#921)
* Fix big-endian buffer not supported on little-endian compiler bug * Update forecast.py Resolve Stickler CI checks * Update forecast.py Remove trailing white space
1 parent c67c9ec commit a1e8134

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pvlib/forecast.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,11 @@ def _netcdf2pandas(self, netcdf_data, query_variables, start, end):
376376
if key not in query_variables:
377377
continue
378378
squeezed = data[:].squeeze()
379+
380+
# If the data is big endian, swap the byte order to make it
381+
# little endian
382+
if squeezed.dtype.byteorder == '>':
383+
squeezed = squeezed.byteswap().newbyteorder()
379384
if squeezed.ndim == 1:
380385
data_dict[key] = squeezed
381386
elif squeezed.ndim == 2:

0 commit comments

Comments
 (0)
0