Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gzip compression (#126) #152

Merged
merged 1 commit into from Oct 16, 2018
Merged

Fix gzip compression (#126) #152

merged 1 commit into from Oct 16, 2018

Conversation

regeirk
Copy link
Contributor

@regeirk regeirk commented Nov 16, 2017

I had o problem loading data from the Global Forecast System (GFS). It raised a UnicodeDecodeError exception, which after a while I figured out it happens because the data is gzipped. I came up with a solution modifying the GET function in the net module, adding response.decode_content().

@MiCurry
Copy link

@MiCurry MiCurry commented Jan 4, 2018

+1ing this one. Had trouble accessing a GrADS server (http://nomads.ncep.noaa.gov:9090/dods/rtofs/). This fixed work, thanks @regeirk.

@ForTozs
Copy link

@ForTozs ForTozs commented Feb 13, 2018

I tried these changes and it stopped the UnicodeDecodeError for me as well. I should note, that the behavior is slightly changed. Before I could call a datasource with:

>>> latitudes = meta['rows'][:]
>>> latitudes
array([44.88375, 44.87625, 44.86875, ..., -0.09375, -0.10125, -0.10875])

This would result in latitudes being an array datatype. Now, the datatype has changed to BaseType with data array. If I want the data array, now it is necessary to call latitudes as:

>>> latitudes = meta['rows'][:]
>>> latitudes
<BaseType with data array([44.88375, 44.87625, 44.86875, ..., -0.09375, -0.10125, -0.10875])>
>>> latitudes.data
array([44.88375, 44.87625, 44.86875, ..., -0.09375, -0.10125, -0.10875])

Sorry if this is convoluted or off-topic. Just thought I'd share how it changed the behavior of my code in case anyone else comes across this. It may be that this happened during the update and is unrelated to this previous bug.

@ocefpaf
Copy link
Contributor

@ocefpaf ocefpaf commented Oct 16, 2018

@tomkralidis it would be nice if this one got merged and issue a new release.

PS: the issue #126 was closed but this was never merged :-/

@tomkralidis tomkralidis reopened this Oct 16, 2018
@tomkralidis tomkralidis merged commit 5a14671 into pydap:master Oct 16, 2018
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants