Skip to content

Commit

Permalink
Reset Julia compat to v1.5 (#245)
Browse files Browse the repository at this point in the history
Commit 3c8f501 changed Julia compat to from 1.5 to 1.6, since the join method
used sum with init keyword, which was introduced in Julia 1.6.
However, BioSequences v3.0.0 was released with Julia compat 1.5. Upping Julia
compat in a patch release is not allowed. Hence, the fix from commit 3c8f501
is not applied in any released version.

This commit resets Julia compat to 1.5, and rephrases the join method so it no
longer uses any features not present in Julia 1.5. It has been tested with Julia
v 1.5 and passes.
  • Loading branch information
jakobnissen authored Jul 7, 2022
1 parent 9ec17a2 commit f7ccb6b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Twiddle = "7200193e-83a8-5a55-b20d-5d36d44a0795"
BioSymbols = "5.1.0"
StableRNGs = "0.1, 1.0"
Twiddle = "1.1.1"
julia = "1.6"
julia = "1.5"

[extras]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
4 changes: 2 additions & 2 deletions src/biosequence/biosequence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ end

# Fast path for iterables we know are stateless
function join!(seq::BioSequence, it::Union{Vector, Tuple, Set})
_join!(resize!(seq, sum(joinlen, it, init=0)), it, Val(true))
_join!(resize!(seq, reduce((a, b) -> a + joinlen(b), it, init=0)), it, Val(true))
end

"""
Expand Down Expand Up @@ -155,7 +155,7 @@ TAGAAC
see also [`join!`](@ref)
"""
function Base.join(::Type{T}, it::Union{Vector, Tuple, Set}) where {T <: BioSequence}
_join!(T(undef, sum(joinlen, it, init=0)), it, Val(true))
_join!(T(undef, reduce((a, b) -> a + joinlen(b), it, init=0)), it, Val(true))
end

# length is intentionally not implemented for BioSymbol
Expand Down

2 comments on commit f7ccb6b

@jakobnissen
Copy link
Member Author

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 updated: JuliaRegistries/General/63704

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 v3.0.2 -m "<description of version>" f7ccb6b0de045aa7d80945ce218918b95fd7867d
git push origin v3.0.2

Please sign in to comment.