mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/SPATZ.git
synced 2025-06-10 01:55:59 +00:00
Improved performance by faster concat call for dataframe
This commit is contained in:
parent
232fb50b3e
commit
c19fa0127b
@ -49,12 +49,12 @@ class Logger(Advanceable):
|
||||
self.__idx = -1
|
||||
|
||||
def _on_step(self, _: float):
|
||||
self.__df = pd.concat([self.__df, pd.Series().copy()], ignore_index=True)
|
||||
self.__df = pd.concat([self.__df, pd.DataFrame()], ignore_index=True)
|
||||
self.__idx += 1
|
||||
self.__df.loc[self.__idx, 'time'] = self.get_time()
|
||||
|
||||
def _on_reset(self):
|
||||
self.__df = pd.DataFrame.from_dict({'time': [self.get_time()]})
|
||||
self.__df = pd.DataFrame.from_dict({'time': [self.get_time()]}).astype(np.float64)
|
||||
|
||||
def write(self, attrib: str, value: Any, domain: str = 'all'):
|
||||
"""Writes a value to the logger.
|
||||
|
Loading…
x
Reference in New Issue
Block a user