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

Reduce DeprecationWarnings in Testing #477

Closed
cyschneck opened this issue Sep 21, 2023 · 9 comments · Fixed by #582
Closed

Reduce DeprecationWarnings in Testing #477

cyschneck opened this issue Sep 21, 2023 · 9 comments · Fixed by #582
Assignees
Labels
testing Issue related to testing

Comments

@cyschneck
Copy link
Contributor

cyschneck commented Sep 21, 2023

Describe the feature you'd like added to this project
Existing tests have a number of warnings being thrown due to DeprecationWarning and UserWarnings and some clean up for reducing redirects and refreshing docs

Describe the solution you'd like
Updated scripts to account for deprecation warnings for using setup.py as well as warnings associated with redirecting links in the docs
Test scripts will continue to throw warnings associated with dask data.chunks, heat_index, and interpolation out of bounds, since these will be handled in upcoming issues (#593 and #596)

@cyschneck cyschneck added low priority testing Issue related to testing labels Sep 21, 2023
@cyschneck cyschneck self-assigned this Sep 21, 2023
@cyschneck
Copy link
Contributor Author

Revisit DeprecationWarnings after #483 completed

@cyschneck
Copy link
Contributor Author

cyschneck commented Feb 6, 2024

test_climatologies.py (87 passed, 2 warnings in 33.44s)

Outside packages:

python3.11/site-packages/xskillscore/__init__.py:2: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
    from pkg_resources import DistributionNotFound, get_distribution

Internal Packages:

python3.11/site-packages/pkg_resources/__init__.py:2868: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('geocat')`.
  Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
    declare_namespace(pkg)

@cyschneck
Copy link
Contributor Author

cyschneck commented Feb 6, 2024

test_interpolation.py (25 passed, 19 warnings in 13.97s)

  • interpolation.py DeprecationWarning for dimension-order tuples
  • interpolation.py UserWarning interpolation out of data bounds

External Packages:

dataarray.py:6156: DeprecationWarning: Behaviour of argmin/argmax with neither dim nor axis argument will change to return a dict of indices of each dimension. To get a single, flat index, please use np.argmin(da.data) or np.argmax(da.data) instead of da.argmin() or da.argmax().
    result = self.variable.argmax(dim, axis, keep_attrs, skipna)

Internal Packages:

interpolation.py:470: DeprecationWarning: Supplying chunks as dimension-order tuples is deprecated. It will raise an error in the future. Instead use a dict with dimension names as keys.
    pressure = pressure.chunk(data.chunks)
interpolation.py:133: UserWarning: Interpolation point out of data bounds encountered
    return func_interpolate(new_levels, xcoords, data, axis=interp_axis)

@cyschneck
Copy link
Contributor Author

test_meteorology.py (78 passed, 3 warnings in 10.94s)

  • meteorology.py RunTime invalid sqrt

External Packages:

python3.11/site-packages/xarray/core/computation.py:822: RuntimeWarning: invalid value encountered in sqrt
    result_data = func(*input_data)
site-packages/dask/core.py:127: RuntimeWarning: invalid value encountered in sqrt
    return func(*(_execute_task(a, cache) for a in args))

Internal Packages:

meteorology.py:125: RuntimeWarning: invalid value encountered in sqrt
    heatindex - ((13 - relative_humidity) / 4) * np.sqrt(

@cyschneck
Copy link
Contributor Author

cyschneck commented Feb 6, 2024

test_gradient.py (7 passed, 3 warnings in 10.89s)

  • test_gradient_xr RuntimeWarning

Internal Packages:

test/test_gradient.py::Test_Gradient::test_gradient_xr
  <frozen importlib._bootstrap>:241: RuntimeWarning: numpy.ndarray size changed, may indicate binary incompatibility. Expected 16 from C header, got 96 from PyObject

@cyschneck
Copy link
Contributor Author

test_stats.py (24 passed, 21 warnings in 7.83s)

  • eofunc will be deprecated
  • test_01 RuntimeWarning numpy array size changed
  • eofunc_ts will be deprecated soon (replace with eofunc_pcs)

Internal Packages:

stats.py:401: PendingDeprecationWarning: eofunc will be deprecated soon in a future version and may not currently generate proper results for some of its arguments including `pcrit`, `jopt=correlation`, and 'missing_value' other than np.nan. The output  and its attributes may thus not be as expected, too. Use `eofunc_eofs` instead.
    warnings.warn(
t_stats.py::Test_eof_ts::test_01
  <frozen importlib._bootstrap>:241: RuntimeWarning: numpy.ndarray size changed, may indicate binary incompatibility. Expected 16 from C header, got 96 from PyObject
stats.py:419: PendingDeprecationWarning: eofunc_ts will be deprecated soon in a future version and may not currently generate proper results for some of its arguments including `evec`, `jopt=correlation`, and 'missing_value' other than np.nan. The output  and its attributes may thus not be as expected, too. Use `eofunc_pcs` instead.
    warnings.warn(

External Packages:

python3.11/site-packages/eofs/xarray.py:130: DeprecationWarning: `product` is deprecated as of NumPy 1.25.0, and will be removed in NumPy 2.0. Please use `prod` instead.
    self._solver = standard.Eof(array.data,
python3.11/site-packages/eofs/xarray.py:130: DeprecationWarning: `product` is deprecated as of NumPy 1.25.0, and will be removed in NumPy 2.0. Please use `prod` instead.
    self._solver = standard.Eof(array.data,

@cyschneck
Copy link
Contributor Author

CI.yml link checker

  contrib: line   51) broken    https://stackoverflow.com/help/minimal-reproducible-example - 403 Client Error: Forbidden for url: https://stackoverflow.com/help/minimal-reproducible-example
2024-02-16T00:06:50.6539501Z looking for now-outdated files... /home/runner/work/geocat-comp/geocat-comp/docs/release-notes.rst:23: WARNING: Title underline too short.
2024-02-16T00:06:50.6543193Z /home/runner/work/geocat-comp/geocat-comp/docs/release-notes.rst:23: WARNING: Title underline too short.
2024-02-16T00:07:49.5980038Z checking consistency... /home/runner/work/geocat-comp/geocat-comp/docs/_build/jupyter_execute/_build/jupyter_execute/examples/calendar_average.ipynb: WARNING: document isn't included in any toctree
2024-02-16T00:07:49.5984842Z /home/runner/work/geocat-comp/geocat-comp/docs/_build/jupyter_execute/_build/jupyter_execute/examples/climatology_average.ipynb: WARNING: document isn't included in any toctree
2024-02-16T00:07:49.5989272Z /home/runner/work/geocat-comp/geocat-comp/docs/_build/jupyter_execute/_build/jupyter_execute/examples/fourier_filter.ipynb: WARNING: document isn't included in any toctree
2024-02-16T00:07:49.5992249Z /home/runner/work/geocat-comp/geocat-comp/docs/_build/jupyter_execute/_build/jupyter_execute/examples/vimfc.ipynb: WARNING: document isn't included in any toctree
2024-02-16T00:07:49.5993788Z /home/runner/work/geocat-comp/geocat-comp/docs/_build/jupyter_execute/examples/calendar_average.ipynb: WARNING: document isn't included in any toctree
2024-02-16T00:07:49.5995278Z /home/runner/work/geocat-comp/geocat-comp/docs/_build/jupyter_execute/examples/climatology_average.ipynb: WARNING: document isn't included in any toctree
2024-02-16T00:07:49.5996774Z /home/runner/work/geocat-comp/geocat-comp/docs/_build/jupyter_execute/examples/fourier_filter.ipynb: WARNING: document isn't included in any toctree
2024-02-16T00:07:49.5998177Z /home/runner/work/geocat-comp/geocat-comp/docs/_build/jupyter_execute/examples/vimfc.ipynb: WARNING: document isn't included in any toctree

@cyschneck
Copy link
Contributor Author

CI Upstream

test/test_stats.py::Test_pearson_r::test_keep_attrs PASSED               [100%]/home/runner/micromamba/envs/geocat_comp_build/lib/python3.11/site-packages/coverage/control.py:887: CoverageWarning: No data was collected. (no-data-collected)
2024-02-16T00:22:45.6079842Z   self._warn("No data was collected.", slug="no-data-collected")
/home/runner/micromamba/envs/geocat_comp_build/lib/python3.11/site-packages/geocat/comp/interpolation.py:470: DeprecationWarning: Supplying chunks as dimension-order tuples is deprecated. It will raise an error in the future. Instead use a dict with dimension names as keys. (pressure = pressure.chunk(data.chunks)
/home/runner/micromamba/envs/geocat_comp_build/lib/python3.11/site-packages/geocat/comp/interpolation.py:133: UserWarning: Interpolation point out of data bounds encountered
2024-02-16T00:22:45.6946236Z     return func_interpolate(new_levels, xcoords, data, axis=interp_axis)
/home/runner/micromamba/envs/geocat_comp_build/lib/python3.11/site-packages/xarray/core/dataarray.py:6149: DeprecationWarning: Behaviour of argmin/argmax with neither dim nor axis argument will change to return a dict of indices of each dimension. To get a single, flat index, please use np.argmin(da.data) or np.argmax(da.data) instead of da.argmin() or da.argmax().
2024-02-16T00:22:45.6957710Z     result = self.variable.argmax(dim, axis, keep_attrs, skipna)
/home/runner/micromamba/envs/geocat_comp_build/lib/python3.11/site-packages/geocat/comp/meteorology.py:125: RuntimeWarning: invalid value encountered in sqrt
2024-02-16T00:22:45.6965745Z     heatindex - ((13 - relative_humidity) / 4) * np.sqrt(
/home/runner/micromamba/envs/geocat_comp_build/lib/python3.11/site-packages/xarray/core/computation.py:825: RuntimeWarning: invalid value encountered in sqrt
2024-02-16T00:22:45.6970418Z     result_data = func(*input_data
/home/runner/micromamba/envs/geocat_comp_build/lib/python3.11/site-packages/eofs/xarray.py:130: DeprecationWarning: `product` is deprecated as of NumPy 1.25.0, and will be removed in NumPy 2.0. Please use `prod` instead.
test/test_stats.py::Test_eof::test_eof_deprecated
2024-02-16T00:22:45.6982489Z   /home/runner/micromamba/envs/geocat_comp_build/lib/python3.11/site-packages/geocat/comp/stats.py:401: PendingDeprecationWarning: eofunc will be deprecated soon in a future version and may not currently generate proper results for some of its arguments including `pcrit`, `jopt=correlation`, and 'missing_value' other than np.nan. The output  and its attributes may thus not be as expected, too. Use `eofunc_eofs` instead.
test/test_stats.py::Test_eof_ts::test_01_deprecated
2024-02-16T00:22:45.6990003Z   /home/runner/micromamba/envs/geocat_comp_build/lib/python3.11/site-packages/geocat/comp/stats.py:419: PendingDeprecationWarning: eofunc_ts will be deprecated soon in a future version and may not currently generate proper results for some of its arguments including `evec`, `jopt=correlation`, and 'missing_value' other than np.nan. The output  and its attributes may thus not be as expected, too. Use `eofunc_pcs` instead.

@cyschneck
Copy link
Contributor Author

Upload geocat-comp to PyPi

Newline warning

2024-01-30T21:03:06.4652795Z /opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/setuptools/dist.py:160: UserWarning: newlines not allowed and will break in the future
2024-01-30T21:03:06.4654709Z   warnings.warn("newlines not allowed and will break in the future")
2024-01-30T21:03:06.4658101Z Writing geocat.comp-2024.1.0/setup.cfg
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
2024-01-30T21:03:06.5753553Z   warnings.warn(

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

Successfully merging a pull request may close this issue.

2 participants