Skip to content

Commit

Permalink
Merge pull request #111 from fhagemann/downgrade
Browse files Browse the repository at this point in the history
Add Downgrade CI and update lower package compats
  • Loading branch information
theHenks authored Dec 19, 2024
2 parents 1fb1d15 + a5f7cb3 commit 31ab269
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 31 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/Downgrade.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Downgrade
on:
pull_request:
branches:
- main
- dev
paths-ignore:
- 'docs/**'
push:
branches:
- main
- dev
paths-ignore:
- 'docs/**'
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
version: ['1.10', '1', 'pre']
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
- name: Add LegendJuliaRegistry
run: julia -e 'using Pkg; Pkg.Registry.add("General"); Pkg.Registry.add(Pkg.RegistrySpec(url = "https://github.com/legend-exp/LegendJuliaRegistry"))'
shell: bash
- uses: julia-actions/julia-downgrade-compat@v1
with:
skip: Pkg,TOML
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
54 changes: 27 additions & 27 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,44 +53,44 @@ LegendSpecFitsRecipesBaseExt = ["RecipesBase", "Plots"]

[compat]
ArgCheck = "1, 2"
ArraysOfArrays = "0.6"
BAT = "3"
ChangesOfVariables = "0.1.1"
ArraysOfArrays = "0.5, 0.6"
BAT = "3.1"
ChangesOfVariables = "0.1.3"
DensityInterface = "0.4"
Distributions = "0.24, 0.25"
FillArrays = "0.7, 0.8, 0.9, 0.10, 0.11, 0.12, 0.13, 1"
Distributions = "0.25.87"
FillArrays = "1.4.1"
Format = "1.2, 1.3"
ForwardDiff = "0.10"
ForwardDiff = "0.10.26"
GaussianMixtures = "0.3.11"
IntervalSets = "0.7"
InverseFunctions = "0.1"
IrrationalConstants = "0.1, 0.2"
KernelDensity = "0.5, 0.6"
InverseFunctions = "0.1.8"
IrrationalConstants = "0.1.1, 0.2"
KernelDensity = "0.6.4"
LaTeXStrings = "1.3"
LogExpFunctions = "0.3"
LinearAlgebra = "1"
LogExpFunctions = "0.3.16"
LinearAlgebra = "<0.0.1, 1"
LinearRegression = "0.2"
LsqFit = "0.14, 0.15"
Measurements = "2"
Measurements = "2.5"
Measures = "0.3"
Optim = "1"
Optimization = "3, 4"
OptimizationBBO = "0.3"
OptimizationNLopt = "0.2"
OptimizationOptimJL = "0.3"
Optim = "1.7.5"
Optimization = "3.25, 4"
OptimizationBBO = "0.3, 0.4"
OptimizationNLopt = "0.2, 0.3"
OptimizationOptimJL = "0.3, 0.4"
Plots = "1"
PropDicts = "0.2"
RadiationSpectra = "0.5.12"
Random = "1"
RecipesBase = "1"
Random = "<0.0.1, 1"
RecipesBase = "1.3.4"
Roots = "2"
SnoopPrecompile = "1"
SpecialFunctions = "0.10, 1, 2"
Statistics = "1"
StatsBase = "0.32, 0.33, 0.34"
StructArrays = "0.4, 0.5, 0.6, 0.7"
Tables = "0.2, 1.0"
TypedTables = "1"
Unitful = "1"
ValueShapes = "0.10.1, 0.11"
SpecialFunctions = "2.1.4"
Statistics = "<0.0.1, 1"
StatsBase = "0.33.7, 0.34"
StructArrays = "0.6.17, 0.7"
Tables = "1.11"
TypedTables = "1.2"
Unitful = "1.6"
ValueShapes = "0.10.13, 0.11"
julia = "1.10"
6 changes: 3 additions & 3 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"

[compat]
Distributions = "0.24, 0.25"
Distributions = "0.25"
Documenter = "1"
Interpolations = "0.15"
Interpolations = "0.13, 0.14, 0.15"
LegendDataTypes = "0.1"
Measurements = "2"
StatsBase = "0.32, 0.33, 0.34"
StatsBase = "0.33, 0.34"
Unitful = "1"
6 changes: 5 additions & 1 deletion test/test_utils.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# This file is a part of LegendSpecFits.jl, licensed under the MIT License (MIT).

using Interpolations: Throw, extrapolate, interpolate, Gridded, Linear
_linear_interpolation(range::AbstractVector, vs::AbstractVector; extrapolation_bc = Throw()) =
extrapolate(interpolate((range, ), vs, Gridded(Linear())), extrapolation_bc)

"""
generate_mc_spectrum(n_tot::Int=200000,; f_fit::Base.Callable=th228_fit_functions.f_fit)
Sample Legend200 calibration data based on "Inverse Transform Sampling" method
Expand Down Expand Up @@ -53,7 +57,7 @@ function generate_mc_spectrum(n_tot::Int=200000,; f_fit::Base.Callable=LegendSpe
for i=1:length(th228_lines)
bandwidth = maximum(model_cdf_all[i])-minimum(model_cdf_all[i])
rand_i = minimum(model_cdf_all[i]).+bandwidth.*rand(n_i[i]); # make sure sample is within model range
interp_cdf_inv = linear_interpolation(model_cdf_all[i], bin_centers_all[i]) # inverse cdf
interp_cdf_inv = _linear_interpolation(model_cdf_all[i], bin_centers_all[i]) # inverse cdf
energy_mc_all[i] = interp_cdf_inv.(rand_i)
end

Expand Down

0 comments on commit 31ab269

Please sign in to comment.