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

Add fixture to skip test if jax is not present #1066

Merged
merged 3 commits into from
Feb 8, 2021

Conversation

trbromley
Copy link
Contributor

I noticed some tests were failing locally for me (without jax installed). I should install jax, but in case anyone else hasn't got it installed, this PR will make sure their tests don't fail.

@trbromley trbromley added the review-ready 👌 PRs which are ready for review by someone from the core team. label Feb 4, 2021
@trbromley trbromley self-assigned this Feb 4, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2021

Hello. You may have forgotten to update the changelog!
Please edit .github/CHANGELOG.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

@codecov
Copy link

codecov bot commented Feb 4, 2021

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.74%. Comparing base (85dd193) to head (5ff3584).
Report is 2661 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1066   +/-   ##
=======================================
  Coverage   97.74%   97.74%           
=======================================
  Files         153      153           
  Lines       11579    11579           
=======================================
  Hits        11318    11318           
  Misses        261      261           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +143 to +147
@pytest.fixture
def skip_if_no_jax_support():
pytest.importorskip("jax")


Copy link
Contributor

Choose a reason for hiding this comment

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

I like that this is simpler, but should we instead match the import pattern used for Torch and TF?

Copy link
Member

Choose a reason for hiding this comment

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

The above were written when I did not know of the existence of importorskip. I think this is simpler, and happy for the above to be rewritten to match.

@chaserileyroberts chaserileyroberts merged commit 2c9f3c8 into master Feb 8, 2021
@chaserileyroberts chaserileyroberts deleted the skip_if_jax_not_present branch February 8, 2021 23:34
@josh146 josh146 added this to the v0.14.1 milestone Feb 10, 2021
josh146 added a commit that referenced this pull request Feb 12, 2021
Co-authored-by: Josh Izaac <josh146@gmail.com>
josh146 added a commit that referenced this pull request Feb 12, 2021
* PR 1082

* PR 1072

* Update vqe.py (#1077)

update `genearate_hamiltonian` refs

* PR 1074

* Add jax skip (#1066)

Co-authored-by: Josh Izaac <josh146@gmail.com>

* update changelog

* update version number

* Apply suggestions from code review

Co-authored-by: Tom Bromley <49409390+trbromley@users.noreply.github.com>
Co-authored-by: antalszava <antalszava@gmail.com>

Co-authored-by: antalszava <antalszava@gmail.com>
Co-authored-by: Tom Bromley <49409390+trbromley@users.noreply.github.com>
josh146 added a commit that referenced this pull request Feb 12, 2021
* PR 1082

* PR 1072

* Update vqe.py (#1077)

update `genearate_hamiltonian` refs

* PR 1074

* Add jax skip (#1066)

Co-authored-by: Josh Izaac <josh146@gmail.com>

* update changelog

* update version number

* Update .github/CHANGELOG.md

Co-authored-by: antalszava <antalszava@gmail.com>
Co-authored-by: Tom Bromley <49409390+trbromley@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review-ready 👌 PRs which are ready for review by someone from the core team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants