diff --git a/Project.toml b/Project.toml index 2e73d19..be91788 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "BackendSelection" uuid = "680c2d7c-f67a-4cc9-ae9c-da132b1447a5" -version = "0.1.9" +version = "0.1.10" authors = ["ITensor developers and contributors"] [compat] diff --git a/docs/make.jl b/docs/make.jl index 8951d70..83a59da 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -14,9 +14,9 @@ makedocs(; format = Documenter.HTML(; canonical = "https://itensor.github.io/BackendSelection.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(; diff --git a/docs/make_index.jl b/docs/make_index.jl index 9d845f6..fbba2b2 100644 --- a/docs/make_index.jl +++ b/docs/make_index.jl @@ -1,5 +1,5 @@ -using Literate: Literate using BackendSelection: BackendSelection +using Literate: Literate function ccq_logo(content) include_ccq_logo = """ @@ -17,5 +17,5 @@ Literate.markdown( joinpath(pkgdir(BackendSelection), "docs", "src"); flavor = Literate.DocumenterFlavor(), name = "index", - postprocess = ccq_logo, + postprocess = ccq_logo ) diff --git a/docs/make_readme.jl b/docs/make_readme.jl index 8cee2b0..4c22f8f 100644 --- a/docs/make_readme.jl +++ b/docs/make_readme.jl @@ -1,5 +1,5 @@ -using Literate: Literate using BackendSelection: BackendSelection +using Literate: Literate function ccq_logo(content) include_ccq_logo = """ @@ -17,5 +17,5 @@ Literate.markdown( joinpath(pkgdir(BackendSelection)); flavor = Literate.CommonMarkFlavor(), name = "README", - postprocess = ccq_logo, + postprocess = ccq_logo ) diff --git a/src/backend_types.jl b/src/backend_types.jl index 7995889..f3c78ba 100644 --- a/src/backend_types.jl +++ b/src/backend_types.jl @@ -20,7 +20,9 @@ function generate_backend_type_expr(type::Symbol) kwargs::Kwargs end - $type{Back}(kwargs::NamedTuple) where {Back} = $type{Back, typeof(kwargs)}(kwargs) + function $type{Back}(kwargs::NamedTuple) where {Back} + return $type{Back, typeof(kwargs)}(kwargs) + end $type{Back}(; kwargs...) where {Back} = $type{Back}(NamedTuple(kwargs)) $type(s; kwargs...) = $type{Symbol(s)}(NamedTuple(kwargs)) @@ -40,13 +42,15 @@ function generate_backend_type_expr(type::Symbol) function Base.show(io::IO, backend::$type) return print( - io, "$($type) type ", backend_string(backend), ", ", parameters(backend) + io, "$($type) type ", backend_string(backend), ", ", parameters( + backend + ) ) end function Base.print(io::IO, backend::$type) return print(io, backend_string(backend), ", ", parameters(backend)) end - end, + end ) end diff --git a/test/runtests.jl b/test/runtests.jl index 0008050..16689fa 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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 @@ -57,7 +62,7 @@ end :macrocall, GlobalRef(Suppressor, Symbol("@suppress")), LineNumberNode(@__LINE__, @__FILE__), - :(include($filename)), + :(include($filename)) ) ) end diff --git a/test/test_aqua.jl b/test/test_aqua.jl index b310d06..404277b 100644 --- a/test/test_aqua.jl +++ b/test/test_aqua.jl @@ -1,5 +1,5 @@ -using BackendSelection: BackendSelection using Aqua: Aqua +using BackendSelection: BackendSelection using Test: @testset @testset "Code quality (Aqua.jl)" begin diff --git a/test/test_basics.jl b/test/test_basics.jl index 77c8627..cdec26b 100644 --- a/test/test_basics.jl +++ b/test/test_basics.jl @@ -28,7 +28,9 @@ using TestExtras: @constinferred end end # Macro syntax. - @test @constinferred(Algorithm"backend"(; x = 2, y = 3)) === Algorithm("backend"; x = 2, y = 3) - @test @constinferred(Backend"backend"(; x = 2, y = 3)) === Backend("backend"; x = 2, y = 3) + @test @constinferred(Algorithm"backend"(; x = 2, y = 3)) === + Algorithm("backend"; x = 2, y = 3) + @test @constinferred(Backend"backend"(; x = 2, y = 3)) === + Backend("backend"; x = 2, y = 3) @test isnothing(show(Algorithm(""))) end