Beispiel #1
0
def test_spread_and_compact_bits():
    from yt.utilities.lib.geometry_utils import spread_bits, compact_bits
    li = [np.uint64(0b111111111111111111111)]
    for ans in li:
        mi = spread_bits(ans)
        out = compact_bits(mi)
        assert_equal(out, ans)
Beispiel #2
0
def test_compact_bits():
    from yt.utilities.lib.geometry_utils import compact_bits
    li = [
        (np.uint64(0b111111111111111111111),
         np.uint64(
             0b1001001001001001001001001001001001001001001001001001001001001))
    ]
    for ans, i in li:
        out = compact_bits(i)
        assert_equal(out, ans)