-
Notifications
You must be signed in to change notification settings - Fork 32
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
Fully Document BloqadeWaveforms #470
Merged
johnzl-777
merged 12 commits into
master
from
johnzl-777/fully-document-BloqadeWaveforms
Dec 11, 2022
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
1f7ffb9
Added docstrings for sample_clock and sample_values functions in wave…
johnzl-777 a856e90
Added docstrings for piecewise_constant_interpolate in interpolate.jl
johnzl-777 6bb2923
fixed incorrect docstring on min_step purpose in piecewise_constant_i…
johnzl-777 464bd8b
Merge branch 'main' into johnzl-777/fully-document-BloqadeWaveforms
johnzl-777 6c05659
Added docstring unit tests
johnzl-777 a2a544d
Merge branch 'main' into johnzl-777/fully-document-BloqadeWaveforms
johnzl-777 657fc76
Attempt to get exported function docstrings to render via Documenter
johnzl-777 bd2f272
Update Waveform struct docstring to reflect type parameters
johnzl-777 cc3c729
Merge branch 'main' into johnzl-777/fully-document-BloqadeWaveforms
johnzl-777 471f437
Get ALL docstrings for exported items to render via Documenter
johnzl-777 24c621a
Rearrange references for more logical ordering
johnzl-777 1224bf3
Fixed broken slicing operation
johnzl-777 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using BloqadeWaveforms | ||
using Test | ||
|
||
function has_docstring(obj, sig::Type = Union{}) | ||
Docs.getdoc(obj, sig) === nothing || return true | ||
binding = Docs.Binding(parentmodule(obj), nameof(obj)) | ||
for mod in Docs.modules | ||
dict = Docs.meta(mod) | ||
haskey(dict, binding) || continue | ||
multidoc = dict[binding] | ||
for msig in multidoc.order | ||
sig <: msig && return true | ||
end | ||
end | ||
return false | ||
end | ||
|
||
|
||
|
||
@testset "Docstring Present" begin | ||
for symbol in names(BloqadeWaveforms) | ||
|
||
obj = Base.eval(@__MODULE__, :(BloqadeWaveforms.$symbol)) | ||
|
||
typeof(obj) <: Union{Module} && continue | ||
|
||
@testset "$symbol" begin | ||
@test has_docstring(obj) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
using Test | ||
|
||
if "docstring" in ARGS | ||
# include("docstrings.jl") | ||
include("docstrings.jl") | ||
exit() | ||
end | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is nice! wasn't thinking to document this at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made it a goal on my end to prioritize documenting anything that gets exported 😄
This was particularly tricky to document (trying to get the docstring to show) but I got some inspiration looking at the way you documented things in
YaoSubspaceArrayReg
!