Adding a rank attribute to the Counter class and update initialization of our counters

This commit is contained in:
2026-07-17 08:16:57 +02:00
committed by edipretoro
parent 138aba5034
commit 7a7cc79ac5
+4 -1
View File
@@ -7,6 +7,7 @@ from typing import ClassVar
@dataclass
class Counter():
rank: int
top: int
value: int
@@ -92,11 +93,13 @@ class Minter(Persistent):
maxcounters = 293
self.percounter = int(self.oatop / maxcounters + 1)
t = self.oatop
n = 0
while t > 0:
top = self.percounter if t >= self.percounter else t
c = Counter(top=top, value=0)
c = Counter(top=top, value=0, rank=n)
self.active_counters.append(c)
t -= self.percounter
n += 1
def _n2xdig(self, num) -> str:
# 1. Initialize s to ''