Skip to content

Commit 736e2e2

Browse files
committed
BTUNE_BALANCE -> BTUNE_TRADEOFF
1 parent 1f29b08 commit 736e2e2

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

blosc2/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -684,9 +684,9 @@ def unpack_tensor(cframe):
684684
>>> import numpy as np
685685
>>> th = np.arange(1e3, dtype=np.float32)
686686
>>> cframe = blosc2.pack_tensor(th)
687-
>>> if not os.getenv("BTUNE_BALANCE"):
687+
>>> if not os.getenv("BTUNE_TRADEOFF"):
688688
... assert len(cframe) < th.size * th.itemsize
689-
...
689+
...
690690
>>> th2 = blosc2.unpack_tensor(cframe)
691691
>>> a = np.asarray(th)
692692
>>> a2 = np.asarray(th2)

tests/test_schunk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def test_schunk_cframe(contiguous, urlpath, cparams, dparams, nchunks, copy):
139139

140140
cframe = schunk.to_cframe()
141141
schunk2 = blosc2.schunk_from_cframe(cframe, copy)
142-
if not os.getenv("BTUNE_BALANCE"):
142+
if not os.getenv("BTUNE_TRADEOFF"):
143143
for key in cparams:
144144
if key == "nthreads":
145145
continue

tests/test_tensor.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
def test_pack_array(size, dtype):
2929
nparray = np.arange(size, dtype=dtype)
3030
parray = blosc2.pack_array(nparray)
31-
if not os.getenv("BTUNE_BALANCE"):
31+
if not os.getenv("BTUNE_TRADEOFF"):
3232
assert len(parray) < nparray.size * nparray.itemsize
3333

3434
a2 = blosc2.unpack_array(parray)
@@ -48,7 +48,7 @@ def test_pack_array(size, dtype):
4848
def test_pack_array2(size, dtype):
4949
nparray = np.arange(size, dtype=dtype)
5050
parray = blosc2.pack_array2(nparray)
51-
if not os.getenv("BTUNE_BALANCE"):
51+
if not os.getenv("BTUNE_TRADEOFF"):
5252
assert len(parray) < nparray.size * nparray.itemsize
5353

5454
a2 = blosc2.unpack_array2(parray)
@@ -59,7 +59,7 @@ def test_pack_array2(size, dtype):
5959
def test_pack_array2_struct(size, dtype):
6060
nparray = np.fromiter(iter(range(size)), dtype="i4,f4,S8")
6161
parray = blosc2.pack_array2(nparray)
62-
if not os.getenv("BTUNE_BALANCE"):
62+
if not os.getenv("BTUNE_TRADEOFF"):
6363
assert len(parray) < nparray.size * nparray.itemsize
6464

6565
a2 = blosc2.unpack_array2(parray)
@@ -80,7 +80,7 @@ def test_pack_tensor_torch(size, dtype):
8080
tensor = torch.arange(size, dtype=dtype)
8181
cframe = blosc2.pack_tensor(tensor)
8282
atensor = np.asarray(tensor)
83-
if not os.getenv("BTUNE_BALANCE"):
83+
if not os.getenv("BTUNE_TRADEOFF"):
8484
assert len(cframe) < atensor.size * atensor.dtype.itemsize
8585

8686
tensor2 = blosc2.unpack_tensor(cframe)
@@ -101,7 +101,7 @@ def test_pack_tensor_tensorflow(size, dtype):
101101
tensor = tensorflow.constant(array)
102102
cframe = blosc2.pack_tensor(tensor)
103103
atensor = np.asarray(tensor)
104-
if not os.getenv("BTUNE_BALANCE"):
104+
if not os.getenv("BTUNE_TRADEOFF"):
105105
assert len(cframe) < atensor.size * atensor.dtype.itemsize
106106

107107
tensor2 = blosc2.unpack_tensor(cframe)
@@ -121,7 +121,7 @@ def test_pack_tensor_tensorflow(size, dtype):
121121
def test_pack_tensor_array(size, dtype):
122122
nparray = np.arange(size, dtype=dtype)
123123
parray = blosc2.pack_tensor(nparray)
124-
if not os.getenv("BTUNE_BALANCE"):
124+
if not os.getenv("BTUNE_TRADEOFF"):
125125
assert len(parray) < nparray.size * nparray.itemsize
126126

127127
a2 = blosc2.unpack_tensor(parray)
@@ -141,7 +141,7 @@ def test_pack_tensor_array(size, dtype):
141141
def test_save_array(size, dtype, urlpath):
142142
nparray = np.arange(size, dtype=dtype)
143143
serial_size = blosc2.save_array(nparray, urlpath, mode="w")
144-
if not os.getenv("BTUNE_BALANCE"):
144+
if not os.getenv("BTUNE_TRADEOFF"):
145145
assert serial_size < nparray.size * nparray.itemsize
146146

147147
a2 = blosc2.load_array(urlpath)
@@ -159,7 +159,7 @@ def test_save_array(size, dtype, urlpath):
159159
def test_save_tensor_array(size, dtype, urlpath):
160160
nparray = np.arange(size, dtype=dtype)
161161
serial_size = blosc2.save_tensor(nparray, urlpath, mode="w")
162-
if not os.getenv("BTUNE_BALANCE"):
162+
if not os.getenv("BTUNE_TRADEOFF"):
163163
assert serial_size < nparray.size * nparray.itemsize
164164

165165
a2 = blosc2.load_tensor(urlpath)
@@ -179,7 +179,7 @@ def test_save_tensor_tensorflow(size, dtype, urlpath):
179179
nparray = np.arange(size, dtype=dtype)
180180
tensor = tensorflow.constant(nparray)
181181
serial_size = blosc2.save_tensor(tensor, urlpath, mode="w")
182-
if not os.getenv("BTUNE_BALANCE"):
182+
if not os.getenv("BTUNE_TRADEOFF"):
183183
assert serial_size < nparray.size * nparray.itemsize
184184

185185
tensor2 = blosc2.load_tensor(urlpath)
@@ -199,7 +199,7 @@ def test_save_tensor_torch(size, dtype, urlpath):
199199
nparray = np.arange(size, dtype=dtype)
200200
tensor = torch.tensor(nparray)
201201
serial_size = blosc2.save_tensor(tensor, urlpath, mode="w")
202-
if not os.getenv("BTUNE_BALANCE"):
202+
if not os.getenv("BTUNE_TRADEOFF"):
203203
assert serial_size < nparray.size * nparray.itemsize
204204

205205
tensor2 = blosc2.load_tensor(urlpath)
@@ -217,7 +217,7 @@ def test_save_tensor_torch(size, dtype, urlpath):
217217
def test_save_tensor_sparse(size, sparse, urlpath):
218218
nparray = np.arange(size, dtype=np.int32)
219219
serial_size = blosc2.save_tensor(nparray, urlpath, mode="w", contiguous=not sparse)
220-
if not os.getenv("BTUNE_BALANCE"):
220+
if not os.getenv("BTUNE_TRADEOFF"):
221221
assert serial_size < nparray.size * nparray.itemsize
222222

223223
a2 = blosc2.load_tensor(urlpath)

0 commit comments

Comments
 (0)