Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some tests fail on 32 bits architectures #14

Closed
ViviCoder opened this issue Oct 26, 2016 · 1 comment · Fixed by #15
Closed

Some tests fail on 32 bits architectures #14

ViviCoder opened this issue Oct 26, 2016 · 1 comment · Fixed by #15
Assignees
Labels
Milestone

Comments

@ViviCoder
Copy link

When running tests on a 32-bits architecture, some tests fail with the following trace:

=================================== FAILURES ===================================
__________________ [doctest] pydl.pydlutils.misc.djs_laxisgen __________________
050 
051     Notes
052     -----
053     For two or more dimensions, there is no difference between this routine
054     and :func:`~pydl.pydlutils.misc.djs_laxisnum`.
055 
056     Examples
057     --------
058     >>> from pydl.pydlutils.misc import djs_laxisgen
059     >>> djs_laxisgen([4,4])
Differences (unified diff with -expected +actual):
    @@ -2,3 +2,3 @@
            [1, 1, 1, 1],
            [2, 2, 2, 2],
    -       [3, 3, 3, 3]], dtype=int32)
    +       [3, 3, 3, 3]])

pydl/pydlutils/misc.py:59: DocTestFailure
__________________ [doctest] pydl.pydlutils.misc.djs_laxisnum __________________
092 
093     Notes
094     -----
095     For two or more dimensions, there is no difference between this routine
096     and :func:`~pydl.pydlutils.misc.djs_laxisgen`.
097 
098     Examples
099     --------
100     >>> from pydl.pydlutils.misc import djs_laxisnum
101     >>> djs_laxisnum([4,4])
Differences (unified diff with -expected +actual):
    @@ -2,3 +2,3 @@
            [1, 1, 1, 1],
            [2, 2, 2, 2],
    -       [3, 3, 3, 3]], dtype=int32)
    +       [3, 3, 3, 3]])

pydl/pydlutils/misc.py:101: DocTestFailure
___________________ [doctest] pydl.pydlutils.sdss.sdss_objid ___________________
326         out of bounds.
327 
328     Notes
329     -----
330     firstField flag never set.
331 
332     Examples
333     --------
334     >>> from pydl.pydlutils.sdss import sdss_objid
335     >>> sdss_objid(3704,3,91,146)
Expected:
    array([1237661382772195474])
Got:
    array([1237661382772195474], dtype=int64)

pydl/pydlutils/sdss.py:335: DocTestFailure
___________________________ TestSDSS.test_sdss_objid ___________________________

self = <pydl.pydlutils.tests.test_sdss.TestSDSS object at 0xb398fa50>

    def test_sdss_objid(self):
        assert sdss_objid(3704, 3, 91, 146) == 1237661382772195474
        run = np.array([3704, 1000])
        camcol = np.array([3, 6])
        field = np.array([91, 77])
        obj = np.array([146, 123])
>       assert (np.array([1237661382772195474, 1237649770790322299]) ==
                sdss_objid(run, camcol, field, obj)).all()
E       assert <built-in method all of numpy.ndarray object at 0xb3b00ef8>()
E        +  where <built-in method all of numpy.ndarray object at 0xb3b00ef8> = array([123766..., dtype=int64) == array([1237645..., dtype=int64)
E           Use -v to get the full diff.all

pydl/pydlutils/tests/test_sdss.py:132: AssertionError
_______________________ TestYanny.test_write_table_yanny _______________________

self = <pydl.pydlutils.tests.test_yanny.TestYanny object at 0xb3960490>

    def test_write_table_yanny(self):
        """Test writing an astropy Table to yanny.
            """
        filename = self.data('table.par')
        a = [1, 4, 5]
        b = [2.0, 5.0, 8.2]
        c = [b'x', b'y', b'z']
        t = Table([a, b, c], names=('a', 'b', 'c'),
                  meta={'name': 'first table'})
        t.write(filename, tablename='test')
        par1 = yanny(filename)
        par2 = yanny(self.data('test_table.par'))
>       assert par1 == par2
E       assert #%yanny\n# Tab...\nTEST 5 8.2 z\n == #%yanny\n# Tabl...\nTEST 5 8.2 z\n
E         Omitting 1 identical items, use -v to show
E         Differing items:
E         {'TEST': rec.array([(1, 2.0, 'x'), (4, 5.0, 'y'), (5, 8.2, 'z')], \n          dtype=[('a', '<i4'), ('b', '<f8'), ('c', 'S1')])} != {'TEST': rec.array([(1L, 2.0, 'x'), (4L, 5.0, 'y'), (5L, 8.2, 'z')], \n          dtype=[('a', '<i8'), ('b', '<f8'), ('c', 'S1')])}
E         Use -v to get the full diff

pydl/pydlutils/tests/test_yanny.py:129: AssertionError
@weaverba137 weaverba137 self-assigned this Oct 26, 2016
@weaverba137
Copy link
Owner

I've got a working 32-bit environment now where I can reproduce this. Should be straightforward to fix these tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants