Skip to content

Commit

Permalink
Add 1.6 to CI (#60)
Browse files Browse the repository at this point in the history
* Add 1.6 to CI

* Fix symbol representation in Julia 1.6

Julia changes the representation of :(.+) to that :.+ != :(.+)!

* Implement ndims for DummyBigInt

* Update ci.yml

* Update Project.toml

* Refactor ndims

Co-authored-by: Benoît Legat <[email protected]>
  • Loading branch information
odow and blegat authored Nov 13, 2020
1 parent a627628 commit e5614c4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
- version: '1'
os: ubuntu-latest
arch: x64
# - version: nightly
# os: ubuntu-latest
# arch: x64
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MutableArithmetics"
uuid = "d8a4904e-b15c-11e9-3269-09a3773c0cb0"
authors = ["Gilles Peiffer", "Benoît Legat", "Sascha Timme"]
version = "0.2.11"
version = "0.2.12"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
13 changes: 8 additions & 5 deletions src/rewrite.jl
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ function _is_decomposable_with_factors(ex)
# incorrect.
return _is_complex_expr(ex) && (
isempty(ex.args) ||
(ex.args[1] != :(.+) && ex.args[1] != :(.-))
(ex.args[1] != :.+ && ex.args[1] != :.-)
)
end

Expand Down Expand Up @@ -331,7 +331,10 @@ function _rewrite(
current_sum === nothing &&
isempty(left_factors) &&
isempty(right_factors) &&
(inner_factor.args[1] == :(.+) || inner_factor.args[1] == :(.-))
(
inner_factor.args[1] == :.+ ||
inner_factor.args[1] == :.-
)
)
)
# There are three cases here:
Expand Down Expand Up @@ -360,13 +363,13 @@ function _rewrite(
push!(code.args, new_code)
start = 3
end
if inner_factor.args[1] == :- || inner_factor.args[1] == :(.-)
if inner_factor.args[1] == :- || inner_factor.args[1] == :.-
minus = !minus
end
vectorized = (
vectorized ||
inner_factor.args[1] == :(.+) ||
inner_factor.args[1] == :(.-)
inner_factor.args[1] == :.+ ||
inner_factor.args[1] == :.-
)
return rewrite_sum(
vectorized,
Expand Down
4 changes: 3 additions & 1 deletion test/dummy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ end
DummyBigInt(J::UniformScaling) = DummyBigInt(J.λ)

# Broadcast
Base.ndims(::Type{DummyBigInt}) = 0
Base.broadcastable(x::DummyBigInt) = Ref(x)
# The version with `DummyBigInt` without `Type` is needed in LinearAlgebra for
# Julia v1.6+.
Base.ndims(::Union{Type{DummyBigInt}, DummyBigInt}) = 0

Base.promote_rule(::Type{DummyBigInt}, ::Type{<:Union{Integer, UniformScaling{<:Integer}}}) = DummyBigInt
# `copy` on BigInt returns the same instance anyway
Expand Down

2 comments on commit e5614c4

@blegat
Copy link
Member

@blegat blegat commented on e5614c4 Nov 13, 2020

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

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.2.12 -m "<description of version>" e5614c478259e70ef1fb71b62e93320550c66ca5
git push origin v0.2.12

Please sign in to comment.