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 to use np.allclose and to not use qml.map #129

Merged
merged 1 commit into from
Apr 14, 2023

Conversation

timmysilv
Copy link
Contributor

Two things made tests fails:

  1. tests were using qml.map which creates QNodeCollections. Those are deprecated, and don't work with the new return system
  2. assertAllAlmostEqual has custom logic if the first arg (the qnode result) is a tuple, which they now are with the new return system. Unfortunately, the custom logic is not what we want in the regular case

Solutions:

  1. Stop using QNodeCollection. Sometimes I just return the same observable 6 times, sometimes we don't even need a collection
  2. Just use np.allclose (renaming delta to atol) in those cases because it's what we want anyway

@timmysilv
Copy link
Contributor Author

[sc-35013]

Copy link
Contributor

@rmoyard rmoyard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @timmysilv it looks good to me 👍

Copy link
Contributor

@lillian542 lillian542 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@timmysilv timmysilv merged commit e0811de into master Apr 14, 2023
@timmysilv timmysilv deleted the fix-tests-for-new-return branch April 14, 2023 15:36
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

Successfully merging this pull request may close these issues.

None yet

3 participants