How to use the typesystem.numpyschema.toNumpySchema function in typesystem

To help you get started, we’ve selected a few typesystem examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github scikit-hep / scikit-hep / experiments / test_typesystem.py View on Github external
print(unsupported(toNumpySchema(Union(String("bytes", None)))))
print(unsupported(toNumpySchema(Record(table=Collection(Number(True, True, 8), True, None), pointer=Reference("table"))))) 
print(unsupported(toNumpySchema(Record(table=Tensor(Number(True, True, 8), 4, 4), pointer=Reference("table", 2))))) 

assert not toNumpySchema(Anything()).supported()
assert not toNumpySchema(Nothing()).supported()
assert not toNumpySchema(Null()).supported()
assert toNumpySchema(Boolean()).supported()
assert toNumpySchema(Number(True, True, 8)).supported()
assert toNumpySchema(Number(False, True, 8)).supported()
assert not toNumpySchema(Number(False, False, 8)).supported()
assert toNumpySchema(Number(True, True, 1)).supported()
assert not toNumpySchema(Number(False, True, 1)).supported()
assert toNumpySchema(String("bytes", None)).supported()
assert not toNumpySchema(String("utf-8", None)).supported()
assert toNumpySchema(String("utf-32le", None)).supported()
assert toNumpySchema(Tensor(Number(True, True, 8), 1, 2, 3)).supported()
assert toNumpySchema(Collection(Number(True, True, 8), False, None)).supported()
assert not toNumpySchema(Mapping(String("bytes", None), Number(True, True, 8))).supported()
assert toNumpySchema(Record(one=Boolean(), two=Number(True, True, 8), three=String("bytes", None))).supported()
assert not toNumpySchema(Union(Boolean(), Number(True, True, 8), String("bytes", None))).supported()
assert toNumpySchema(Union(Null(), Number(True, True, 8))).supported()
assert toNumpySchema(Union(String("bytes", None))).supported()
assert not toNumpySchema(Record(table=Collection(Number(True, True, 8), True, None), pointer=Reference("table"))).supported()
assert not toNumpySchema(Record(table=Tensor(Number(True, True, 8), 4, 4), pointer=Reference("table", 2))).supported()

def randomtype(depth):
    if depth == 0:
        cls = random.choice([Anything, Nothing, Null, Boolean, Number, String])
    else:
        cls = random.choice([Tensor, Collection, Mapping, Record, Union])
github scikit-hep / scikit-hep / experiments / test_typesystem.py View on Github external
print(unsupported(toNumpySchema(Number(False, True, 8))))
print(unsupported(toNumpySchema(Number(False, False, 8))))
print(unsupported(toNumpySchema(Number(True, True, 1))))
print(unsupported(toNumpySchema(Number(False, True, 1))))
print(unsupported(toNumpySchema(String("bytes", None))))
print(unsupported(toNumpySchema(String("utf-8", None))))
print(unsupported(toNumpySchema(String("utf-32le", None))))
print(unsupported(toNumpySchema(Tensor(Number(True, True, 8), 1, 2, 3))))
print(unsupported(toNumpySchema(Collection(Number(True, True, 8), False, None))))
print(unsupported(toNumpySchema(Mapping(String("bytes", None), Number(True, True, 8)))))
print(unsupported(toNumpySchema(Record(one=Boolean(), two=Number(True, True, 8), three=String("bytes", None)))))
print(unsupported(toNumpySchema(Union(Boolean(), Number(True, True, 8), String("bytes", None)))))
print(unsupported(toNumpySchema(Union(Null(), Number(True, True, 8)))))
print(unsupported(toNumpySchema(Union(String("bytes", None)))))
print(unsupported(toNumpySchema(Record(table=Collection(Number(True, True, 8), True, None), pointer=Reference("table"))))) 
print(unsupported(toNumpySchema(Record(table=Tensor(Number(True, True, 8), 4, 4), pointer=Reference("table", 2))))) 

assert not toNumpySchema(Anything()).supported()
assert not toNumpySchema(Nothing()).supported()
assert not toNumpySchema(Null()).supported()
assert toNumpySchema(Boolean()).supported()
assert toNumpySchema(Number(True, True, 8)).supported()
assert toNumpySchema(Number(False, True, 8)).supported()
assert not toNumpySchema(Number(False, False, 8)).supported()
assert toNumpySchema(Number(True, True, 1)).supported()
assert not toNumpySchema(Number(False, True, 1)).supported()
assert toNumpySchema(String("bytes", None)).supported()
assert not toNumpySchema(String("utf-8", None)).supported()
assert toNumpySchema(String("utf-32le", None)).supported()
assert toNumpySchema(Tensor(Number(True, True, 8), 1, 2, 3)).supported()
assert toNumpySchema(Collection(Number(True, True, 8), False, None)).supported()
assert not toNumpySchema(Mapping(String("bytes", None), Number(True, True, 8))).supported()
github scikit-hep / scikit-hep / experiments / test_typesystem.py View on Github external
print()
print("Schema combinations unsupported by Numpy:")
print(unsupported(toNumpySchema(Anything())))
print(unsupported(toNumpySchema(Nothing())))
print(unsupported(toNumpySchema(Null())))
print(unsupported(toNumpySchema(Boolean())))
print(unsupported(toNumpySchema(Number(True, True, 8))))
print(unsupported(toNumpySchema(Number(False, True, 8))))
print(unsupported(toNumpySchema(Number(False, False, 8))))
print(unsupported(toNumpySchema(Number(True, True, 1))))
print(unsupported(toNumpySchema(Number(False, True, 1))))
print(unsupported(toNumpySchema(String("bytes", None))))
print(unsupported(toNumpySchema(String("utf-8", None))))
print(unsupported(toNumpySchema(String("utf-32le", None))))
print(unsupported(toNumpySchema(Tensor(Number(True, True, 8), 1, 2, 3))))
print(unsupported(toNumpySchema(Collection(Number(True, True, 8), False, None))))
print(unsupported(toNumpySchema(Mapping(String("bytes", None), Number(True, True, 8)))))
print(unsupported(toNumpySchema(Record(one=Boolean(), two=Number(True, True, 8), three=String("bytes", None)))))
print(unsupported(toNumpySchema(Union(Boolean(), Number(True, True, 8), String("bytes", None)))))
print(unsupported(toNumpySchema(Union(Null(), Number(True, True, 8)))))
print(unsupported(toNumpySchema(Union(String("bytes", None)))))
print(unsupported(toNumpySchema(Record(table=Collection(Number(True, True, 8), True, None), pointer=Reference("table"))))) 
print(unsupported(toNumpySchema(Record(table=Tensor(Number(True, True, 8), 4, 4), pointer=Reference("table", 2))))) 

assert not toNumpySchema(Anything()).supported()
assert not toNumpySchema(Nothing()).supported()
assert not toNumpySchema(Null()).supported()
assert toNumpySchema(Boolean()).supported()
assert toNumpySchema(Number(True, True, 8)).supported()
assert toNumpySchema(Number(False, True, 8)).supported()
assert not toNumpySchema(Number(False, False, 8)).supported()
assert toNumpySchema(Number(True, True, 1)).supported()
github scikit-hep / scikit-hep / experiments / test_typesystem.py View on Github external
print(unsupported(toNumpySchema(String("bytes", None))))
print(unsupported(toNumpySchema(String("utf-8", None))))
print(unsupported(toNumpySchema(String("utf-32le", None))))
print(unsupported(toNumpySchema(Tensor(Number(True, True, 8), 1, 2, 3))))
print(unsupported(toNumpySchema(Collection(Number(True, True, 8), False, None))))
print(unsupported(toNumpySchema(Mapping(String("bytes", None), Number(True, True, 8)))))
print(unsupported(toNumpySchema(Record(one=Boolean(), two=Number(True, True, 8), three=String("bytes", None)))))
print(unsupported(toNumpySchema(Union(Boolean(), Number(True, True, 8), String("bytes", None)))))
print(unsupported(toNumpySchema(Union(Null(), Number(True, True, 8)))))
print(unsupported(toNumpySchema(Union(String("bytes", None)))))
print(unsupported(toNumpySchema(Record(table=Collection(Number(True, True, 8), True, None), pointer=Reference("table"))))) 
print(unsupported(toNumpySchema(Record(table=Tensor(Number(True, True, 8), 4, 4), pointer=Reference("table", 2))))) 

assert not toNumpySchema(Anything()).supported()
assert not toNumpySchema(Nothing()).supported()
assert not toNumpySchema(Null()).supported()
assert toNumpySchema(Boolean()).supported()
assert toNumpySchema(Number(True, True, 8)).supported()
assert toNumpySchema(Number(False, True, 8)).supported()
assert not toNumpySchema(Number(False, False, 8)).supported()
assert toNumpySchema(Number(True, True, 1)).supported()
assert not toNumpySchema(Number(False, True, 1)).supported()
assert toNumpySchema(String("bytes", None)).supported()
assert not toNumpySchema(String("utf-8", None)).supported()
assert toNumpySchema(String("utf-32le", None)).supported()
assert toNumpySchema(Tensor(Number(True, True, 8), 1, 2, 3)).supported()
assert toNumpySchema(Collection(Number(True, True, 8), False, None)).supported()
assert not toNumpySchema(Mapping(String("bytes", None), Number(True, True, 8))).supported()
assert toNumpySchema(Record(one=Boolean(), two=Number(True, True, 8), three=String("bytes", None))).supported()
assert not toNumpySchema(Union(Boolean(), Number(True, True, 8), String("bytes", None))).supported()
assert toNumpySchema(Union(Null(), Number(True, True, 8))).supported()
assert toNumpySchema(Union(String("bytes", None))).supported()
github scikit-hep / scikit-hep / experiments / test_typesystem.py View on Github external
print(unsupported(toNumpySchema(Number(False, True, 1))))
print(unsupported(toNumpySchema(String("bytes", None))))
print(unsupported(toNumpySchema(String("utf-8", None))))
print(unsupported(toNumpySchema(String("utf-32le", None))))
print(unsupported(toNumpySchema(Tensor(Number(True, True, 8), 1, 2, 3))))
print(unsupported(toNumpySchema(Collection(Number(True, True, 8), False, None))))
print(unsupported(toNumpySchema(Mapping(String("bytes", None), Number(True, True, 8)))))
print(unsupported(toNumpySchema(Record(one=Boolean(), two=Number(True, True, 8), three=String("bytes", None)))))
print(unsupported(toNumpySchema(Union(Boolean(), Number(True, True, 8), String("bytes", None)))))
print(unsupported(toNumpySchema(Union(Null(), Number(True, True, 8)))))
print(unsupported(toNumpySchema(Union(String("bytes", None)))))
print(unsupported(toNumpySchema(Record(table=Collection(Number(True, True, 8), True, None), pointer=Reference("table"))))) 
print(unsupported(toNumpySchema(Record(table=Tensor(Number(True, True, 8), 4, 4), pointer=Reference("table", 2))))) 

assert not toNumpySchema(Anything()).supported()
assert not toNumpySchema(Nothing()).supported()
assert not toNumpySchema(Null()).supported()
assert toNumpySchema(Boolean()).supported()
assert toNumpySchema(Number(True, True, 8)).supported()
assert toNumpySchema(Number(False, True, 8)).supported()
assert not toNumpySchema(Number(False, False, 8)).supported()
assert toNumpySchema(Number(True, True, 1)).supported()
assert not toNumpySchema(Number(False, True, 1)).supported()
assert toNumpySchema(String("bytes", None)).supported()
assert not toNumpySchema(String("utf-8", None)).supported()
assert toNumpySchema(String("utf-32le", None)).supported()
assert toNumpySchema(Tensor(Number(True, True, 8), 1, 2, 3)).supported()
assert toNumpySchema(Collection(Number(True, True, 8), False, None)).supported()
assert not toNumpySchema(Mapping(String("bytes", None), Number(True, True, 8))).supported()
assert toNumpySchema(Record(one=Boolean(), two=Number(True, True, 8), three=String("bytes", None))).supported()
assert not toNumpySchema(Union(Boolean(), Number(True, True, 8), String("bytes", None))).supported()
assert toNumpySchema(Union(Null(), Number(True, True, 8))).supported()
github scikit-hep / scikit-hep / experiments / test_typesystem.py View on Github external
assert toNumpySchema(Union(Null(), longint)).isdataset(numpy.ma.array([1, 2, 3], mask=[True, False, False]))
assert toNumpySchema(Union(Null(), Record(a=longint, b=double, c=string))).isdataset(
    numpy.ma.array(numpy.core.records.fromarrays([[1, 2, 3], [1.1, 2.2, 3.3], [b"one", b"two", b"three"]], names=["a", "b", "c"]), mask=[True, False, False]))

print()
print("Schema combinations unsupported by Numpy:")
print(unsupported(toNumpySchema(Anything())))
print(unsupported(toNumpySchema(Nothing())))
print(unsupported(toNumpySchema(Null())))
print(unsupported(toNumpySchema(Boolean())))
print(unsupported(toNumpySchema(Number(True, True, 8))))
print(unsupported(toNumpySchema(Number(False, True, 8))))
print(unsupported(toNumpySchema(Number(False, False, 8))))
print(unsupported(toNumpySchema(Number(True, True, 1))))
print(unsupported(toNumpySchema(Number(False, True, 1))))
print(unsupported(toNumpySchema(String("bytes", None))))
print(unsupported(toNumpySchema(String("utf-8", None))))
print(unsupported(toNumpySchema(String("utf-32le", None))))
print(unsupported(toNumpySchema(Tensor(Number(True, True, 8), 1, 2, 3))))
print(unsupported(toNumpySchema(Collection(Number(True, True, 8), False, None))))
print(unsupported(toNumpySchema(Mapping(String("bytes", None), Number(True, True, 8)))))
print(unsupported(toNumpySchema(Record(one=Boolean(), two=Number(True, True, 8), three=String("bytes", None)))))
print(unsupported(toNumpySchema(Union(Boolean(), Number(True, True, 8), String("bytes", None)))))
print(unsupported(toNumpySchema(Union(Null(), Number(True, True, 8)))))
print(unsupported(toNumpySchema(Union(String("bytes", None)))))
print(unsupported(toNumpySchema(Record(table=Collection(Number(True, True, 8), True, None), pointer=Reference("table"))))) 
print(unsupported(toNumpySchema(Record(table=Tensor(Number(True, True, 8), 4, 4), pointer=Reference("table", 2))))) 

assert not toNumpySchema(Anything()).supported()
assert not toNumpySchema(Nothing()).supported()
assert not toNumpySchema(Null()).supported()
assert toNumpySchema(Boolean()).supported()
github scikit-hep / scikit-hep / experiments / test_typesystem.py View on Github external
assert toNumpySchema(Number(True, True, 8)).isinstance(numpy.array([1, 2, 3])[0])
assert toNumpySchema(Number(False, True, 8)).isinstance(numpy.array([1.1, 2.2, 3.3])[0])
assert toNumpySchema(String("bytes", None)).isinstance(numpy.array([b"one", b"two", b"three"])[0])
assert toNumpySchema(String("utf-32le", None)).isinstance(numpy.array([u"one", u"two", u"three"])[0])
assert toNumpySchema(Tensor(Number(True, True, 8), 2, 2)).isinstance(numpy.array([[[1,0],[0,1]], [[0,1],[1,0]], [[1,1],[1,1]]])[0])
assert toNumpySchema(Collection(Number(False, True, 8), False, None)).isinstance(numpy.array([[1.1, 1.1, 1.1], [2.2, 2.2, 2.2], [1.1, 2.2, 3.3]])[0])
assert toNumpySchema(Collection(Number(False, True, 8), False, None)).isinstance(numpy.array([[], [1.1], [1.1, 2.2], [1.1, 2.2, 3.3]])[0])
assert toNumpySchema(Record(a=longint, b=double, c=string)).isinstance(
    numpy.core.records.fromarrays([[1, 2, 3], [1.1, 2.2, 3.3], [b"one", b"two", b"three"]], names=["a", "b", "c"])[0])
assert toNumpySchema(Union(Null(), longint)).isinstance(numpy.ma.array([1, 2, 3], mask=[True, False, False])[0])
assert toNumpySchema(Union(Null(), Record(a=longint, b=double, c=string))).isinstance(
    numpy.ma.array(numpy.core.records.fromarrays([[1, 2, 3], [1.1, 2.2, 3.3], [b"one", b"two", b"three"]], names=["a", "b", "c"]), mask=[True, False, False])[0])
assert toNumpySchema(Union(Null(), Record(a=longint, b=double, c=string))).isinstance(
    numpy.ma.array(numpy.core.records.fromarrays([[1, 2, 3], [1.1, 2.2, 3.3], [b"one", b"two", b"three"]], names=["a", "b", "c"]), mask=[True, False, False])[1])

assert toNumpySchema(Boolean()).isdataset(numpy.array([True, False, True]))
assert toNumpySchema(Number(True, True, 8)).isdataset(numpy.array([1, 2, 3]))
assert toNumpySchema(Number(False, True, 8)).isdataset(numpy.array([1.1, 2.2, 3.3]))
assert toNumpySchema(String("bytes", None)).isdataset(numpy.array([b"one", b"two", b"three"]))
assert toNumpySchema(String("utf-32le", None)).isdataset(numpy.array([u"one", u"two", u"three"]))
assert toNumpySchema(Tensor(Number(True, True, 8), 2, 2)).isdataset(numpy.array([[[1,0],[0,1]], [[0,1],[1,0]], [[1,1],[1,1]]]))
assert toNumpySchema(Collection(Number(False, True, 8), False, None)).isdataset(numpy.array([[1.1, 1.1, 1.1], [2.2, 2.2, 2.2], [1.1, 2.2, 3.3]]))
assert toNumpySchema(Collection(Number(False, True, 8), False, None)).isdataset(numpy.array([[], [1.1], [1.1, 2.2], [1.1, 2.2, 3.3]]))
assert toNumpySchema(Record(a=longint, b=double, c=string)).isdataset(
    numpy.core.records.fromarrays([[1, 2, 3], [1.1, 2.2, 3.3], [b"one", b"two", b"three"]], names=["a", "b", "c"]))
assert toNumpySchema(Union(Null(), longint)).isdataset(numpy.ma.array([1, 2, 3], mask=[True, False, False]))
assert toNumpySchema(Union(Null(), Record(a=longint, b=double, c=string))).isdataset(
    numpy.ma.array(numpy.core.records.fromarrays([[1, 2, 3], [1.1, 2.2, 3.3], [b"one", b"two", b"three"]], names=["a", "b", "c"]), mask=[True, False, False]))

print()
print("Schema combinations unsupported by Numpy:")
print(unsupported(toNumpySchema(Anything())))
github scikit-hep / scikit-hep / experiments / test_typesystem.py View on Github external
assert toNumpySchema(Record(a=longint, b=double, c=string)).isdataset(
    numpy.core.records.fromarrays([[1, 2, 3], [1.1, 2.2, 3.3], [b"one", b"two", b"three"]], names=["a", "b", "c"]))
assert toNumpySchema(Union(Null(), longint)).isdataset(numpy.ma.array([1, 2, 3], mask=[True, False, False]))
assert toNumpySchema(Union(Null(), Record(a=longint, b=double, c=string))).isdataset(
    numpy.ma.array(numpy.core.records.fromarrays([[1, 2, 3], [1.1, 2.2, 3.3], [b"one", b"two", b"three"]], names=["a", "b", "c"]), mask=[True, False, False]))

print()
print("Schema combinations unsupported by Numpy:")
print(unsupported(toNumpySchema(Anything())))
print(unsupported(toNumpySchema(Nothing())))
print(unsupported(toNumpySchema(Null())))
print(unsupported(toNumpySchema(Boolean())))
print(unsupported(toNumpySchema(Number(True, True, 8))))
print(unsupported(toNumpySchema(Number(False, True, 8))))
print(unsupported(toNumpySchema(Number(False, False, 8))))
print(unsupported(toNumpySchema(Number(True, True, 1))))
print(unsupported(toNumpySchema(Number(False, True, 1))))
print(unsupported(toNumpySchema(String("bytes", None))))
print(unsupported(toNumpySchema(String("utf-8", None))))
print(unsupported(toNumpySchema(String("utf-32le", None))))
print(unsupported(toNumpySchema(Tensor(Number(True, True, 8), 1, 2, 3))))
print(unsupported(toNumpySchema(Collection(Number(True, True, 8), False, None))))
print(unsupported(toNumpySchema(Mapping(String("bytes", None), Number(True, True, 8)))))
print(unsupported(toNumpySchema(Record(one=Boolean(), two=Number(True, True, 8), three=String("bytes", None)))))
print(unsupported(toNumpySchema(Union(Boolean(), Number(True, True, 8), String("bytes", None)))))
print(unsupported(toNumpySchema(Union(Null(), Number(True, True, 8)))))
print(unsupported(toNumpySchema(Union(String("bytes", None)))))
print(unsupported(toNumpySchema(Record(table=Collection(Number(True, True, 8), True, None), pointer=Reference("table"))))) 
print(unsupported(toNumpySchema(Record(table=Tensor(Number(True, True, 8), 4, 4), pointer=Reference("table", 2))))) 

assert not toNumpySchema(Anything()).supported()
assert not toNumpySchema(Nothing()).supported()
github scikit-hep / scikit-hep / experiments / test_typesystem.py View on Github external
numpy.ma.array(numpy.core.records.fromarrays([[1, 2, 3], [1.1, 2.2, 3.3], [b"one", b"two", b"three"]], names=["a", "b", "c"]), mask=[True, False, False])[0])
assert toNumpySchema(Union(Null(), Record(a=longint, b=double, c=string))).isinstance(
    numpy.ma.array(numpy.core.records.fromarrays([[1, 2, 3], [1.1, 2.2, 3.3], [b"one", b"two", b"three"]], names=["a", "b", "c"]), mask=[True, False, False])[1])

assert toNumpySchema(Boolean()).isdataset(numpy.array([True, False, True]))
assert toNumpySchema(Number(True, True, 8)).isdataset(numpy.array([1, 2, 3]))
assert toNumpySchema(Number(False, True, 8)).isdataset(numpy.array([1.1, 2.2, 3.3]))
assert toNumpySchema(String("bytes", None)).isdataset(numpy.array([b"one", b"two", b"three"]))
assert toNumpySchema(String("utf-32le", None)).isdataset(numpy.array([u"one", u"two", u"three"]))
assert toNumpySchema(Tensor(Number(True, True, 8), 2, 2)).isdataset(numpy.array([[[1,0],[0,1]], [[0,1],[1,0]], [[1,1],[1,1]]]))
assert toNumpySchema(Collection(Number(False, True, 8), False, None)).isdataset(numpy.array([[1.1, 1.1, 1.1], [2.2, 2.2, 2.2], [1.1, 2.2, 3.3]]))
assert toNumpySchema(Collection(Number(False, True, 8), False, None)).isdataset(numpy.array([[], [1.1], [1.1, 2.2], [1.1, 2.2, 3.3]]))
assert toNumpySchema(Record(a=longint, b=double, c=string)).isdataset(
    numpy.core.records.fromarrays([[1, 2, 3], [1.1, 2.2, 3.3], [b"one", b"two", b"three"]], names=["a", "b", "c"]))
assert toNumpySchema(Union(Null(), longint)).isdataset(numpy.ma.array([1, 2, 3], mask=[True, False, False]))
assert toNumpySchema(Union(Null(), Record(a=longint, b=double, c=string))).isdataset(
    numpy.ma.array(numpy.core.records.fromarrays([[1, 2, 3], [1.1, 2.2, 3.3], [b"one", b"two", b"three"]], names=["a", "b", "c"]), mask=[True, False, False]))

print()
print("Schema combinations unsupported by Numpy:")
print(unsupported(toNumpySchema(Anything())))
print(unsupported(toNumpySchema(Nothing())))
print(unsupported(toNumpySchema(Null())))
print(unsupported(toNumpySchema(Boolean())))
print(unsupported(toNumpySchema(Number(True, True, 8))))
print(unsupported(toNumpySchema(Number(False, True, 8))))
print(unsupported(toNumpySchema(Number(False, False, 8))))
print(unsupported(toNumpySchema(Number(True, True, 1))))
print(unsupported(toNumpySchema(Number(False, True, 1))))
print(unsupported(toNumpySchema(String("bytes", None))))
print(unsupported(toNumpySchema(String("utf-8", None))))
print(unsupported(toNumpySchema(String("utf-32le", None))))
github scikit-hep / scikit-hep / experiments / test_typesystem.py View on Github external
print(unsupported(toNumpySchema(Number(True, True, 1))))
print(unsupported(toNumpySchema(Number(False, True, 1))))
print(unsupported(toNumpySchema(String("bytes", None))))
print(unsupported(toNumpySchema(String("utf-8", None))))
print(unsupported(toNumpySchema(String("utf-32le", None))))
print(unsupported(toNumpySchema(Tensor(Number(True, True, 8), 1, 2, 3))))
print(unsupported(toNumpySchema(Collection(Number(True, True, 8), False, None))))
print(unsupported(toNumpySchema(Mapping(String("bytes", None), Number(True, True, 8)))))
print(unsupported(toNumpySchema(Record(one=Boolean(), two=Number(True, True, 8), three=String("bytes", None)))))
print(unsupported(toNumpySchema(Union(Boolean(), Number(True, True, 8), String("bytes", None)))))
print(unsupported(toNumpySchema(Union(Null(), Number(True, True, 8)))))
print(unsupported(toNumpySchema(Union(String("bytes", None)))))
print(unsupported(toNumpySchema(Record(table=Collection(Number(True, True, 8), True, None), pointer=Reference("table"))))) 
print(unsupported(toNumpySchema(Record(table=Tensor(Number(True, True, 8), 4, 4), pointer=Reference("table", 2))))) 

assert not toNumpySchema(Anything()).supported()
assert not toNumpySchema(Nothing()).supported()
assert not toNumpySchema(Null()).supported()
assert toNumpySchema(Boolean()).supported()
assert toNumpySchema(Number(True, True, 8)).supported()
assert toNumpySchema(Number(False, True, 8)).supported()
assert not toNumpySchema(Number(False, False, 8)).supported()
assert toNumpySchema(Number(True, True, 1)).supported()
assert not toNumpySchema(Number(False, True, 1)).supported()
assert toNumpySchema(String("bytes", None)).supported()
assert not toNumpySchema(String("utf-8", None)).supported()
assert toNumpySchema(String("utf-32le", None)).supported()
assert toNumpySchema(Tensor(Number(True, True, 8), 1, 2, 3)).supported()
assert toNumpySchema(Collection(Number(True, True, 8), False, None)).supported()
assert not toNumpySchema(Mapping(String("bytes", None), Number(True, True, 8))).supported()
assert toNumpySchema(Record(one=Boolean(), two=Number(True, True, 8), three=String("bytes", None))).supported()
assert not toNumpySchema(Union(Boolean(), Number(True, True, 8), String("bytes", None))).supported()