Skip to content

Commit

Permalink
platform safe type comparison (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
tjlane authored Nov 4, 2024
1 parent 27903be commit 10ee7c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/unit/test_rsmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ def test_filter_common_indices_with_maps(noise_free_map: Map) -> None:

def test_verify_type(noise_free_map: Map) -> None:
dataseries = rs.DataSeries([1, 2, 3])
assert dataseries.dtype == int
assert np.issubdtype(dataseries.dtype, np.integer)
noise_free_map._verify_type("foo", [int], dataseries, fix=False, cast_fix_to=int)

with pytest.raises(AssertionError):
noise_free_map._verify_type("foo", [float], dataseries, fix=False, cast_fix_to=float)

output = noise_free_map._verify_type("foo", [float], dataseries, fix=True, cast_fix_to=float)
assert output.dtype == float
assert np.issubdtype(output.dtype, np.floating)


@pytest.mark.parametrize("fix", [False, True])
Expand Down

0 comments on commit 10ee7c4

Please sign in to comment.