Exemplo n.º 1
0
def test_err_encode_object_buffer():
    check_err_encode_object_buffer(GZip())
Exemplo n.º 2
0
def test_config():
    codec = GZip(level=3)
    check_config(codec)
Exemplo n.º 3
0
def test_eq():
    assert GZip() == GZip()
    assert not GZip() != GZip()
    assert GZip(1) == GZip(1)
    assert GZip(1) != GZip(9)
    assert GZip() != 'foo'
    assert 'foo' != GZip()
    assert not GZip() == 'foo'
Exemplo n.º 4
0
import itertools


import numpy as np
import pytest


from numcodecs.gzip import GZip
from numcodecs.tests.common import (check_encode_decode, check_config, check_repr,
                                    check_backwards_compatibility,
                                    check_err_decode_object_buffer,
                                    check_err_encode_object_buffer)


codecs = [
    GZip(),
    GZip(level=-1),
    GZip(level=0),
    GZip(level=1),
    GZip(level=5),
    GZip(level=9),
]


# mix of dtypes: integer, float, bool, string
# mix of shapes: 1D, 2D, 3D
# mix of orders: C, F
arrays = [
    np.arange(1000, dtype='i4'),
    np.linspace(1000, 1001, 1000, dtype='f8'),
    np.random.normal(loc=1000, scale=1, size=(100, 10)),