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

Update tests and remove deprecation warning from MatPlotLib #59

Open
pirmink opened this issue Nov 13, 2024 · 0 comments
Open

Update tests and remove deprecation warning from MatPlotLib #59

pirmink opened this issue Nov 13, 2024 · 0 comments

Comments

@pirmink
Copy link
Collaborator

pirmink commented Nov 13, 2024

  • PyFlexPlot version: 2.0.1
  • Python version: 3.10.15
  • Operating System: Linux

Description

poetry run pytest runs test with partially outdated input data stemming from Flexpart based on deprecated COSMO models. Instead, test should use Flexpart output based on ICON models. In addition, pytest issues a number of warnings. The deprecation warning from matplotlib needs to be fixed to allow an update of the dependencies.

The other warning have been ignored so far as the code was intentionally written this way. Still, it would be nice if it could be coded in a way that does not trigger a pytest warning.

======================================================================================================= warnings summary ========================================================================================================
tests/slow/test_pyflexplot/test_plots/test_cosmo-1.py: 5 warnings
tests/slow/test_pyflexplot/test_plots/test_cosmo-1e-ctrl.py: 10 warnings
tests/slow/test_pyflexplot/test_plots/test_cosmo-2e.py: 7 warnings
tests/slow/test_pyflexplot/test_plots/test_cosmo-e.py: 6 warnings
tests/slow/test_pyflexplot/test_plots/test_ifs-hres-eu.py: 3 warnings
tests/slow/test_pyflexplot/test_plots/test_ifs-hres.py: 4 warnings
tests/slow/test_pyflexplot/test_plots/test_shape-files.py: 1 warning
  /scratch/mch/kaufmann/src/pyflexplot/src/pyflexplot/plotting/boxed_plot.py:341: MatplotlibDeprecationWarning: The collections attribute was deprecated in Matplotlib 3.8 and will be removed two minor releases later.
    for contour in contours.collections:

tests/slow/test_pyflexplot/test_plots/test_cosmo-1e-ctrl.py::Test_TotalDeposition_MissingField::test
tests/slow/test_pyflexplot/test_plots/test_cosmo-1e-ctrl.py::Test_TotalDeposition_MissingField::test
tests/slow/test_pyflexplot/test_plots/test_cosmo-1e-ctrl.py::Test_TotalDeposition_MultiPanelTime::test
tests/slow/test_pyflexplot/test_plots/test_cosmo-1e-ctrl.py::Test_TotalDeposition_MultiPanelTime::test
tests/slow/test_pyflexplot/test_plots/test_ifs-hres-eu.py::Test_TotalDeposition::test
tests/slow/test_pyflexplot/test_plots/test_ifs-hres-eu.py::Test_TotalDeposition::test
tests/slow/test_pyflexplot/test_plots/test_ifs-hres.py::Test_TotalDeposition_EmptyField::test
tests/slow/test_pyflexplot/test_plots/test_ifs-hres.py::Test_TotalDeposition_EmptyField::test
  /scratch/mch/kaufmann/src/pyflexplot/src/pyflexplot/input/field.py:46: RuntimeWarning: All-NaN slice encountered
    "nanmin_nonzero": np.nanmin(np.where(self.fld == 0, np.nan, self.fld)),

tests/slow/test_pyflexplot/test_plots/test_cosmo-1e-ctrl.py::Test_TotalDeposition_MissingField::test
tests/slow/test_pyflexplot/test_plots/test_cosmo-1e-ctrl.py::Test_TotalDeposition_MissingField::test
tests/slow/test_pyflexplot/test_plots/test_cosmo-1e-ctrl.py::Test_TotalDeposition_MultiPanelTime::test
tests/slow/test_pyflexplot/test_plots/test_cosmo-1e-ctrl.py::Test_TotalDeposition_MultiPanelTime::test
tests/slow/test_pyflexplot/test_plots/test_ifs-hres-eu.py::Test_TotalDeposition::test
tests/slow/test_pyflexplot/test_plots/test_ifs-hres-eu.py::Test_TotalDeposition::test
tests/slow/test_pyflexplot/test_plots/test_ifs-hres.py::Test_TotalDeposition_EmptyField::test
tests/slow/test_pyflexplot/test_plots/test_ifs-hres.py::Test_TotalDeposition_EmptyField::test
  /scratch/mch/kaufmann/src/pyflexplot/src/pyflexplot/input/field.py:47: RuntimeWarning: Mean of empty slice
    "nanmean_nonzero": np.nanmean(

tests/slow/test_pyflexplot/test_plots/test_cosmo-1e-ctrl.py::Test_TotalDeposition_MissingField::test
tests/slow/test_pyflexplot/test_plots/test_cosmo-1e-ctrl.py::Test_TotalDeposition_MissingField::test
tests/slow/test_pyflexplot/test_plots/test_cosmo-1e-ctrl.py::Test_TotalDeposition_MultiPanelTime::test
tests/slow/test_pyflexplot/test_plots/test_cosmo-1e-ctrl.py::Test_TotalDeposition_MultiPanelTime::test
tests/slow/test_pyflexplot/test_plots/test_ifs-hres-eu.py::Test_TotalDeposition::test
tests/slow/test_pyflexplot/test_plots/test_ifs-hres-eu.py::Test_TotalDeposition::test
tests/slow/test_pyflexplot/test_plots/test_ifs-hres.py::Test_TotalDeposition_EmptyField::test
tests/slow/test_pyflexplot/test_plots/test_ifs-hres.py::Test_TotalDeposition_EmptyField::test
  /scratch/mch/kaufmann/src/pyflexplot/src/pyflexplot/input/field.py:50: RuntimeWarning: All-NaN slice encountered
    "nanmedian_nonzero": np.nanmedian(

tests/slow/test_pyflexplot/test_plots/test_cosmo-1e-ctrl.py::Test_TotalDeposition_MissingField::test
tests/slow/test_pyflexplot/test_plots/test_cosmo-1e-ctrl.py::Test_TotalDeposition_MissingField::test
tests/slow/test_pyflexplot/test_plots/test_cosmo-1e-ctrl.py::Test_TotalDeposition_MultiPanelTime::test
tests/slow/test_pyflexplot/test_plots/test_cosmo-1e-ctrl.py::Test_TotalDeposition_MultiPanelTime::test
tests/slow/test_pyflexplot/test_plots/test_ifs-hres-eu.py::Test_TotalDeposition::test
tests/slow/test_pyflexplot/test_plots/test_ifs-hres-eu.py::Test_TotalDeposition::test
tests/slow/test_pyflexplot/test_plots/test_ifs-hres.py::Test_TotalDeposition_EmptyField::test
tests/slow/test_pyflexplot/test_plots/test_ifs-hres.py::Test_TotalDeposition_EmptyField::test
  /scratch/mch/kaufmann/src/pyflexplot/src/pyflexplot/input/field.py:53: RuntimeWarning: All-NaN slice encountered
    "nanmax_nonzero": np.nanmax(np.where(self.fld == 0, np.nan, self.fld)),

tests/slow/test_pyflexplot/test_plots/test_cosmo-2e.py::Test_CloudDepartureTime::test
tests/slow/test_pyflexplot/test_plots/test_cosmo-2e.py::Test_CloudDepartureTime::test
tests/slow/test_pyflexplot/test_plots/test_cosmo-e.py::Test_CloudDepartureTime::test
tests/slow/test_pyflexplot/test_plots/test_cosmo-e.py::Test_CloudDepartureTime::test
tests/slow/test_pyflexplot/test_plots/test_ifs-hres.py::Test_CloudDepartureTime::test
tests/slow/test_pyflexplot/test_plots/test_ifs-hres.py::Test_CloudDepartureTime::test
  /scratch/mch/kaufmann/src/pyflexplot/.conda-env/lib/python3.10/site-packages/numpy/core/fromnumeric.py:88: RuntimeWarning: invalid value encountered in reduce
    return ufunc.reduce(obj, axis, dtype, out, **passkwargs)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
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

1 participant