Skip to content

Commit

Permalink
fix type parameters of welch_pgram! arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
wheeheee committed Apr 26, 2024
1 parent f0434d0 commit 1e7ea7b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/periodograms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -722,13 +722,16 @@ julia> y == power(pxx)
true
```
"""
function welch_pgram!(out::AbstractVector, s::AbstractVector, config::WelchConfig{T}) where T<:Number
function welch_pgram!(out::AbstractVector, s::AbstractVector{T}, config::WelchConfig) where {T<:Number}
if length(out) != length(config.freq)
throw(DimensionMismatch("""Expected `output` to be of length `length(config.freq)`;
got `length(output)` = $(length(out)) and `length(config.freq)` = $(length(config.freq))"""))
elseif eltype(out) != fftabs2type(T)
throw(ArgumentError("Eltype of output ($(eltype(out))) doesn't match the expected "*
throw(ArgumentError("Eltype of output ($(eltype(out))) doesn't match the expected " *
"type: $(fftabs2type(T))."))
elseif float(T) != eltype(config.inbuf)
throw(ArgumentError("float(eltype(s)) = $T doesn't match the expected `config` " *

Check warning on line 733 in src/periodograms.jl

View check run for this annotation

Codecov / codecov/patch

src/periodograms.jl#L733

Added line #L733 was not covered by tests
"type: $(eltype(config.inbuf))."))
end
welch_pgram_helper!(out, s, config)
end
Expand Down

0 comments on commit 1e7ea7b

Please sign in to comment.