diff --git a/src/abstract-models.jl b/src/abstract-models.jl index 14066f18..32dbe595 100644 --- a/src/abstract-models.jl +++ b/src/abstract-models.jl @@ -186,13 +186,13 @@ invokemodel(energy, model, p0) ``` """ function invokemodel(e, m::AbstractSpectralModel) - flux = construct_objective_cache(m, e) + flux = construct_objective_cache(m, e) |> vec invokemodel!(flux, e, m) flux end function invokemodel(e, m::AbstractSpectralModel, free_params) model = remake_with_free(m, free_params) - flux = construct_objective_cache(eltype(free_params), m, e) + flux = construct_objective_cache(eltype(free_params), m, e) |> vec invokemodel!(flux, e, model) flux end diff --git a/src/datasets/binning.jl b/src/datasets/binning.jl index 11c8af2d..07006fee 100644 --- a/src/datasets/binning.jl +++ b/src/datasets/binning.jl @@ -1,4 +1,4 @@ -export rebin_flux, make_flux, construct_objective_cache, domain_vector, regroup! +export rebin_flux, construct_objective_cache, regroup! function rebin_flux(flux, current_energy, dest_energy_bins::AbstractVector) downsample_rebin( @@ -51,11 +51,6 @@ function downsample_rebin(input, current_bins, target_bins_high) output end -make_flux(m::AbstractSpectralModel, e::AbstractVector) = make_flux(eltype(e), m, e) -make_flux(T::Type, m::AbstractSpectralModel, e::AbstractVector) = - make_flux(T, length(e) + Δoutput_length(m)) -make_flux(T::Type, n::Int) = zeros(T, n) - construct_objective_cache(model::AbstractSpectralModel, domain::AbstractVector) = construct_objective_cache(preferred_support(model), model, domain) construct_objective_cache(T::Type, model::AbstractSpectralModel, domain::AbstractVector) = construct_objective_cache(preferred_support(model), T, model, domain) construct_objective_cache(layout::AbstractDataLayout, model::AbstractSpectralModel, domain::AbstractVector{T}) where {T} = diff --git a/src/plotting-recipes.jl b/src/plotting-recipes.jl index 9bb9d566..a02d0ffc 100644 --- a/src/plotting-recipes.jl +++ b/src/plotting-recipes.jl @@ -41,24 +41,6 @@ end (x, rate) end -@recipe function _plotting_func(d::SimpleDataset) - seriestype --> :scatter - xscale --> :log10 - yscale --> :log10 - markerstrokewidth --> 0 - xlabel --> "x ($(d.x_units))" - ylabel --> "y ($(d.y_units))" - label --> d.name - if !isnothing(d.x_err) - @views xerr --> d.x_err[1:end-1] - end - if !isnothing(d.y_err) - yerr --> d.y_err - end - minorgrid --> true - @views (d.x[1:end-1], d.y) -end - plotting_domain(dataset::AbstractDataset) = spectrum_energy(dataset) plotting_domain(dataset::InjectiveData) = dataset.domain