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 deprecation warning to qnn module #1170

Merged
merged 12 commits into from
Apr 9, 2021
Merged

Add deprecation warning to qnn module #1170

merged 12 commits into from
Apr 9, 2021

Conversation

trbromley
Copy link
Contributor

Following this PR #1162 and this issue #1101, we would like to prevent the qnn module from being imported with PL because it also causes TF and Torch to be imported. This is a breaking change for users of KerasLayer and TorchLayer, and we will provide a deprecation warning for one release cycle before making the change.

@codecov
Copy link

codecov bot commented Mar 25, 2021

Codecov Report

Merging #1170 (0c73a74) into master (5645fd2) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1170   +/-   ##
=======================================
  Coverage   98.12%   98.12%           
=======================================
  Files         145      145           
  Lines       10971    10980    +9     
=======================================
+ Hits        10765    10774    +9     
  Misses        206      206           
Impacted Files Coverage Δ
pennylane/qnn/cost.py 100.00% <100.00%> (ø)
pennylane/qnn/keras.py 97.05% <100.00%> (+0.13%) ⬆️
pennylane/qnn/torch.py 96.87% <100.00%> (+0.15%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5645fd2...0c73a74. Read the comment docs.

@trbromley
Copy link
Contributor Author

This is a case where I don't understand what's going on with codecov 😞

Copy link
Member

@co9olguy co9olguy left a comment

Choose a reason for hiding this comment

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

Thanks @trbromley 👍

I left two suggestions, one about the deprecation string (I don't think what you wrote would actually be accepted by interpreter, and also suggesting a shorter form), and one question/idea about testing

pennylane/qnn/cost.py Outdated Show resolved Hide resolved
.github/CHANGELOG.md Outdated Show resolved Hide resolved
pennylane/qnn/keras.py Outdated Show resolved Hide resolved
pennylane/qnn/torch.py Outdated Show resolved Hide resolved
tests/qnn/test_cost.py Show resolved Hide resolved
@trbromley trbromley requested a review from co9olguy April 8, 2021 15:18
Copy link
Contributor Author

@trbromley trbromley left a comment

Choose a reason for hiding this comment

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

Thanks @co9olguy for the suggestions!

.github/CHANGELOG.md Outdated Show resolved Hide resolved
pennylane/qnn/cost.py Outdated Show resolved Hide resolved
tests/qnn/test_cost.py Show resolved Hide resolved
@trbromley
Copy link
Contributor Author

The coverage checks seem to be failing because of the __str__ method:
image

@josh146, if this is just a case of codecov being bad (I think we discussed this a while back in the context of #1162), would you mind merging in?

@josh146
Copy link
Member

josh146 commented Apr 9, 2021

@trbromley seems to be working today 🤔 Just needed master to be merged in

image

@josh146 josh146 merged commit 816885a into master Apr 9, 2021
@josh146 josh146 deleted the deprecate_qnn_import branch April 9, 2021 07:36
trbromley added a commit that referenced this pull request Apr 16, 2021
trbromley added a commit that referenced this pull request Apr 19, 2021
josh146 pushed a commit that referenced this pull request Apr 19, 2021
josh146 added a commit that referenced this pull request May 6, 2021
* Revert "Add deprecation warning to qnn module (#1170)"

This reverts commit 816885a.

* Remove Python 3.6 and add 3.9

* Add lazy loading

* Add tests

* Add to changelog

* Mention 3.9

* Update CI

* Add to docs

* Fix

* Fix note

* Allow importing of module

* Change order

* Change back

* Update test

* Fix

* full stop

* black

* Apply suggestions from code review

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

Co-authored-by: Josh Izaac <josh146@gmail.com>
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