You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the latest feature of setting URL for downloading data files, I am able to change the base URL of a database as expected. I am able to download .dat files from Physionet database as expected. But when I started using a database which we have hosted on Azure blob (files are downloadable via https), we started facing issue with the following Accept encoding setting Accept-Encoding': '*/*' which is present in dl_pb_file() and _stream_dat() in wfdb.io.download.py.
Following was the crash message
/home/achuth/wfdb-python/wfdb/io/record.py in rdrecord(record_name, sampfrom, sampto, channels, physical, pb_dir, m2s, smooth_frames, ignore_skew, return_res, force_channels, channel_names, warn_empty)
1230 record.skew, sampfrom, sampto,
1231 channels, smooth_frames,
-> 1232 ignore_skew)
1233
1234 # Arrange/edit the object fields to reflect user channel
/home/achuth/wfdb-python/wfdb/io/_signal.py in _rd_segment(file_name, dir_name, pb_dir, fmt, n_sig, sig_len, byte_offset, samps_per_frame, skew, sampfrom, sampto, channels, smooth_frames, ignore_skew)
874 w_fmt[fn], len(datchannel[fn]), sig_len, w_byte_offset[fn],
875 w_samps_per_frame[fn], w_skew[fn], sampfrom, sampto,
--> 876 smooth_frames)[:, r_w_channel[fn]]
877
878 # Return each sample in signals with multiple samples/frame, without smoothing.
/home/achuth/wfdb-python/wfdb/io/_signal.py in _rd_dat_signals(file_name, dir_name, pb_dir, fmt, n_sig, sig_len, byte_offset, samps_per_frame, skew, sampfrom, sampto, smooth_frames)
966 else:
967 sig_data = _rd_dat_file(file_name, dir_name, pb_dir, fmt, start_byte,
--> 968 n_read_samples)
969
970 # Finish processing the read data into proper samples if not already
/home/achuth/wfdb-python/wfdb/io/_signal.py in _rd_dat_file(file_name, dir_name, pb_dir, fmt, start_byte, n_samp)
1230 sig_data = download._stream_dat(file_name, pb_dir, byte_count,
1231 start_byte,
-> 1232 np.dtype(DATA_LOAD_TYPES[fmt]))
1233
1234 return sig_data
/home/achuth/wfdb-python/wfdb/io/download.py in _stream_dat(file_name, pb_dir, byte_count, start_byte, dtype)
152
153 # Raise HTTPError if invalid url
--> 154 response.raise_for_status()
155
156 # Convert to numpy array
/usr/local/lib/python3.4/dist-packages/requests/models.py in raise_for_status(self)
937
938 if http_error_msg:
--> 939 raise HTTPError(http_error_msg, response=self)
940
941 def close(self):
For testing, I changed it to Accept-Encoding': '*' at both the places. Then I was able to download .dat files from both Physionet database as well as our Azure blob database.
Is there any reason because of which you are using Accept-Encoding': '*/*' instead of Accept-Encoding': '*' ?
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
With the latest feature of setting URL for downloading data files, I am able to change the base URL of a database as expected. I am able to download .dat files from Physionet database as expected. But when I started using a database which we have hosted on Azure blob (files are downloadable via https), we started facing issue with the following Accept encoding setting
Accept-Encoding': '*/*'
which is present in dl_pb_file() and _stream_dat() in wfdb.io.download.py.Following was the crash message
For testing, I changed it to
Accept-Encoding': '*'
at both the places. Then I was able to download .dat files from both Physionet database as well as our Azure blob database.Is there any reason because of which you are using
Accept-Encoding': '*/*'
instead ofAccept-Encoding': '*'
?The text was updated successfully, but these errors were encountered: