desihub/speclite

astropy and numpy warnings

Closed this issue · 0 comments

When running

python setup.py test 

in an updated conda environment (including Astropy v4.3 see pkg_list.txt for the full package list) the following warnings occur:

grep warnings speclite.stdout
=============================== warnings summary ===============================
../../../../../global/common/software/desi/users/malvarez/desiconda-test/conda/lib/python3.9/site
-packages/astropy/tests/plugins/display.py:16
  /global/common/software/desi/users/malvarez/desiconda-test/conda/lib/python3.9/site-packages/as
tropy/tests/plugins/display.py:16: AstropyDeprecationWarning: The astropy.tests.plugins.display p
lugin has been deprecated. See the pytest-astropy-header documentation for information on migrati
ng to using pytest-astropy-header to customize the pytest header.
    warnings.warn('The astropy.tests.plugins.display plugin has been deprecated. '

speclite/filters.py::speclite.filters.FilterResponse
speclite/filters.py::speclite.filters.FilterResponse
speclite/filters.py::speclite.filters.FilterResponse
speclite/tests/test_filters.py::test_response_call
speclite/tests/test_filters.py::test_response_call
speclite/tests/test_filters.py::test_response_call
  /tmp/speclite-test-_ix9yqj_/lib/python3.9/site-packages/speclite/filters.py:832: DeprecationWar
ning: np.asscalar(a) is deprecated since NumPy v1.16, use a.item() instead
    response = np.asscalar(response)

speclite/redshift.py: 2 warnings
speclite/tests/test_redshift.py: 31 warnings
  /tmp/speclite-test-_ix9yqj_/lib/python3.9/site-packages/speclite/redshift.py:111: DeprecationWa
rning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `fl
oat` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted t
he numpy scalar type, use `np.float64` here.
  Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20
.0-notes.html#deprecations
    z_in = np.float(z_in)

speclite/redshift.py: 2 warnings
speclite/tests/test_redshift.py: 28 warnings
  /tmp/speclite-test-_ix9yqj_/lib/python3.9/site-packages/speclite/redshift.py:115: DeprecationWa
rning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `fl
oat` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted t
he numpy scalar type, use `np.float64` here.
  Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20
.0-notes.html#deprecations
    z_out = np.float(z_out)

speclite/redshift.py: 4 warnings
speclite/tests/test_redshift.py: 29 warnings
  /tmp/speclite-test-_ix9yqj_/lib/python3.9/site-packages/speclite/redshift.py:139: DeprecationWa
rning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `fl
oat` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted t
he numpy scalar type, use `np.float64` here.
  Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20
.0-notes.html#deprecations
    exponent = np.float(rule.get('exponent'))

speclite/redshift.py: 4 warnings
speclite/tests/test_redshift.py: 12 warnings
  /tmp/speclite-test-_ix9yqj_/lib/python3.9/site-packages/speclite/redshift.py:200: DeprecationWa
rning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `fl
oat` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted t
he numpy scalar type, use `np.float64` here.
  Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20
.0-notes.html#deprecations
    exponent = np.float(rule.get('exponent'))

-- Docs: https://docs.pytest.org/en/stable/warnings.html
====================== 132 passed, 119 warnings in 3.33s =======================

When using astropy 4.0.1.post1, the unit tests for speclite have 6 warnings:

grep warnings speclite.stdout
=============================== warnings summary ===============================
speclite/filters.py::speclite.filters.FilterResponse
speclite/filters.py::speclite.filters.FilterResponse
speclite/filters.py::speclite.filters.FilterResponse
speclite/tests/test_filters.py::test_response_call
speclite/tests/test_filters.py::test_response_call
speclite/tests/test_filters.py::test_response_call
  /tmp/speclite-test-tobvrzl2/lib/python3.8/site-packages/speclite/filters.py:832: DeprecationWar
ning: np.asscalar(a) is deprecated since NumPy v1.16, use a.item() instead
    response = np.asscalar(response)

-- Docs: https://docs.pytest.org/en/latest/warnings.html
======================= 132 passed, 6 warnings in 4.01s ========================