Skip to content

Commit

Permalink
Add ProgressMeter for ArcDiagDeformBasis
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Dec 6, 2024
1 parent 8aec992 commit 7dd1113
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
5 changes: 4 additions & 1 deletion src/DeformationBases/ArcDiagDeformBasis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
)
Expand Down
2 changes: 2 additions & 0 deletions src/PBWDeformations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ module PBWDeformations

using Preferences: Preferences, @load_preference, @set_preferences!

import ProgressMeter

using Oscar

using Oscar.AbstractAlgebra: ProductIterator
Expand Down

0 comments on commit 7dd1113

Please sign in to comment.