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

Better handling of optional arguments #13

Merged
merged 12 commits into from
May 23, 2021
Merged

Better handling of optional arguments #13

merged 12 commits into from
May 23, 2021

Conversation

Sov-trotter
Copy link
Member

@Sov-trotter Sov-trotter commented May 19, 2021

closes #10, #12 & #11

we can have a Qobj specific block here (say Experiment{N} <: AbstractBlock{N}), that takes a ChainBlock and a config and header, then accept a list of them and lower them to Qobj.

This wasn't needed since multiple dispatch made things easier.

Also I had to use @options from IBMQClient to get around this error

@Sov-trotter Sov-trotter changed the title Post-review changes use multiple dispatch for handling optional arguments May 19, 2021
@codecov
Copy link

codecov bot commented May 19, 2021

Codecov Report

Merging #13 (7b448d4) into main (c281f47) will increase coverage by 8.92%.
The diff coverage is 82.22%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #13      +/-   ##
==========================================
+ Coverage   75.00%   83.92%   +8.92%     
==========================================
  Files           1        2       +1     
  Lines          52      112      +60     
==========================================
+ Hits           39       94      +55     
- Misses         13       18       +5     
Impacted Files Coverage Δ
src/qbir.jl 81.69% <81.69%> (ø)
src/qobj.jl 87.80% <84.21%> (+12.80%) ⬆️

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 c281f47...7b448d4. Read the comment docs.

@Sov-trotter Sov-trotter changed the title use multiple dispatch for handling optional arguments Better handling of optional arguments May 19, 2021
Copy link
Member

@Roger-luo Roger-luo left a comment

Choose a reason for hiding this comment

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

FYI. that should be an error at least before 2.0, you must use things Configurations to have the keyword struct syntax. And for web applications, it is usually to use things like Configurations to define a schema for security reason.

src/qobj.jl Outdated Show resolved Hide resolved
src/qobj.jl Outdated Show resolved Hide resolved
src/qobj.jl Outdated Show resolved Hide resolved
src/qobj.jl Outdated Show resolved Hide resolved
src/qobj.jl Outdated Show resolved Hide resolved
src/qobj.jl Show resolved Hide resolved
@Roger-luo
Copy link
Member

also please remember to format the doc strings. For this part you have to do it manually, run JuliaFormatter in this PR before we merge things would also be a good idea.

test/qobjtoqbir.jl Outdated Show resolved Hide resolved
src/qobj.jl Outdated Show resolved Hide resolved
@Roger-luo
Copy link
Member

let's have some more tests to push the covarage above 80% at least.

@Sov-trotter Sov-trotter linked an issue May 21, 2021 that may be closed by this pull request
@Roger-luo
Copy link
Member

nice work! thanks

@Roger-luo Roger-luo merged commit 487b0db into main May 23, 2021
@Roger-luo Roger-luo deleted the formatting branch May 23, 2021 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants