Skip to content

Commit

Permalink
Update test_transformer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Delaunay authored Feb 6, 2024
1 parent 0673be6 commit c49ad23
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/orion/test_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,19 +199,19 @@ def test_reverse(self):
]
)
)
== numpy.array([["ipsi", "asfa"], [2, "ipsi"]], dtype=numpy.object)
== numpy.array([["ipsi", "asfa"], [2, "ipsi"]], dtype=object)
)

t = Compose([Enumerate([2, "asfa"]), OneHotEncode(2)], "categorical")
assert t.reverse(0.3) == 2
assert t.reverse(2.0) == "asfa"
assert numpy.all(
t.reverse((0.0, 0.0, 0.0, 1.0))
== numpy.array([2, 2, 2, "asfa"], dtype=numpy.object)
== numpy.array([2, 2, 2, "asfa"], dtype=object)
)
assert numpy.all(
t.reverse(numpy.array([[0.55, 3.0], [-0.6, 1.0]]))
== numpy.array([["asfa", "asfa"], [2, "asfa"]], dtype=numpy.object)
== numpy.array([["asfa", "asfa"], [2, "asfa"]], dtype=object)
)

# for the crazy enough
Expand All @@ -222,7 +222,7 @@ def test_reverse(self):
assert t.reverse(-0.2) == 2
assert numpy.all(
t.reverse([[0.5, 0], [1.0, 55]])
== numpy.array([[2, 2], [2, 2]], dtype=numpy.object)
== numpy.array([[2, 2], [2, 2]], dtype=object)
)

def test_infer_target_shape(self):
Expand Down Expand Up @@ -377,7 +377,7 @@ def test_reverse(self):
t.reverse(3)
assert numpy.all(
t.reverse([[2, 1], [0, 2]])
== numpy.array([["ipsi", "asfa"], [2, "ipsi"]], dtype=numpy.object)
== numpy.array([["ipsi", "asfa"], [2, "ipsi"]], dtype=object)
)

# for the crazy enough
Expand All @@ -387,7 +387,7 @@ def test_reverse(self):
t.reverse(1)
assert numpy.all(
t.reverse([[0, 0], [0, 0]])
== numpy.array([[2, 2], [2, 2]], dtype=numpy.object)
== numpy.array([[2, 2], [2, 2]], dtype=object)
)

def test_infer_target_shape(self):
Expand Down

0 comments on commit c49ad23

Please sign in to comment.