Skip to content

pre-commit autoupdate #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-merge-conflict
- id: check-toml
Expand All @@ -9,6 +9,6 @@ repos:
exclude_types: [markdown] # incompatible with Literate.jl

- repo: "https://github.com/domluna/JuliaFormatter.jl"
rev: v1.0.62
rev: v2.1.0
hooks:
- id: "julia-formatter"
7 changes: 2 additions & 5 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@ using BlockSparseArrays: BlockSparseArrays
using Documenter: Documenter, DocMeta, deploydocs, makedocs

DocMeta.setdocmeta!(
BlockSparseArrays,
:DocTestSetup,
quote
BlockSparseArrays, :DocTestSetup, quote
using BlockSparseArrays
using LinearAlgebra: Diagonal
end;
recursive=true,
end; recursive=true
)

include("make_index.jl")
Expand Down
15 changes: 9 additions & 6 deletions src/blocksparsearrayinterface/blocksparsearrayinterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@

struct BlockSparseArrayInterface <: AbstractBlockSparseArrayInterface end

@interface ::AbstractBlockSparseArrayInterface BlockArrays.blocks(a::AbstractArray) =
error("Not implemented")
@interface ::AbstractBlockSparseArrayInterface BlockArrays.blocks(a::AbstractArray) = error(

Check warning on line 100 in src/blocksparsearrayinterface/blocksparsearrayinterface.jl

View check run for this annotation

Codecov / codecov/patch

src/blocksparsearrayinterface/blocksparsearrayinterface.jl#L100

Added line #L100 was not covered by tests
"Not implemented"
)

@interface ::AbstractBlockSparseArrayInterface function SparseArraysBase.isstored(
a::AbstractArray{<:Any,N}, I::Vararg{Int,N}
Expand Down Expand Up @@ -336,10 +337,12 @@
reverse_index(index) = reverse(index)
reverse_index(index::CartesianIndex) = CartesianIndex(reverse(Tuple(index)))

@interface ::AbstractBlockSparseArrayInterface BlockArrays.blocks(a::Transpose) =
transpose(blocks(parent(a)))
@interface ::AbstractBlockSparseArrayInterface BlockArrays.blocks(a::Adjoint) =
adjoint(blocks(parent(a)))
@interface ::AbstractBlockSparseArrayInterface BlockArrays.blocks(a::Transpose) = transpose(
blocks(parent(a))
)
@interface ::AbstractBlockSparseArrayInterface BlockArrays.blocks(a::Adjoint) = adjoint(
blocks(parent(a))
)

# Represents the array of arrays of a `SubArray`
# wrapping a block spare array, i.e. `blocks(array)` where `a` is a `SubArray`.
Expand Down
3 changes: 2 additions & 1 deletion src/factorizations/svd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,9 @@ julia> Uonly == U
true
```
"""
svd(A; kwargs...) =
function svd(A; kwargs...)
SVD(svd!(eigencopy_oftype(A, LinearAlgebra.eigtype(eltype(A))); kwargs...))
end

LinearAlgebra.svdvals(usv::SVD{<:Any,T}) where {T} = (usv.S)::AbstractVector{T}

Expand Down
6 changes: 4 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ const GROUP = uppercase(
)

"match files of the form `test_*.jl`, but exclude `*setup*.jl`"
istestfile(fn) =
function istestfile(fn)
endswith(fn, ".jl") && startswith(basename(fn), "test_") && !contains(fn, "setup")
end
"match files of the form `*.jl`, but exclude `*_notest.jl` and `*setup*.jl`"
isexamplefile(fn) =
function isexamplefile(fn)
endswith(fn, ".jl") && !endswith(fn, "_notest.jl") && !contains(fn, "setup")
end

@time begin
# tests in groups based on folder structure
Expand Down
8 changes: 4 additions & 4 deletions test/test_basics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,11 @@ arrayts = (Array, JLArray)
@test Array(a) isa Array{elt,0}
@test Array(a) == fill(0)
for b in (
(b = copy(a); @allowscalar(b[] = 2); b),
(b = copy(a); @allowscalar(b[CartesianIndex()] = 2); b),
(b = copy(a); @allowscalar(b[Block()[]] = 2); b),
(b=copy(a); @allowscalar(b[] = 2); b),
(b=copy(a); @allowscalar(b[CartesianIndex()] = 2); b),
(b=copy(a); @allowscalar(b[Block()[]] = 2); b),
# Regression test for https://github.com/ITensor/BlockSparseArrays.jl/issues/27.
(b = copy(a); b[Block()] = dev(fill(2)); b),
(b=copy(a); b[Block()]=dev(fill(2)); b),
)
@test size(b) == ()
@test isone(length(b))
Expand Down
Loading