1from dataclasses
import dataclass
2from typing
import Callable, Optional
6 n_events: Optional[int] =
None
7 batch_id: Optional[int] =
None
8 n_batches: Optional[int] =
None
9 description: Optional[str] =
None
15 raise NotImplementedError
20 ret.append(f
"{self.__class__.__name__} #{self.batch_id}")
22 ret.append(f
"/ {self.n_batches}")
24 ret.append(f
"a batch of type {self.__class__.__name__}")
27 ret.append(f
"containing {self.n_events} events")
30 ret.append(f
"({self.description})")
34if __name__ ==
'__main__':
41 print (
EventBatch(n_events=100, description=
"my super important batch"))
47 print (
EventBatch(batch_id=3, n_events=100, description=
"Third batch"))
50 print (
EventBatch(batch_id=3, n_events=100, description=
"Third batch"))
53 print (
EventBatch(batch_id=3, n_batches=5, n_events=100, description=
"Third batch"))