What is the best way to implement a new info class? #1135
-
|
Instead of having many print statements, I would like to use info classes to enable and disable debug messages or progress of the algorithm I have written. I would also like to know if it is standard to keep these info levels in the final version of code. My hope is that users can use these info levels to determine what the slowest part of the algorithm is for their use case. Thank you for considering the question! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Hi @JosephDayngerRuiz that's a good question! I've changed my mind on this over the years, and I think the solution I've converged on is this: simply convert your print statements to How does that sound? |
Beta Was this translation helpful? Give feedback.
Hi @JosephDayngerRuiz that's a good question! I've changed my mind on this over the years, and I think the solution I've converged on is this: simply convert your print statements to
InfoSemigroupsstatements. This way if someone wants more output when they are using any code in Semigroups, then they can just turn up the info-level ofInfoSemigroupsand they will get it. This might be undesirable if you only want output from one part of the code, but you get clobbered by lots of output from another part. However, at the moment there are only info-statements for bits of code (like finding the lattice of congruences for example) that are very much slower than the more fundamental parts of t…