Skip to content

Commit

Permalink
bump version and refine tests (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
Moelf authored Sep 4, 2021
1 parent 4068ac8 commit 8e6af47
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
fail-fast: false
matrix:
version:
- '1.5'
- '1.4'
- '1.3' # Replace this with the minimum Julia version that your package supports. E.g. if your package requires Julia 1.5 or higher, change this to '1.5'.
- '1' # Leave this line unchanged. '1' will automatically expand to the latest stable 1.x release of Julia.
- 'nightly'
Expand All @@ -40,6 +42,8 @@ jobs:
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
env:
JULIA_NUM_THREADS: "3"
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
Expand Down Expand Up @@ -67,4 +71,3 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
JULIA_NUM_THREADS: "3"
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "UnROOT"
uuid = "3cd96dde-e98d-4713-81e9-a4a1b0235ce9"
authors = ["Tamas Gal", "Jerry Ling", "Johannes Schumann", "Nick Amin"]
version = "0.3.7"
version = "0.4.0"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand Down
3 changes: 2 additions & 1 deletion src/UnROOT.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ using Mixers, Parameters, Memoization, LRUCache

import Tables, TypedTables, PrettyTables, DataFrames

@static if VERSION < v"1.4"
@static if VERSION < v"1.6"
Base.first(a::AbstractVector{S}, n::Integer) where S<: AbstractString = a[1:(length(a) > n ? n : end)]
Base.first(a::S, n::Integer) where S<: AbstractString = a[1:(length(a) > n ? n : end)]
end

include("constants.jl")
Expand Down
2 changes: 1 addition & 1 deletion src/iteration.jl
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ mutable struct LazyBranch{T,J,B} <: AbstractVector{T}
return new{T,J,typeof(_buffer)}(f, b, length(b),
b.fBasketEntry,
[_buffer for _ in 1:Threads.nthreads()],
[0:0 for _ in 1:Threads.nthreads()])
[0:-1 for _ in 1:Threads.nthreads()])
end
end

Expand Down
5 changes: 4 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ end
rootfile = ROOTFile(joinpath(SAMPLES_DIR, "issue61.root"))
arr = LazyTree(rootfile,"Events").Jet_pt;
_ = length.(arr);
@test length(arr.buffer[1]) == length(arr.buffer_range[1])
@test length.(arr.buffer) == length.(arr.buffer_range)
close(rootfile)
end

Expand Down Expand Up @@ -522,6 +522,9 @@ end
@test nmu == 878


if get(ENV, "CI", "false") == "true"
@test Threads.nthreads() > 1
end
nmus = zeros(Int, Threads.nthreads())
Threads.@threads for i in 1:length(t)
nmus[Threads.threadid()] += length(t.Muon_pt[i])
Expand Down

2 comments on commit 8e6af47

@Moelf
Copy link
Member Author

@Moelf Moelf commented on 8e6af47 Sep 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

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/44196

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:

git tag -a v0.4.0 -m "<description of version>" 8e6af471c301a725bd10f8b029f19c6fbb92d7ac
git push origin v0.4.0

Please sign in to comment.