question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[1.3] test_fortran_* failure

See original GitHub issue

We have a group that tests every package for bitwise reproducibility of the packaging, and they found a built time test failure in test_fortran_reader and in test_fortran_invalid_exp (on x86_64):

_________________________ test_fortran_reader[True] ___________________________
parallel = True

    @pytest.mark.parametrize("parallel", [
        pytest.mark.xfail(os.name == 'nt', reason=
                          "Multiprocessing is currently unsupported on Windows")(True),
        False])
    
    def test_fortran_reader(parallel):
        """
        Make sure that ascii.read() can read Fortran-style exponential notation
        using the fast_reader.
        """
        text = 'A B C\n100.01{:s}+99 2.0 3\n 4.2{:s}-1 5.0{:s}-1 0.6{:s}4'
        expected = Table([[1.0001e101, 0.42], [2, 0.5], [3.0, 6000]],
                         names=('A', 'B', 'C'))
    
        expstyles = { 'e': 4*('E'), 'D': ('D', 'd', 'd', 'D'), 'Q': 2*('q', 'Q'),
                      'fortran': ('D', 'E', 'Q', 'd') }
    
        # C strtod (not-fast converter) can't handle Fortran exp
        with pytest.raises(FastOptionsError) as e:
            ascii.read(text.format(*(4*('D'))), format='basic', guess=False,
                       fast_reader={'use_fast_converter': False,
                                    'parallel': parallel, 'exponent_style': 'D'})
        assert 'fast_reader: exponent_style requires use_fast_converter' in str(e)
    
        # enable multiprocessing and the fast converter
        # iterate over all style-exponent combinations
        for s, c in expstyles.items():
            table = ascii.read(text.format(*c), format='basic', guess=False,
                               fast_reader={'parallel': parallel,
                                            'exponent_style': s})
>           assert_table_equal(table, expected)

astropy/io/ascii/tests/test_c_reader.py:1087: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
astropy/io/ascii/tests/test_c_reader.py:37: in assert_table_equal
    assert_equal(t1[name].dtype.kind, t2[name].dtype.kind)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

a = 'S', b = 'f'

    def assert_equal(a, b):
>       assert a == b
E       AssertionError

astropy/io/ascii/tests/common.py:39: AssertionError
________________________ test_fortran_invalid_exp[True] ________________________

parallel = True

    @pytest.mark.parametrize("parallel", [
        pytest.mark.xfail(os.name == 'nt', reason=
                          "Multiprocessing is currently unsupported on Windows")(True),
        False])
    def test_fortran_invalid_exp(parallel):
        """
        Test Fortran-style exponential notation in the fast_reader with invalid
        exponent-like patterns (no triple-digits) to make sure they are returned
        as strings instead, as with the standard C parser.
        """
        if parallel and TRAVIS:
            pytest.xfail("Multiprocessing can sometimes fail on Travis CI")
    
        fields = [ '1.0001+1', '.42d1', '2.3+10', '0.5', '3+1001', '3000.',
                   '2', '4.56e-2.3', '8000', '4.2-122' ]
        values = [ '1.0001+1', 4.2, '2.3+10', 0.5, '3+1001', 3.e3,
                   2, '4.56e-2.3', 8000, 4.2e-122 ]
    
        t = ascii.read(StringIO(' '.join(fields)), format='no_header', guess=False,
                       fast_reader={'parallel': parallel, 'exponent_style': 'A'})
        read_values = [col[0] for col in t.itercols()]
>       assert read_values == values
E       assert ['1.0001+1', ..., 3000.0, ...] == ['1.0001+1', 4..., 3000.0, ...]
E         At index 1 diff: '.42d1' != 4.2
E         Full diff:
E         ['1.0001+1',
E         -  '.42d1',
E         +  4.2,
E         '2.3+10',
E         0.5,
E         '3+1001',
E         3000.0,
E         2,
E         '4.56e-2.3',
E         8000,
E         -  '4.2-122']
E         ?  -       -
E         +  4.2e-122]
E         ?     +

astropy/io/ascii/tests/test_c_reader.py:1123: AssertionError

I am not sure whether this is a regression, and I also don’t know what they do different from the normal setup. Full build log here. This is independent of whether external (3.0.5) or internal pytest ist used.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
olebolecommented, Mar 18, 2019

This is probably fixed, at least for Linux. For GNU Hurd, we don’t build it in the moment, since some of the dependencies are not there yet. I would propose to close it, I will re-open when it seems to re-appear.

0reactions
bsipoczcommented, Mar 18, 2019

Thank you for the feedback @olebole!

Read more comments on GitHub >

github_iconTop Results From Across the Web

test_io.TestIOSelf failures on Fedora Rawhide i686 #105
Disabling MPI thread support may fix some of the issues (again, Open MPI issues, not mpi4py ones). Additionally, running without MPI thread ...
Read more >
NBS FORTRAN Test Programs - GovInfo
Test FORTRAN language elements before they are used in support of other tests. ... 'Hie executable program may fail to meet the loader,...
Read more >
Libtool - GNU.org
Libtool caught a common error… trying to build a library from standard objects instead of special .lo object files. This doesn't matter so...
Read more >
zfp Documentation
zfp generally uses lossy but optionally error-bounded compression. Bit-for-bit lossless compression is also possible through one of zfp's compression modes.
Read more >
FLASH User's Guide
new problems of their own will want to refer to Chapter 3 (The FLASH ... FFLAGS TEST Fortran compilation flags to produce an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found