vprusso / toqito

|toqito> (Theory of Quantum Information Toolkit) in Python :snake:
https://toqito.readthedocs.io/en/latest/
MIT License
156 stars 61 forks source link

Remove `np.testing` from unit tests #488

Open purva-thakre opened 9 months ago

purva-thakre commented 9 months ago

Based on the discussion in #423, we want to remove all instances of np.testing and switch to using pytest. https://github.com/vprusso/toqito/pull/423#issuecomment-1896441209 has an alternative to comparing two arrays using pytest.

Wherever possible, use parametrize to better organize identical tests in 1 file. https://docs.pytest.org/en/7.3.x/how-to/parametrize.html

Below is an itemized list of the files that require these changes. If you are interested in working on one of these, comment with which item you want to work on. A maintainer will assign that item to you.

Shivansh20128 commented 4 weeks ago

Hey @vprusso , if I want to work on this, do I need to create an issue for each of these? I think the fixes are similar for many of them and I can remove np.testing from many of the test files in a single go. How can I move forward?

vprusso commented 3 weeks ago

Hi @Shivansh20128 ,

I'm wondering whether this issue is actually needed. I'm not particularly convinced that replacing everything with pytest would be the way to go or whether not using np.testing is advantageous. There is also a fair amount of work in doing this, so I wonder whether it's worth the effort.

From doing some more digging, I'm getting the sense that pytest and np.testing are complimentary and I don't personally see the need to shift from one to the other. But as @purva-thakre wrote this issue up, maybe she has some input on the matter that I don't.

Thank you as always for your enthusiasm and interest in working on toqito!

Shivansh20128 commented 3 weeks ago

Okay. Let me know when if its needed.

vprusso commented 3 weeks ago

Okay. Let me know when if its needed.

Will do, @Shivansh20128 !

In the meantime, I'll be putting up some more issues on the board. If you see anything that interests you, or if you have any issues that you think would make toqito better, by all means, put them up on the board! I'm sure given your experience with contributions, you could offer some valuable suggestions!