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

Resolve Warnings in unit tests #101

Open
jaymedina opened this issue Oct 6, 2023 · 1 comment
Open

Resolve Warnings in unit tests #101

jaymedina opened this issue Oct 6, 2023 · 1 comment

Comments

@jaymedina
Copy link
Collaborator

No description provided.

@ecalifornica
Copy link

The numpy warnings are resolved by #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)

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

No branches or pull requests

2 participants