MCPcopy Create free account
hub / github.com/Pints-AI/1.5-Pints / ErrorCountHandler

Class ErrorCountHandler

prepare_dataset/preparer.py:39–51  ·  view source on GitHub ↗

This is to be attached to our logging interface. Useful at the end of dataset preparation, to tell user how many errors are there.

Source from the content-addressed store, hash-verified

37
38
39class ErrorCountHandler(logging.Handler):
40 """
41 This is to be attached to our logging interface.
42 Useful at the end of dataset preparation, to tell user how many errors are there.
43 """
44
45 def __init__(self, level=logging.NOTSET):
46 super().__init__(level)
47 self.error_count = 0
48
49 def emit(self, record):
50 if record.levelno == logging.ERROR:
51 self.error_count += 1
52
53
54class DatasetPreparer:

Callers 1

DatasetPreparerClass · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected