Skip to content

Commit f18b589

Browse files
Automatic JuliaFormatter.jl run (#104)
Co-authored-by: mtfishman <[email protected]>
1 parent 2479af1 commit f18b589

File tree

6 files changed

+25
-22
lines changed

6 files changed

+25
-22
lines changed

Diff for: Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "BlockSparseArrays"
22
uuid = "2c9a651f-6452-4ace-a6ac-809f4280fbb4"
33
authors = ["ITensor developers <[email protected]> and contributors"]
4-
version = "0.4.3"
4+
version = "0.4.4"
55

66
[deps]
77
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

Diff for: docs/make.jl

+2-5
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@ using BlockSparseArrays: BlockSparseArrays
22
using Documenter: Documenter, DocMeta, deploydocs, makedocs
33

44
DocMeta.setdocmeta!(
5-
BlockSparseArrays,
6-
:DocTestSetup,
7-
quote
5+
BlockSparseArrays, :DocTestSetup, quote
86
using BlockSparseArrays
97
using LinearAlgebra: Diagonal
10-
end;
11-
recursive=true,
8+
end; recursive=true
129
)
1310

1411
include("make_index.jl")

Diff for: src/blocksparsearrayinterface/blocksparsearrayinterface.jl

+9-6
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,9 @@ end
9797

9898
struct BlockSparseArrayInterface <: AbstractBlockSparseArrayInterface end
9999

100-
@interface ::AbstractBlockSparseArrayInterface BlockArrays.blocks(a::AbstractArray) =
101-
error("Not implemented")
100+
@interface ::AbstractBlockSparseArrayInterface BlockArrays.blocks(a::AbstractArray) = error(
101+
"Not implemented"
102+
)
102103

103104
@interface ::AbstractBlockSparseArrayInterface function SparseArraysBase.isstored(
104105
a::AbstractArray{<:Any,N}, I::Vararg{Int,N}
@@ -336,10 +337,12 @@ end
336337
reverse_index(index) = reverse(index)
337338
reverse_index(index::CartesianIndex) = CartesianIndex(reverse(Tuple(index)))
338339

339-
@interface ::AbstractBlockSparseArrayInterface BlockArrays.blocks(a::Transpose) =
340-
transpose(blocks(parent(a)))
341-
@interface ::AbstractBlockSparseArrayInterface BlockArrays.blocks(a::Adjoint) =
342-
adjoint(blocks(parent(a)))
340+
@interface ::AbstractBlockSparseArrayInterface BlockArrays.blocks(a::Transpose) = transpose(
341+
blocks(parent(a))
342+
)
343+
@interface ::AbstractBlockSparseArrayInterface BlockArrays.blocks(a::Adjoint) = adjoint(
344+
blocks(parent(a))
345+
)
343346

344347
# Represents the array of arrays of a `SubArray`
345348
# wrapping a block spare array, i.e. `blocks(array)` where `a` is a `SubArray`.

Diff for: src/factorizations/svd.jl

+3-2
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,9 @@ julia> Uonly == U
197197
true
198198
```
199199
"""
200-
svd(A; kwargs...) =
201-
SVD(svd!(eigencopy_oftype(A, LinearAlgebra.eigtype(eltype(A))); kwargs...))
200+
function svd(A; kwargs...)
201+
return SVD(svd!(eigencopy_oftype(A, LinearAlgebra.eigtype(eltype(A))); kwargs...))
202+
end
202203

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

Diff for: test/runtests.jl

+6-4
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ const GROUP = uppercase(
1414
)
1515

1616
"match files of the form `test_*.jl`, but exclude `*setup*.jl`"
17-
istestfile(fn) =
18-
endswith(fn, ".jl") && startswith(basename(fn), "test_") && !contains(fn, "setup")
17+
function istestfile(fn)
18+
return endswith(fn, ".jl") && startswith(basename(fn), "test_") && !contains(fn, "setup")
19+
end
1920
"match files of the form `*.jl`, but exclude `*_notest.jl` and `*setup*.jl`"
20-
isexamplefile(fn) =
21-
endswith(fn, ".jl") && !endswith(fn, "_notest.jl") && !contains(fn, "setup")
21+
function isexamplefile(fn)
22+
return endswith(fn, ".jl") && !endswith(fn, "_notest.jl") && !contains(fn, "setup")
23+
end
2224

2325
@time begin
2426
# tests in groups based on folder structure

Diff for: test/test_basics.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,11 @@ arrayts = (Array, JLArray)
242242
@test Array(a) isa Array{elt,0}
243243
@test Array(a) == fill(0)
244244
for b in (
245-
(b = copy(a); @allowscalar(b[] = 2); b),
246-
(b = copy(a); @allowscalar(b[CartesianIndex()] = 2); b),
247-
(b = copy(a); @allowscalar(b[Block()[]] = 2); b),
245+
(b=copy(a); @allowscalar(b[] = 2); b),
246+
(b=copy(a); @allowscalar(b[CartesianIndex()] = 2); b),
247+
(b=copy(a); @allowscalar(b[Block()[]] = 2); b),
248248
# Regression test for https://github.com/ITensor/BlockSparseArrays.jl/issues/27.
249-
(b = copy(a); b[Block()] = dev(fill(2)); b),
249+
(b=copy(a); b[Block()]=dev(fill(2)); b),
250250
)
251251
@test size(b) == ()
252252
@test isone(length(b))

0 commit comments

Comments
 (0)