-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more fill() constructor functions.
Also: -Improve coverage. -Improve docs. -Add ones() and zeros() constructor functions. -Bump to v0.3.4.
- Loading branch information
1 parent
bba89a7
commit 449b451
Showing
10 changed files
with
275 additions
and
63 deletions.
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
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,77 @@ | ||
#EasyPlot: docstring definitions | ||
#------------------------------------------------------------------------------- | ||
|
||
#== | ||
===============================================================================# | ||
|
||
@doc """`fill(fn::Function d::DataRS, sweeplist)` | ||
Construct a DataRS structure storing results from parametric sweeps using recursive data structures. | ||
# Examples | ||
```julia-repl | ||
signal = fill(DataRS, PSweep("A", [1, 2, 4] .* 1e-3)) do A | ||
fill(DataRS, PSweep("phi", [0, 0.5, 1] .* (π/4))) do 𝜙 | ||
fill(DataRS{DataF1}, PSweep("freq", [1, 4, 16] .* 1e3)) do 𝑓 | ||
𝜔 = 2π*𝑓; T = 1/𝑓 | ||
Δt = T/100 #Define resolution from # of samples per period | ||
Tsim = 4T #Simulated time | ||
t = DataF1(0:Δt:Tsim) #DataF1 creates a t:{y, x} container with y == x | ||
sig = A * sin(𝜔*t + 𝜙) #Still a DataF1 sig:{y, x=t} container | ||
return sig | ||
end; end; end | ||
``` | ||
Note that inner-most sweep needs to specify element type (DataF1). | ||
Other (scalar) element types include: DataInt/DataFloat/DataComplex. | ||
""" Base.fill(::Function, ::Type{DataRS}, args...) | ||
|
||
@doc """`fill(value, [DataRS/DataF1], sweeplist)` | ||
Construct a filled DataRS or DataHR structure with the provided list of parametric sweeps. | ||
# Examples | ||
```julia-repl | ||
sweeplist = PSweep[ | ||
PSweep("A", [1, 2, 4]) | ||
PSweep("freq", [1, 2, 4, 8, 16] .* 1e3) | ||
PSweep("phi", π .* [1/4, 1/3, 1/2]) | ||
] | ||
all32s = fill(32.0, DataRS, sweeplist) | ||
``` | ||
""" Base.fill(::DF1_Num, ::Type{DataMD}, args...) | ||
|
||
@doc """`zeros([DataRS/DataF1], sweeplist)` | ||
Construct a 0.0-filled DataRS or DataHR structure with the provided list of parametric sweeps. | ||
# Examples | ||
```julia-repl | ||
sweeplist = PSweep[ | ||
PSweep("A", [1, 2, 4]) | ||
PSweep("freq", [1, 2, 4, 8, 16] .* 1e3) | ||
PSweep("phi", π .* [1/4, 1/3, 1/2]) | ||
] | ||
all0s = zeros(DataRS, sweeplist) | ||
``` | ||
""" Base.zeros(::Type{DataMD}, args...) | ||
|
||
@doc """`ones([DataRS/DataF1], sweeplist)` | ||
Construct a 1.0-filled DataRS or DataHR structure with the provided list of parametric sweeps. | ||
# Examples | ||
```julia-repl | ||
sweeplist = PSweep[ | ||
PSweep("A", [1, 2, 4]) | ||
PSweep("freq", [1, 2, 4, 8, 16] .* 1e3) | ||
PSweep("phi", π .* [1/4, 1/3, 1/2]) | ||
] | ||
all1s = ones(DataRS, sweeplist) | ||
``` | ||
""" Base.ones(::Type{DataMD}, args...) | ||
|
||
#Last line |
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
Oops, something went wrong.
449b451
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.
@JuliaRegistrator register
Release notes:
Add more fill() constructor functions.
Also:
-Improve coverage.
-Improve docs.
-Add ones() and zeros() constructor functions.
-Bump to v0.3.4.
449b451
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.
Registration pull request created: JuliaRegistries/General/31259
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: