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

convert parameters to float for serialization #41

Merged
merged 5 commits into from
Dec 9, 2021

Conversation

albi3ro
Copy link
Contributor

@albi3ro albi3ro commented Dec 3, 2021

Upon locally running the PennyLane device suite tests, I was running into errors involving ndarray parameters not being JSON serializable. So I need to extract the value to being a float.

@codecov
Copy link

codecov bot commented Dec 3, 2021

Codecov Report

Merging #41 (d8fe432) into master (95adf71) will decrease coverage by 3.52%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #41      +/-   ##
==========================================
- Coverage   87.81%   84.28%   -3.53%     
==========================================
  Files           5        5              
  Lines         279      280       +1     
==========================================
- Hits          245      236       -9     
- Misses         34       44      +10     
Impacted Files Coverage Δ
pennylane_ionq/device.py 86.86% <100.00%> (-5.99%) ⬇️
pennylane_ionq/api_client.py 91.19% <0.00%> (-2.52%) ⬇️

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 95adf71...d8fe432. Read the comment docs.

@albi3ro albi3ro changed the title Unwrap ndarray to make json serializable convert parameters to float for serialization Dec 8, 2021
@albi3ro albi3ro changed the base branch from master to convert_parameters December 9, 2021 12:50
@albi3ro albi3ro merged commit e151308 into PennyLaneAI:convert_parameters Dec 9, 2021
@albi3ro albi3ro deleted the bugfix branch December 9, 2021 12:50
albi3ro added a commit that referenced this pull request Dec 9, 2021
* convert parameters to float for serialization (#41)

* unwrap param, fix ndarray not json serializable

* just cast to float instead.

* warning if circuit empty, error if return with fail

* only one change at a time, tests

* black, code factor

* Add a specific readthedocs yaml

* requirements.txt

* see if pinning numpy works

Co-authored-by: Antal Szava <[email protected]>
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.

1 participant