|
1 | 1 | import binascii |
2 | 2 | import hashlib |
| 3 | +from inspect import stack |
3 | 4 | import itertools |
4 | 5 | import math |
5 | 6 | import operator |
6 | 7 | import re |
7 | | -from functools import reduce |
| 8 | +from functools import partial, reduce |
8 | 9 | from typing import Any |
| 10 | +import warnings |
9 | 11 |
|
10 | 12 | import numpy as np |
11 | 13 | from numcodecs.compat import ensure_bytes |
@@ -90,13 +92,6 @@ class Array: |
90 | 92 | If True (default), user attributes will be cached for attribute read |
91 | 93 | operations. If False, user attributes are reloaded from the store prior |
92 | 94 | to all attribute read operations. |
93 | | - partial_decompress : bool, optional |
94 | | - If True and while the chunk_store is a FSStore and the compression used |
95 | | - is Blosc, when getting data from the array chunks will be partially |
96 | | - read and decompressed when possible. |
97 | | -
|
98 | | - .. versionadded:: 2.7 |
99 | | -
|
100 | 95 | write_empty_chunks : bool, optional |
101 | 96 | If True, all chunks will be stored regardless of their contents. If |
102 | 97 | False (default), each chunk is compared to the array's fill value prior |
@@ -124,7 +119,7 @@ def __init__( |
124 | 119 | synchronizer=None, |
125 | 120 | cache_metadata=True, |
126 | 121 | cache_attrs=True, |
127 | | - partial_decompress=False, |
| 122 | + partial_decompress=None, |
128 | 123 | write_empty_chunks=True, |
129 | 124 | zarr_version=None, |
130 | 125 | meta_array=None, |
@@ -154,6 +149,13 @@ def __init__( |
154 | 149 | self._synchronizer = synchronizer |
155 | 150 | self._cache_metadata = cache_metadata |
156 | 151 | self._is_view = False |
| 152 | + if partial_decompress is not None: |
| 153 | + warnings.warn( |
| 154 | + "Support for partial decompression is no longer supported in numcodecs. " |
| 155 | + "Support for partial decompression will be removed in a future version of zarr-python v2.", |
| 156 | + DeprecationWarning, |
| 157 | + stacklevel=1, |
| 158 | + ) |
157 | 159 | self._partial_decompress = partial_decompress |
158 | 160 | self._write_empty_chunks = write_empty_chunks |
159 | 161 | if meta_array is not None: |
|
0 commit comments