mirror of
https://github.com/karma-riuk/crab.git
synced 2025-07-05 05:28:13 +02:00
added the possibility of having the lenght of the
dataset
This commit is contained in:
@ -28,6 +28,9 @@ class DatasetEntry:
|
||||
class Dataset:
|
||||
entries: List = field(default_factory=list)
|
||||
|
||||
def __len__(self) -> int:
|
||||
return len(self.entries)
|
||||
|
||||
def to_json(self, filename: str):
|
||||
"""Serialize the dataset to a JSON file"""
|
||||
with open(filename, "w", encoding="utf-8") as f:
|
||||
|
Reference in New Issue
Block a user