astrocut
astrocut copied to clipboard
Resolve Warnings in unit tests
The numpy warnings are resolved by https://github.com/spacetelescope/astrocut/pull/113. Are there any warnings that should be resolved by filtering them from pytest output? https://docs.pytest.org/en/latest/how-to/capture-warnings.html
================================================== warnings summary ==================================================
.tox/test/lib/python3.11/site-packages/astrocut/tests/test_asdf_cut.py::test_get_center_pixel
.tox/test/lib/python3.11/site-packages/astrocut/tests/test_asdf_cut.py::test_asdf_cutout
/host/.tox/test/lib/python3.11/site-packages/astropy/wcs/wcs.py:1112: AstropyUserWarning: Polynomial distortion is not implemented.
warnings.warn(
.tox/test/lib/python3.11/site-packages/astrocut/tests/test_cube_cut.py::test_cube_cutout[SPOC]
.tox/test/lib/python3.11/site-packages/astrocut/tests/test_cube_cut.py::test_exceptions[SPOC]
/host/.tox/test/lib/python3.11/site-packages/astropy/wcs/wcs.py:807: FITSFixedWarning: 'datfix' made the change 'Set MJD-OBS to 58614.005866 from DATE-OBS.
Set MJD-END to 58614.026699 from DATE-END'.
warnings.warn(
.tox/test/lib/python3.11/site-packages/astrocut/tests/test_cube_cut.py::test_exceptions[SPOC]
.tox/test/lib/python3.11/site-packages/astrocut/tests/test_cube_cut.py::test_exceptions[TICA]
/host/.tox/test/lib/python3.11/site-packages/astropy/wcs/wcs.py:2953: AstropyWarning: Some non-standard WCS keywords were excluded: A_ORDER, A_0_2, A_1_1, A_2_0, B_ORDER, B_0_2, B_1_1, B_2_0, AP_ORDER, AP_0_1, AP_0_2, AP_1_0, AP_1_1, AP_2_0, BP_ORDER, BP_0_1, BP_0_2, BP_1_0, BP_1_1, BP_2_0 Use the ``relax`` kwarg to control this.
warnings.warn(
.tox/test/lib/python3.11/site-packages/astrocut/tests/test_cube_cut.py::test_exceptions[SPOC]
.tox/test/lib/python3.11/site-packages/astrocut/tests/test_cube_cut.py::test_exceptions[TICA]
/host/.tox/test/lib/python3.11/site-packages/astropy/wcs/wcs.py:1943: RuntimeWarning: All-NaN slice encountered
while np.nanmax(dn) >= tol2 and k < maxiter:
.tox/test/lib/python3.11/site-packages/astrocut/tests/test_cube_cut.py::test_s3_cube_cut
.tox/test/lib/python3.11/site-packages/astrocut/tests/test_cube_cut.py::test_multithreading
.tox/test/lib/python3.11/site-packages/astrocut/tests/test_cube_cut.py::test_multithreading
.tox/test/lib/python3.11/site-packages/astrocut/tests/test_cube_cut.py::test_multithreading
/host/.tox/test/lib/python3.11/site-packages/astropy/io/fits/card.py:1038: VerifyWarning: Card is too long, comment will be truncated.
warnings.warn(
.tox/test/lib/python3.11/site-packages/astrocut/tests/test_cutouts.py::test_fits_cut[SPOC]
/host/.tox/test/lib/python3.11/site-packages/astrocut/cutouts.py:360: DataWarning: Cutout of /tmp/pytest-of-root/pytest-57/test_fits_cut_SPOC_0/img_0000.fits contains no data and will not be written.
warnings.warn(f"Cutout of {fle} contains no data and will not be written.",
.tox/test/lib/python3.11/site-packages/astrocut/tests/test_cutouts.py::test_fits_cut[SPOC]
/host/.tox/test/lib/python3.11/site-packages/astrocut/cutouts.py:360: DataWarning: Cutout of /tmp/pytest-of-root/pytest-57/test_fits_cut_SPOC_0/img_0001.fits contains no data and will not be written.
warnings.warn(f"Cutout of {fle} contains no data and will not be written.",
.tox/test/lib/python3.11/site-packages/astrocut/tests/test_cutouts.py::test_fits_cut[TICA]
/host/.tox/test/lib/python3.11/site-packages/astrocut/cutouts.py:360: DataWarning: Cutout of /tmp/pytest-of-root/pytest-57/test_fits_cut_TICA_0/img_0000.fits contains no data and will not be written.
warnings.warn(f"Cutout of {fle} contains no data and will not be written.",
.tox/test/lib/python3.11/site-packages/astrocut/tests/test_cutouts.py::test_fits_cut[TICA]
/host/.tox/test/lib/python3.11/site-packages/astrocut/cutouts.py:360: DataWarning: Cutout of /tmp/pytest-of-root/pytest-57/test_fits_cut_TICA_0/img_0001.fits contains no data and will not be written.
warnings.warn(f"Cutout of {fle} contains no data and will not be written.",
.tox/test/lib/python3.11/site-packages/astrocut/tests/test_make_cube.py: 11 warnings
/host/.tox/test/lib/python3.11/site-packages/_pytest/python.py:194: DeprecationWarning: `alltrue` is deprecated as of NumPy 1.25.0, and will be removed in NumPy 2.0. Please use `all` instead.
result = testfunction(**testargs)