Skip to content

Commit

Permalink
fix: remove redundant code and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
fjebaker committed Oct 1, 2023
1 parent b503c29 commit a025ad7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 31 deletions.
21 changes: 0 additions & 21 deletions src/datasets/response.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,6 @@ function normalise_rows!(matrix)
end
end

function build_response_matrix!(
R,
f_chan::Matrix,
n_chan::Matrix,
matrix_rows::Vector,
first_channel,
)
for (i, (F, N)) in enumerate(zip(eachcol(f_chan), eachcol(n_chan)))
M = matrix_rows
index = 1
for (first, len) in zip(F, N)
if len == 0
break
end
first -= first_channel
@views R[first+1:first+len, i] .= M[index:index+len-1]
index += len
end
end
end

function Base.show(
io::IO,
::MIME{Symbol("text/plain")},
Expand Down
3 changes: 3 additions & 0 deletions src/fitting/result.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ struct FittingResult{T,K,C} <: AbstractFittingResult
config::C
end

measure(stat::AbstractStatistic, slice::FittingResult, args...) =
measure(stat, slice[1], args...)

function invoke_result(result::FittingResult, u)
@assert length(u) == length(result.u)
_invoke_and_transform!(result.config.cache, result.config.domain, u)
Expand Down
10 changes: 0 additions & 10 deletions src/units.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,6 @@ function __init__()
merge!(Unitful.promotion, localpromotion)
end

function infer_units(s::Symbol)
if s == :rate
u"counts / s"
elseif s == :counts
u"counts"
else
error("Unknown units $s.")
end
end

const _counts = typeof(u"counts")
const _counts_kev = typeof(u"counts / keV")
const _rate = typeof(u"counts / s")
Expand Down

0 comments on commit a025ad7

Please sign in to comment.