def test_cm6(self): from pyrocko import ims_ext for values in [ num.random.randint(-2**31, 2**31-1, 10000).astype(num.int32), num.random.randint(-2**31, 2**31-1, 10000).astype(num.int32)[::2], filled_int32(10, 0), filled_int32(10, 2**31), filled_int32(10, 2**31-1), num.zeros(0, dtype=num.int32)]: s = ims_ext.encode_cm6(values) values2 = ims_ext.decode_cm6(s,0) assert values.size == values2.size assert num.all(values == values2)
def test_cm6(self): from pyrocko import ims_ext for values in [ num.random.randint(-2**31, 2**31 - 1, 10000).astype(num.int32), num.random.randint(-2**31, 2**31 - 1, 10000).astype(num.int32)[::2], filled_int32(10, 0), filled_int32(10, 2**31), filled_int32(10, 2**31 - 1), num.zeros(0, dtype=num.int32) ]: s = ims_ext.encode_cm6(values) values2 = ims_ext.decode_cm6(s, 0) assert values.size == values2.size assert num.all(values == values2)