From 0fd51b1aaadb883deef49dd76c8d86d50036c995 Mon Sep 17 00:00:00 2001 From: mtfishman Date: Fri, 11 Apr 2025 01:54:27 +0000 Subject: [PATCH 1/2] Format .jl files --- Project.toml | 2 +- src/indsnetwork.jl | 4 ++-- src/solvers/sweep_plans/sweep_plans.jl | 28 +++++++++++++------------- test/runtests.jl | 6 ++++-- test/test_ttn_tdvp.jl | 2 +- 5 files changed, 22 insertions(+), 20 deletions(-) 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..b4ae80fa 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) = +function istestfile(fn) 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) = +function isexamplefile(fn) 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, From b795ed4cf65d9d045b9a63e6b0de1808786e21f1 Mon Sep 17 00:00:00 2001 From: Matt Fishman Date: Thu, 10 Apr 2025 22:03:21 -0400 Subject: [PATCH 2/2] Apply suggestions from code review --- test/runtests.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index b4ae80fa..98b2d2b8 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -15,11 +15,11 @@ const GROUP = uppercase( "match files of the form `test_*.jl`, but exclude `*setup*.jl`" function istestfile(fn) - 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`" function isexamplefile(fn) - endswith(fn, ".jl") && !endswith(fn, "_notest.jl") && !contains(fn, "setup") + return endswith(fn, ".jl") && !endswith(fn, "_notest.jl") && !contains(fn, "setup") end @time begin