(self, val, n=1)
| 27 | self.count = 0 |
| 28 | |
| 29 | def update(self, val, n=1): |
| 30 | self.val = val |
| 31 | self.sum += val * n |
| 32 | self.count += n |
| 33 | if self.count > 0: |
| 34 | self.avg = self.sum / self.count |
| 35 | |
| 36 | def __str__(self): |
| 37 | fmtstr = '{name} {val' + self.fmt + '} ({avg' + self.fmt + '})' |
no outgoing calls
no test coverage detected