diff --git a/Project.toml b/Project.toml index 98889803..c32fe713 100644 --- a/Project.toml +++ b/Project.toml @@ -6,8 +6,10 @@ version = "0.4.0-DEV" [deps] Oscar = "f1435218-dba5-11e9-1e4d-f1a5fab5fc13" Preferences = "21216c6a-2e73-6563-6e65-726566657250" +ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca" [compat] Oscar = "~1.2" Preferences = "1.4" +ProgressMeter = "1.10.2" julia = "1.8" diff --git a/src/DeformationBases/ArcDiagDeformBasis.jl b/src/DeformationBases/ArcDiagDeformBasis.jl index 11860e81..40759389 100644 --- a/src/DeformationBases/ArcDiagDeformBasis.jl +++ b/src/DeformationBases/ArcDiagDeformBasis.jl @@ -70,9 +70,11 @@ struct ArcDiagDeformBasis{T <: SmashProductLieElem} <: DeformBasis{T} diag_iter = pbw_arc_diagrams(LieType, W, d) len = length(diag_iter) + prog_meter = ProgressMeter.Progress(len; output=stderr, enabled=true, desc="Basis generation: deg $d, case $(case)/$(n_cases)") + generate_showvalues(counter, diag) = () -> [("iteration", (counter, diag))] iter = ( begin - @vprintln :PBWDeformations 2 "Basis generation deg $(lpad(d, maximum(ndigits, degs))), case $(lpad(case, ndigits(n_cases)))/$(n_cases), $(lpad(floor(Int, 100*counter / len), 3))%, $(lpad(counter, ndigits(len)))/$(len)" + # @vprintln :PBWDeformations 2 "Basis generation deg $(lpad(d, maximum(ndigits, degs))), case $(lpad(case, ndigits(n_cases)))/$(n_cases), $(lpad(floor(Int, 100*counter / len), 3))%, $(lpad(counter, ndigits(len)))/$(len)" _basis_elem = arcdiag_to_deformationmap(LieType, diag, sp, W) basis_elem = matrix(proj_to_summand_l) * _basis_elem * transpose(matrix(proj_to_summand_r)) if i_l != i_r @@ -88,6 +90,7 @@ struct ArcDiagDeformBasis{T <: SmashProductLieElem} <: DeformBasis{T} else extra_data[basis_elem] = Set([diag]) end + ProgressMeter.update!(prog_meter, counter; showvalues = generate_showvalues(counter, diag)) basis_elem end for (counter, diag) in enumerate(diag_iter) if is_crossing_free(diag, part=:lower) ) diff --git a/src/PBWDeformations.jl b/src/PBWDeformations.jl index 446fbe86..05a7af21 100644 --- a/src/PBWDeformations.jl +++ b/src/PBWDeformations.jl @@ -2,6 +2,8 @@ module PBWDeformations using Preferences: Preferences, @load_preference, @set_preferences! +import ProgressMeter + using Oscar using Oscar.AbstractAlgebra: ProductIterator