diff options
-rw-r--r-- | src/argaze/DataStructures.py | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/src/argaze/DataStructures.py b/src/argaze/DataStructures.py index 6502091..5bbd47e 100644 --- a/src/argaze/DataStructures.py +++ b/src/argaze/DataStructures.py @@ -46,10 +46,10 @@ class TimeStampedBuffer(collections.OrderedDict): super().__setitem__(ts, data) - def __str__(self): + def __repr__(self): """String representation""" - return json.dumps(self, default=vars) + return json.dumps(self, ensure_ascii = False, default=vars) def append(self, timestamped_buffer: TimeStampedBufferType) -> TimeStampedBufferType: """Append a timestamped buffer.""" @@ -153,25 +153,6 @@ class TimeStampedBuffer(collections.OrderedDict): return df - def save_as_csv(self, filepath, exclude=[]): - """Write into a csv file.""" - - try: - self.as_dataframe(exclude=exclude).to_csv(filepath, index=True) - - except: - raise RuntimeError(f'Can\' write {filepath}') - - def save_as_json(self, filepath): - """Write into a json file.""" - - try: - with open(filepath, 'w', encoding='utf-8') as jsonfile: - json.dump(self, jsonfile, ensure_ascii = False, default=vars) - - except: - raise RuntimeError(f'Can\' write {filepath}') - def plot(self, names=[], colors=[], split={}, samples=None) -> list: """Plot as [matplotlib](https://matplotlib.org/) time chart.""" |