From 297e9eb9be5622b74ac2e066564fc8f3436378d0 Mon Sep 17 00:00:00 2001 From: Max Grover Date: Thu, 4 Jan 2024 10:25:25 -0600 Subject: [PATCH] ENH: Speed up IO for nexrad level2 file (#1504) --- pyart/io/nexrad_level2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyart/io/nexrad_level2.py b/pyart/io/nexrad_level2.py index 29469d6cff..38a3e88530 100644 --- a/pyart/io/nexrad_level2.py +++ b/pyart/io/nexrad_level2.py @@ -592,7 +592,7 @@ def _decompress_records(file_handler): cbuf = file_handler.read() # read all data from the file decompressor = bz2.BZ2Decompressor() skip = _structure_size(VOLUME_HEADER) + CONTROL_WORD_SIZE - buf = decompressor.decompress(cbuf[skip:]) + buf = bytearray(decompressor.decompress(cbuf[skip:])) while len(decompressor.unused_data): cbuf = decompressor.unused_data decompressor = bz2.BZ2Decompressor()