Exemple #1
0
def test_backwards_compatibility():
    check_backwards_compatibility(default_codec.codec_id, arrays,
                                  [default_codec])
    with warnings.catch_warnings():
        warnings.simplefilter('ignore', PendingDeprecationWarning)
        check_backwards_compatibility(legacy_codec.codec_id, legacy_arrays,
                                      [legacy_codec])
Exemple #2
0
def test_backwards_compatibility():
    codec = Categorize(labels=labels, dtype='<U4', astype='u1')
    check_backwards_compatibility(Categorize.codec_id,
                                  arrays, [codec],
                                  prefix='U')
    codec = Categorize(labels=labels, dtype=object, astype='u1')
    check_backwards_compatibility(Categorize.codec_id,
                                  arrays_object, [codec],
                                  prefix='O')
Exemple #3
0
def test_backwards_compatibility():
    for i, code in enumerate(codecs):
        if code.mode == _zfpy.mode_fixed_rate:
            codec = [code]
            check_backwards_compatibility(ZFPY.codec_id, arrays, codec)
        else:
            check_backwards_compatibility(
                ZFPY.codec_id, arrays[: len(arrays) - 2], codecs
            )
Exemple #4
0
def test_backwards_compatibility():

    # integers
    arrs = [
        np.arange(1000, dtype='<i4'),
        np.random.randint(0, 200, size=1000,
                          dtype='i4').astype('<i4').reshape(100, 10,
                                                            order='F'),
    ]
    codec = AsType(encode_dtype='<i2', decode_dtype='<i4')
    check_backwards_compatibility(AsType.codec_id, arrs, [codec], prefix='i')

    # floats
    arrs = [
        np.linspace(1000, 1001, 1000, dtype='<f8').reshape(100, 10, order='F'),
        np.random.normal(loc=1000, scale=1, size=(10, 10, 10)).astype('<f8'),
    ]
    codec = AsType(encode_dtype='<f4', decode_dtype='<f8')
    check_backwards_compatibility(AsType.codec_id,
                                  arrs, [codec],
                                  precision=[3],
                                  prefix='f')
Exemple #5
0
def test_backwards_compatibility():
    codec = Categorize(labels=labels, dtype=arrays[0].dtype, astype='u1')
    check_backwards_compatibility(Categorize.codec_id,
                                  arrays, [codec],
                                  prefix='s')
    codec = Categorize(labels=labels_u, dtype=arrays_u[0].dtype, astype='u1')
    check_backwards_compatibility(Categorize.codec_id,
                                  arrays_u, [codec],
                                  prefix='u')
    codec = Categorize(labels=labels_num,
                       dtype=arrays_num[0].dtype,
                       astype='u1')
    check_backwards_compatibility(Categorize.codec_id,
                                  arrays_num, [codec],
                                  prefix='n')
Exemple #6
0
def test_backwards_compatibility():
    precision = [codec.digits for codec in codecs]
    check_backwards_compatibility(Quantize.codec_id,
                                  arrays,
                                  codecs,
                                  precision=precision)
Exemple #7
0
def test_backwards_compatibility():
    check_backwards_compatibility(Zstd.codec_id, arrays, codecs)
Exemple #8
0
def test_backwards_compatibility():
    precision = [int(np.log10(codec.scale)) for codec in codecs]
    check_backwards_compatibility(FixedScaleOffset.codec_id,
                                  arrays,
                                  codecs,
                                  precision=precision)
Exemple #9
0
def test_backwards_compatibility():
    for codec in codecs:
        check_backwards_compatibility(codec.codec_id, arrays, [codec])
Exemple #10
0
def test_backwards_compatibility():
    check_backwards_compatibility(VLenUTF8.codec_id, arrays, [VLenUTF8()])
Exemple #11
0
def test_backwards_compatibility():
    check_backwards_compatibility(PackBits.codec_id, arrays, [PackBits()])
Exemple #12
0
def test_backwards_compatibility():
    codec = MsgPack()
    check_backwards_compatibility(codec.codec_id, arrays, [codec])
Exemple #13
0
def test_backwards_compatibility():
    check_backwards_compatibility(VLenArray.codec_id, arrays, codecs)
Exemple #14
0
def test_backwards_compatibility():
    check_backwards_compatibility(MsgPack.codec_id, arrays, [MsgPack()])
Exemple #15
0
def test_backwards_compatibility():
    check_backwards_compatibility(CRC32.codec_id, arrays, [CRC32()])
    check_backwards_compatibility(Adler32.codec_id, arrays, [Adler32()])
Exemple #16
0
def test_backwards_compatibility():
    for arr in arrays:
        codec = Delta(dtype=arr.dtype)
        check_backwards_compatibility(Delta.codec_id, [arr], [codec], prefix=str(arr.dtype))
Exemple #17
0
def test_backwards_compatibility():
    check_backwards_compatibility(VLenBytes.codec_id, arrays, [VLenBytes()])
Exemple #18
0
def test_backwards_compatibility():
    check_backwards_compatibility(LegacyJSON.codec_id, arrays, legacy_json_codecs)
    check_backwards_compatibility(JSON.codec_id, arrays, json_codecs)