Commit 1634a8a
Benjamin Moody
Remove obsolete and broken logic for handling 24-bit input.
Previously, the data type string for signal format 24
(DATA_LOAD_TYPES['24']) was set to '<i3', which is numpy shorthand for
"little-endian, signed integers, three bytes per element", although
numpy does not actually support such a format.
This file format was previously accommodated by special cases in
_rd_dat_file (for local files) and in _stream_dat (for remote files).
Both of these implementations were broken, in that they would silently
discard the least significant byte and return a 16-bit integer array.
The implementation for local files was further broken in that it only
worked if the input file was mmappable, if the range to be retrieved
was the entire input file, and if the file consisted of an even number
of samples.
Format 24 is now accommodated by reading the data as unsigned 8-bit
integers (DATA_LOAD_TYPES['24'] = '<u1') and reformatting the array
afterwards (in _blocks_to_samples), as was previously done for formats
212, 310, and 311. This makes the previous logic in _rd_dat_file and
_stream_dat unnecessary, so remove it.1 parent 37d5a12 commit 1634a8a
2 files changed
Lines changed: 5 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1410 | 1410 | | |
1411 | 1411 | | |
1412 | 1412 | | |
1413 | | - | |
1414 | | - | |
1415 | | - | |
1416 | | - | |
1417 | | - | |
1418 | | - | |
1419 | | - | |
1420 | | - | |
1421 | | - | |
1422 | | - | |
1423 | | - | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
1424 | 1416 | | |
1425 | 1417 | | |
1426 | | - | |
1427 | | - | |
1428 | | - | |
1429 | | - | |
1430 | | - | |
| 1418 | + | |
1431 | 1419 | | |
1432 | 1420 | | |
1433 | 1421 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
| 180 | + | |
186 | 181 | | |
187 | 182 | | |
188 | 183 | | |
| |||
0 commit comments