10000 BUG: FreeBSD fails a conversion test · Issue #28351 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
BUG: FreeBSD fails a conversion test #28351
Closed
@mattip

Description

@mattip

FreeBSD recently began failing the test_nested_arrays_stringlength test in test_array_coercion.py. It emits a RuntimeWarning when casting float objects to string dtype

self = <test_array_coercion.TestStringDiscovery object at 0x1a16d2f95dd0>
obj = 1.2

    @pytest.mark.parametrize("obj",
            [object(), 1.2, 10**43, None, "string"],
            ids=["object", "1.2", "10**43", "None", "string"])
    def test_nested_arrays_stringlength(self, obj):
        length = len(str(obj))
        expected = np.dtype(f"S{length}")
        arr = np.array(obj, dtype="O")
>       assert np.array([arr, arr], dtype="S").dtype == expected
E       RuntimeWarning: invalid value encountered in cast

arr        = array(1.2, dtype=object)
expected   = dtype('S3')
length     = 3
obj        = 1.2
self       = <test_array_coercion.TestStringDiscovery object at 0x1a16d2f95dd0>

../.venv/lib/python3.11/site-packages/numpy/_core/tests/test_array_coercion.py:180: RuntimeWarning

Maybe we could get some FreeBSD eyeballs on this, I don't know who we should ping. I see @oscargus and @DavidAlphaFox have previously contributed FreeBSD issues and PRs, maybe they know who to turn to? In any case, #28331 makes CI pass by checking that this warning is emitted. This issue is to remind us to try to fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0