/ concept-collection / ephys_compression_tests
concept-collection / ephys_compression_tests
fix lossy order
Jeremy Magland <jmagland@flatironinstitute.org> committed commit bad39f265bc5 parent ef845fa Browse files
1 changed file+2−2
python/ephys_compression_tests/algorithms/ans/__init__.pymodified+2−2View file
@@ -264,9 +264,9 @@ for ar_order in [2, 8]:
264264 coeffs_bytes = coeffs.astype(np.float32).tobytes()
265265 initial_values_bytes = initial_values.astype(np.int16).tobytes()
266266 return coeffs_bytes + initial_values_bytes + encoded_residuals
267- def decode0_ar_lossy(x: bytes, dtype: str, shape: tuple) -> np.ndarray:
267+ def decode0_ar_lossy(x: bytes, dtype: str, shape: tuple, order=ar_order) -> np.ndarray:
268268 dtype_np = np.dtype(dtype)
269- num_bytes_coeffs = 2 * np.dtype(np.float32).itemsize
269+ num_bytes_coeffs = order * np.dtype(np.float32).itemsize
270270 coeffs_bytes = x[:num_bytes_coeffs]
271271 coeffs = np.frombuffer(coeffs_bytes, dtype=np.float32)
272272 num_initial_values = len(coeffs)