Skip to content

Commit ce0c7ff

Browse files
mtfishmangithub-actions[bot]
authored andcommitted
Format .jl files (ITensorFormatter)
1 parent 90f43bb commit ce0c7ff

10 files changed

Lines changed: 26 additions & 16 deletions

File tree

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ITensorBase"
22
uuid = "4795dd04-0d67-49bb-8f44-b89c448a1dc7"
3-
version = "0.5.2"
3+
version = "0.5.3"
44
authors = ["ITensor developers <support@itensor.org> and contributors"]
55

66
[workspace]

benchmark/benchmarks.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using ITensorBase
21
using BenchmarkTools
2+
using ITensorBase
33

44
SUITE = BenchmarkGroup()
55
SUITE["rand"] = @benchmarkable rand(10)

docs/make.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using ITensorBase: ITensorBase
21
using Documenter: Documenter, DocMeta, deploydocs, makedocs
2+
using ITensorBase: ITensorBase
33

44
DocMeta.setdocmeta!(ITensorBase, :DocTestSetup, :(using ITensorBase); recursive = true)
55

@@ -17,4 +17,8 @@ makedocs(;
1717
pages = ["Home" => "index.md", "Reference" => "reference.md"],
1818
)
1919

20-
deploydocs(; repo = "github.com/ITensor/ITensorBase.jl", devbranch = "main", push_preview = true)
20+
deploydocs(;
21+
repo = "github.com/ITensor/ITensorBase.jl",
22+
devbranch = "main",
23+
push_preview = true,
24+
)

docs/make_index.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using Literate: Literate
21
using ITensorBase: ITensorBase
2+
using Literate: Literate
33

44
function ccq_logo(content)
55
include_ccq_logo = """

docs/make_readme.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using Literate: Literate
21
using ITensorBase: ITensorBase
2+
using Literate: Literate
33

44
function ccq_logo(content)
55
include_ccq_logo = """

src/abstractitensor.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Base.ndims(::Type{<:AbstractITensor}) = Any
99

1010
struct ITensor <: AbstractITensor
1111
denamed::AbstractArray
12-
dimnames
12+
dimnames::Any
1313
function ITensor(denamed::AbstractArray, dimnames)
1414
ndims(denamed) == length(dimnames) ||
1515
throw(ArgumentError("Number of named dims must match ndims."))

src/index.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ struct Index{
101101
end
102102

103103
function Index{T, Value}(
104-
r::AbstractUnitRange{T}; kwargs...
104+
r::AbstractUnitRange{T}; kwargs...,
105105
) where {T, Value <: AbstractUnitRange{T}}
106106
return Index{T, Value}(r, IndexName(; kwargs...))
107107
end

test/runtests.jl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,16 @@ const GROUP = uppercase(
1313
end,
1414
)
1515

16-
"match files of the form `test_*.jl`, but exclude `*setup*.jl`"
16+
"""
17+
match files of the form `test_*.jl`, but exclude `*setup*.jl`
18+
"""
1719
function istestfile(fn)
18-
return endswith(fn, ".jl") && startswith(basename(fn), "test_") && !contains(fn, "setup")
20+
return endswith(fn, ".jl") && startswith(basename(fn), "test_") &&
21+
!contains(fn, "setup")
1922
end
20-
"match files of the form `*.jl`, but exclude `*_notest.jl` and `*setup*.jl`"
23+
"""
24+
match files of the form `*.jl`, but exclude `*_notest.jl` and `*setup*.jl`
25+
"""
2126
function isexamplefile(fn)
2227
return endswith(fn, ".jl") && !endswith(fn, "_notest.jl") && !contains(fn, "setup")
2328
end
@@ -26,7 +31,8 @@ end
2631
# tests in groups based on folder structure
2732
for testgroup in filter(isdir, readdir(@__DIR__))
2833
if GROUP == "ALL" || GROUP == uppercase(testgroup)
29-
for file in filter(istestfile, readdir(joinpath(@__DIR__, testgroup); join = true))
34+
for file in
35+
filter(istestfile, readdir(joinpath(@__DIR__, testgroup); join = true))
3036
@eval @safetestset $file begin
3137
include($file)
3238
end

test/test_aqua.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using ITensorBase: ITensorBase
21
using Aqua: Aqua
2+
using ITensorBase: ITensorBase
33
using Test: @testset
44

55
@testset "Code quality (Aqua.jl)" begin

test/test_basics.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using ITensorBase: ITensorBase, ITensor, Index, IndexName, gettag, hastag, plev, prime,
22
setplev, settag, tags, unsettag
3-
using NamedDimsArrays: dename, denamed, inds, mapinds, name, named
43
using LinearAlgebra: factorize
4+
using NamedDimsArrays: dename, denamed, inds, mapinds, name, named
55
using Test: @test, @test_broken, @test_throws, @testset
66

77
const elts = (Float32, Float64, Complex{Float32}, Complex{Float64})
@@ -64,7 +64,6 @@ const elts = (Float32, Float64, Complex{Float32}, Complex{Float64})
6464
@test plev(i) == 0
6565
@test length(tags(i)) == 1
6666
end
67-
6867
end
6968
@testset "ITensor basics" begin
7069
elt = Float64
@@ -116,7 +115,8 @@ const elts = (Float32, Float64, Complex{Float32}, Complex{Float64})
116115

117116
id = rand(UInt64)
118117
i = Index(2; id, tags = ["X" => "Y"])
119-
@test sprint(show, "text/plain", i) == "Index(length=2|id=$(id % 1000)|\"X\"=>\"Y\")"
118+
@test sprint(show, "text/plain", i) ==
119+
"Index(length=2|id=$(id % 1000)|\"X\"=>\"Y\")"
120120
end
121121
@testset "factorize" for elt in elts
122122
i = Index(2)

0 commit comments

Comments
 (0)