diff --git a/.github/workflows/FormatPullRequest.yml b/.github/workflows/FormatPullRequest.yml new file mode 100644 index 00000000..93875cc3 --- /dev/null +++ b/.github/workflows/FormatPullRequest.yml @@ -0,0 +1,14 @@ +name: "Format Pull Request" + +on: + schedule: + - cron: '0 0 * * *' + workflow_dispatch: +permissions: + contents: write + pull-requests: write + +jobs: + format-pull-request: + name: "Format Pull Request" + uses: "ITensor/ITensorActions/.github/workflows/FormatPullRequest.yml@main" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 65993659..46311a85 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,9 @@ +ci: + skip: [julia-formatter] + 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 @@ -9,6 +12,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" diff --git a/Project.toml b/Project.toml index 548e20ae..e969820b 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ITensorNetworks" uuid = "2919e153-833c-4bdc-8836-1ea460a35fc7" authors = ["Matthew Fishman , Joseph Tindall and contributors"] -version = "0.13.3" +version = "0.13.4" [deps] AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" diff --git a/src/indsnetwork.jl b/src/indsnetwork.jl index befc5cdc..ea36ab95 100644 --- a/src/indsnetwork.jl +++ b/src/indsnetwork.jl @@ -65,7 +65,7 @@ end return IndsNetwork{V,I}(g, link_space, site_space) end -@traitfn function IndsNetwork(g::G, link_space, site_space) where {G; IsUnderlyingGraph{G}} +@traitfn function IndsNetwork(g::G, link_space, site_space) where {G;IsUnderlyingGraph{G}} V = vertextype(g) return IndsNetwork{V}(g, link_space, site_space) end @@ -133,7 +133,7 @@ end return IndsNetwork{V}(g, link_space, site_space) end -@traitfn function IndsNetwork(g::G; kwargs...) where {G; IsUnderlyingGraph{G}} +@traitfn function IndsNetwork(g::G; kwargs...) where {G;IsUnderlyingGraph{G}} return IndsNetwork{vertextype(g)}(g; kwargs...) end diff --git a/src/solvers/sweep_plans/sweep_plans.jl b/src/solvers/sweep_plans/sweep_plans.jl index 52915e2b..dda6dd96 100644 --- a/src/solvers/sweep_plans/sweep_plans.jl +++ b/src/solvers/sweep_plans/sweep_plans.jl @@ -108,19 +108,19 @@ function default_sweep_plans( transform_operator_kwargs, kwargs..., ) - extracter, updater, inserter, transform_operator = - extend_or_truncate.((extracter, updater, inserter, transform_operator), nsweeps) - inserter_kwargs, updater_kwargs, extracter_kwargs, transform_operator_kwargs, kwargs = - expand.( - ( - inserter_kwargs, - updater_kwargs, - extracter_kwargs, - transform_operator_kwargs, - NamedTuple(kwargs), - ), - nsweeps, - ) + extracter, updater, inserter, transform_operator = extend_or_truncate.( + (extracter, updater, inserter, transform_operator), nsweeps + ) + inserter_kwargs, updater_kwargs, extracter_kwargs, transform_operator_kwargs, kwargs = expand.( + ( + inserter_kwargs, + updater_kwargs, + extracter_kwargs, + transform_operator_kwargs, + NamedTuple(kwargs), + ), + nsweeps, + ) sweep_plans = [] for i in 1:nsweeps sweep_plan = sweep_plan_func( @@ -187,7 +187,7 @@ function tdvp_sweep_plan( region_kwargs..., ), reverse_kwargs=(; - internal_kwargs=(; substep, time_step=-sub_time_step, t=t_evolved), + internal_kwargs=(; substep, time_step=(-sub_time_step), t=t_evolved), region_kwargs..., ), reverse_step, diff --git a/test/runtests.jl b/test/runtests.jl index 1c52c3e1..98b2d2b8 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -14,11 +14,13 @@ const GROUP = uppercase( ) "match files of the form `test_*.jl`, but exclude `*setup*.jl`" -istestfile(fn) = - endswith(fn, ".jl") && startswith(basename(fn), "test_") && !contains(fn, "setup") +function istestfile(fn) + 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`" -isexamplefile(fn) = - endswith(fn, ".jl") && !endswith(fn, "_notest.jl") && !contains(fn, "setup") +function isexamplefile(fn) + return endswith(fn, ".jl") && !endswith(fn, "_notest.jl") && !contains(fn, "setup") +end @time begin # tests in groups based on folder structure diff --git a/test/test_ttn_tdvp.jl b/test/test_ttn_tdvp.jl index 82dc7d38..f4426d21 100644 --- a/test/test_ttn_tdvp.jl +++ b/test/test_ttn_tdvp.jl @@ -341,7 +341,7 @@ using Test: @testset, @test H, -ttotal, state; - time_step=-tau, + time_step=(-tau), maxdim, cutoff, nsites,