numpy 1.21 causing test failure
Closed this issue · 1 comments
jdavies-st commented
See
https://github.com/spacetelescope/stdatamodels/runs/2964661881?check_suite_focus=true#step:6:32
The traceback:
$ pytest -k test_table_array_shape_ndim
============================== test session starts ==============================
platform darwin -- Python 3.9.5, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /Users/jdavies/dev/stdatamodels, configfile: setup.cfg, testpaths: tests, src
plugins: asdf-2.8.1, openfiles-0.5.0, doctestplus-0.9.0
collected 180 items / 178 deselected / 2 selected
tests/test_schema.py .F [100%]
=================================== FAILURES ====================================
____________________ test_table_array_shape_ndim[test.fits] _____________________
filename = 'test.fits'
tmp_path = PosixPath('/private/var/folders/jg/by5st33j7ps356dgb4kn8w900001n5/T/pytest-of-jdavies/pytest-2/test_table_array_shape_ndim_te1')
@pytest.mark.parametrize("filename", ["test.asdf", "test.fits"])
def test_table_array_shape_ndim(filename, tmp_path):
file_path = tmp_path/filename
with TableModel() as x:
x.table = [
(
42,
37.5,
'STRING',
[[37.5, 38.0], [39.0, 40.0], [41.0, 42.0]],
[[37.5, 38.0], [39.0, 40.0], [41.0, 42.0]],
)
]
assert x.table.dtype == [
('int16_column', '=i2'),
('float32_column', '=f4'),
('ascii_column', 'S64'),
('float32_column_with_shape', '=f4', (3, 2)),
('float32_column_with_ndim', '=f4', (3, 2)),
]
x.save(file_path)
with TableModel(file_path) as x:
> assert x.table.dtype == [
('int16_column', '=i2'),
('float32_column', '=f4'),
('ascii_column', 'S64'),
('float32_column_with_shape', '=f4', (3, 2)),
('float32_column_with_ndim', '=f4', (3, 2)),
]
E AssertionError: assert dtype((numpy.record, [('int16_column', '>i2'), ('float32_column', '>f4'), ('ascii_column', 'S64'), ('float32_column_with_shape', '>f4', (3, 2)), ('float32_column_with_ndim', '>f4', (3, 2))])) == [('int16_column', '=i2'), ('float32_column', '=f4'), ('ascii_column', 'S64'), ('float32_column_with_shape', '=f4', (3, 2)), ('float32_column_with_ndim', '=f4', (3, 2))]
E + where dtype((numpy.record, [('int16_column', '>i2'), ('float32_column', '>f4'), ('ascii_column', 'S64'), ('float32_column_with_shape', '>f4', (3, 2)), ('float32_column_with_ndim', '>f4', (3, 2))])) = FITS_rec([(42, 37.5, 'STRING', [[37.5, 38. ], [39. , 40. ], [41. , 42. ]], [[37.5, 38. ], [39. , 40. ], [41. , 42. ]])..., ('ascii_column', 'S64'), ('float32_column_with_shape', '>f4', (3, 2)), ('float32_column_with_ndim', '>f4', (3, 2))])).dtype
E + where FITS_rec([(42, 37.5, 'STRING', [[37.5, 38. ], [39. , 40. ], [41. , 42. ]], [[37.5, 38. ], [39. , 40. ], [41. , 42. ]])..., ('ascii_column', 'S64'), ('float32_column_with_shape', '>f4', (3, 2)), ('float32_column_with_ndim', '>f4', (3, 2))])) = <TableModel from test.fits>.table
tests/test_schema.py:114: AssertionError
The same job passed the week before with no changes in master
. The only differences in the dependencies was:
numpy==1.20.3, | numpy==1.21.0,
pyrsistent==0.17.3, | pyrsistent==0.18.0,