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

Fix deprecation warnings on tests. #84

Closed
ambarb opened this issue Sep 2, 2022 · 6 comments
Closed

Fix deprecation warnings on tests. #84

ambarb opened this issue Sep 2, 2022 · 6 comments

Comments

@ambarb
Copy link
Contributor

ambarb commented Sep 2, 2022

tests/test_image.py::test_images_mean
  /nsls2/users/abarbour/Repos/csxtools/tests/test_image.py:85: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
    x = np.array([np.repeat(ii*np.ones(ii*100, dtype=np.float32), 400).reshape(

tests/test_image.py::test_images_sum
  /nsls2/users/abarbour/Repos/csxtools/tests/test_image.py:92: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
    x = np.array([np.repeat(ii*np.ones(ii*100, dtype=np.float32), 400).reshape(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
@ambarb
Copy link
Contributor Author

ambarb commented Dec 15, 2022

code to generate:

python setup.py develop
pip install pytest coverage setuptools
python run_tests.py
coverage run run_tests.py 
coverage report -m

@danielballan would love to pair code to resolve this with csxtools upgrade (and likely address the same issues in the python modules)

most recent documentation of errors in the PR #83

@ambarb
Copy link
Contributor Author

ambarb commented Nov 3, 2023

this seems broken with numpy version 1.24.4 and integrated CI from GHA
#92 (review)

once unit test passes, check https://github.com/NSLS-II-CSX/csxtools/blob/master/requirements.txt to make sure that we enforce the earliest version that is compatible

@ambarb
Copy link
Contributor Author

ambarb commented Nov 8, 2023

deprecation warnings are present (but unit tests maybe pass) for
conda env 2023-1.2-py39-tiled
numpy.__version__ = '1.23.5'

@padraic-shafer
Copy link
Contributor

This appears to no longer be an issue with conda env 2023-1.2-py39-tiled
https://github.com/padraic-shafer/csxtools/actions/runs/9183958306/job/25255505812

I've added PR #96 so that the unit tests for csxtools can run on recent conda environments when changes get pushed.

@ambarb
Copy link
Contributor Author

ambarb commented May 23, 2024

great. should we close the now?

@padraic-shafer
Copy link
Contributor

That works for me.

@ambarb ambarb closed this as completed May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants