diffpy / diffpy.fourigui

Other
0 stars 7 forks source link

Resolve Pytest 25 warnings #22

Closed bobleesj closed 2 weeks ago

bobleesj commented 1 month ago

25 warnings produced https://github.com/diffpy/diffpy.fourigui/actions/runs/11220139070/job/31187644168

tests/integration_test.py: 7 warnings
tests/unit_test.py: 3 warnings
  /usr/share/miniconda/envs/test/lib/python3.12/site-packages/numpy/lib/_type_check_impl.py:468: DeprecationWarning: __array__ implementation doesn't accept a copy keyword, so passing copy=False failed. __array__ must implement 'dtype' and 'copy' keyword arguments.
    x = _nx.array(x, subok=True, copy=copy)
  /usr/share/miniconda/envs/test/lib/python3.12/site-packages/numpy/fft/_pocketfft.py:892: DeprecationWarning: `axes` should not be `None` if `s` is not `None` (Deprecated in NumPy 2.0). In a future version of NumPy, this will raise an error and `s[i]` will correspond to the size along the transformed axis specified by `axes[i]`. To retain current behaviour, pass a sequence [0, ..., k-1] to `axes` for an array of dimension k.
    return _raw_fftnd(a, s, axes, fft, norm, out=out)

tests/integration_test.py::TestGui::test_load_cube_testdataset1
tests/integration_test.py::TestGui::test_load_cube_testdataset2
tests/integration_test.py::TestGui::test_load_cube_testdataset3
tests/unit_test.py::TestGui::test_load_cube_nothing_loaded
tests/unit_test.py::TestGui::test_load_cube_something_loaded
  /usr/share/miniconda/envs/test/lib/python3.12/site-packages/diffpy/fourigui/fourigui.py:266: DeprecationWarning: __array__ implementation doesn't accept a copy keyword, so passing copy=False failed. __array__ must implement 'dtype' and 'copy' keyword arguments.
...

======================= 18 passed, 25 warnings in 1.92s ========================
cadenmyers13 commented 1 month ago

There is now only 10 warnings. Most warnings are numpy deprecation warnings. The rest are addressed in this PR. Still working out the details.