Skip to content
Merged
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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ITensorBase"
uuid = "4795dd04-0d67-49bb-8f44-b89c448a1dc7"
version = "0.5.2"
version = "0.5.3"
authors = ["ITensor developers <support@itensor.org> and contributors"]

[workspace]
Expand Down
2 changes: 1 addition & 1 deletion benchmark/benchmarks.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using ITensorBase
using BenchmarkTools
using ITensorBase

SUITE = BenchmarkGroup()
SUITE["rand"] = @benchmarkable rand(10)
Expand Down
12 changes: 8 additions & 4 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using ITensorBase: ITensorBase
using Documenter: Documenter, DocMeta, deploydocs, makedocs
using ITensorBase: ITensorBase

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

Expand All @@ -12,9 +12,13 @@ makedocs(;
format = Documenter.HTML(;
canonical = "https://itensor.github.io/ITensorBase.jl",
edit_link = "main",
assets = ["assets/favicon.ico", "assets/extras.css"],
assets = ["assets/favicon.ico", "assets/extras.css"]
),
pages = ["Home" => "index.md", "Reference" => "reference.md"],
pages = ["Home" => "index.md", "Reference" => "reference.md"]
)

deploydocs(; repo = "github.com/ITensor/ITensorBase.jl", devbranch = "main", push_preview = true)
deploydocs(;
repo = "github.com/ITensor/ITensorBase.jl",
devbranch = "main",
push_preview = true
)
4 changes: 2 additions & 2 deletions docs/make_index.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Literate: Literate
using ITensorBase: ITensorBase
using Literate: Literate

function ccq_logo(content)
include_ccq_logo = """
Expand All @@ -17,5 +17,5 @@ Literate.markdown(
joinpath(pkgdir(ITensorBase), "docs", "src");
flavor = Literate.DocumenterFlavor(),
name = "index",
postprocess = ccq_logo,
postprocess = ccq_logo
)
4 changes: 2 additions & 2 deletions docs/make_readme.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Literate: Literate
using ITensorBase: ITensorBase
using Literate: Literate

function ccq_logo(content)
include_ccq_logo = """
Expand All @@ -17,5 +17,5 @@ Literate.markdown(
joinpath(pkgdir(ITensorBase));
flavor = Literate.CommonMarkFlavor(),
name = "README",
postprocess = ccq_logo,
postprocess = ccq_logo
)
2 changes: 1 addition & 1 deletion src/abstractitensor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Base.ndims(::Type{<:AbstractITensor}) = Any

struct ITensor <: AbstractITensor
denamed::AbstractArray
dimnames
dimnames::Any
function ITensor(denamed::AbstractArray, dimnames)
ndims(denamed) == length(dimnames) ||
throw(ArgumentError("Number of named dims must match ndims."))
Expand Down
2 changes: 1 addition & 1 deletion src/index.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct IndexName <: AbstractName
end
function IndexName(
rng::AbstractRNG = Random.default_rng(); id::UInt64 = rand(rng, UInt64),
tags = Dict{String, String}(), plev::Int = 0,
tags = Dict{String, String}(), plev::Int = 0
)
return IndexName(id, Dict{String, String}(tags), plev)
end
Expand Down
4 changes: 2 additions & 2 deletions src/quirks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function translate_factorize_kwargs(;
ortho = nothing,
cutoff = nothing,
maxdim = nothing,
kwargs...,
kwargs...
)
orth = Symbol(@something orth ortho :left)
rtol = @something rtol cutoff Some(nothing)
Expand All @@ -34,6 +34,6 @@ function TensorAlgebra.factorize(a::AbstractITensor, codomain_inds, domain_inds;
a,
codomain_inds,
domain_inds;
translate_factorize_kwargs(; kwargs...)...,
translate_factorize_kwargs(; kwargs...)...
)
end
18 changes: 12 additions & 6 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,19 @@ const GROUP = uppercase(
get(ENV, "GROUP", "ALL")
else
only(match(pat, ARGS[arg_id]).captures)
end,
end
)

"match files of the form `test_*.jl`, but exclude `*setup*.jl`"
"""
match files of the form `test_*.jl`, but exclude `*setup*.jl`
"""
function istestfile(fn)
return endswith(fn, ".jl") && startswith(basename(fn), "test_") && !contains(fn, "setup")
return endswith(fn, ".jl") && startswith(basename(fn), "test_") &&
!contains(fn, "setup")
end
"match files of the form `*.jl`, but exclude `*_notest.jl` and `*setup*.jl`"
"""
match files of the form `*.jl`, but exclude `*_notest.jl` and `*setup*.jl`
"""
function isexamplefile(fn)
return endswith(fn, ".jl") && !endswith(fn, "_notest.jl") && !contains(fn, "setup")
end
Expand All @@ -26,7 +31,8 @@ end
# tests in groups based on folder structure
for testgroup in filter(isdir, readdir(@__DIR__))
if GROUP == "ALL" || GROUP == uppercase(testgroup)
for file in filter(istestfile, readdir(joinpath(@__DIR__, testgroup); join = true))
for file in
filter(istestfile, readdir(joinpath(@__DIR__, testgroup); join = true))
@eval @safetestset $file begin
include($file)
end
Expand Down Expand Up @@ -55,7 +61,7 @@ end
:macrocall,
GlobalRef(Suppressor, Symbol("@suppress")),
LineNumberNode(@__LINE__, @__FILE__),
:(include($filename)),
:(include($filename))
)
)
end
Expand Down
2 changes: 1 addition & 1 deletion test/test_aqua.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using ITensorBase: ITensorBase
using Aqua: Aqua
using ITensorBase: ITensorBase
using Test: @testset

@testset "Code quality (Aqua.jl)" begin
Expand Down
6 changes: 3 additions & 3 deletions test/test_basics.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using ITensorBase: ITensorBase, ITensor, Index, IndexName, gettag, hastag, plev, prime,
setplev, settag, tags, unsettag
using NamedDimsArrays: dename, denamed, inds, mapinds, name, named
using LinearAlgebra: factorize
using NamedDimsArrays: dename, denamed, inds, mapinds, name, named
using Test: @test, @test_broken, @test_throws, @testset

const elts = (Float32, Float64, Complex{Float32}, Complex{Float64})
Expand Down Expand Up @@ -64,7 +64,6 @@ const elts = (Float32, Float64, Complex{Float32}, Complex{Float64})
@test plev(i) == 0
@test length(tags(i)) == 1
end

end
@testset "ITensor basics" begin
elt = Float64
Expand Down Expand Up @@ -116,7 +115,8 @@ const elts = (Float32, Float64, Complex{Float32}, Complex{Float64})

id = rand(UInt64)
i = Index(2; id, tags = ["X" => "Y"])
@test sprint(show, "text/plain", i) == "Index(length=2|id=$(id % 1000)|\"X\"=>\"Y\")"
@test sprint(show, "text/plain", i) ==
"Index(length=2|id=$(id % 1000)|\"X\"=>\"Y\")"
end
@testset "factorize" for elt in elts
i = Index(2)
Expand Down
Loading