Skip to content

BUG: loongarch doesn't use REAL(10) - #24904

Merged
charris merged 1 commit into
numpy:mainfrom
iv-m:loongarch-fix
Oct 12, 2023
Merged

charris merged 1 commit into
numpy:mainfrom
iv-m:loongarch-fix

Conversation

@iv-m

@iv-m iv-m commented Oct 12, 2023

Copy link
Copy Markdown
Contributor

This fixes numpy.f2py.tests.test_kind.TestKind.

Here is an example of the test failure from my loongarch64 box building numpy 1.25.2:

______________________________ TestKind.test_real ______________________________

self = <numpy.f2py.tests.test_kind.TestKind object at 0x7fffc51cc350>

    def test_real(self):
        """
        Test (processor-dependent) `real` kind_func for real numbers
        of up to 31 digits precision (extended/quadruple).
        """
        selectedrealkind = self.module.selectedrealkind

        for i in range(32):
>           assert selectedrealkind(i) == selected_real_kind(
                i
            ), f"selectedrealkind({i}): expected {selected_real_kind(i)!r} but got {selectedrealkind(i)!r}"
E           AssertionError: selectedrealkind(16): expected 10 but got 16
E           assert 16 == 10
E            +  where 16 = <fortran function selectedrealkind>(16)
E            +  and   10 = selected_real_kind(16)

i          = 16
selectedrealkind = <fortran function selectedrealkind>
self       = <numpy.f2py.tests.test_kind.TestKind object at 0x7fffc51cc350>

../../.run_venv/lib64/python3/site-packages/numpy/f2py/tests/test_kind.py:32: AssertionError

This commit fixes that.

This fixes numpy.f2py.tests.test_kind.TestKind
@charris charris added the 09 - Backport-Candidate PRs tagged should be backported label Oct 12, 2023
@charris charris added this to the 1.26.2 release milestone Oct 12, 2023
@charris
charris merged commit 86e1756 into numpy:main Oct 12, 2023
@charris

charris commented Oct 12, 2023

Copy link
Copy Markdown
Member

Thanks @iv-m .

@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Oct 12, 2023
@charris charris removed this from the 1.26.1 release milestone Oct 12, 2023
charris pushed a commit to charris/numpy that referenced this pull request Nov 19, 2023
Same as e.g. loongarch per numpygh-24904.  At this point seems like it should
be more of an exclude list than an include one...
charris pushed a commit to charris/numpy that referenced this pull request Nov 19, 2023
Same as e.g. loongarch per numpygh-24904.  At this point seems like it should
be more of an exclude list than an include one...
matoro added a commit to matoro/numpy that referenced this pull request Nov 25, 2023
Same as e.g. loongarch per numpygh-24904, alpha per numpygh-25078, etc...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants