mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/SPATZ.git
synced 2025-12-16 17:28:04 +00:00
Updated sensors and added empty logger for speedup
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
|
||||
from abc import abstractmethod
|
||||
from typing import Any, Tuple, List
|
||||
from numpy.typing import ArrayLike
|
||||
|
||||
@@ -10,6 +11,35 @@ from spatz.simulations.advanceable import Advanceable
|
||||
class Logger(Advanceable):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
@abstractmethod
|
||||
def write(self, attrib: str | List[str], value: Any | List[Any] | List[ArrayLike], domain: str = 'all'):
|
||||
pass
|
||||
|
||||
|
||||
class EmptyLogger(Logger):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self.__idx = -1
|
||||
|
||||
def _on_step(self, _: float):
|
||||
pass
|
||||
|
||||
def _on_reset(self):
|
||||
pass
|
||||
|
||||
def write(self, attrib: str | List[str], value: Any | List[Any] | List[ArrayLike], domain: str = 'all'):
|
||||
pass
|
||||
|
||||
def get_dataframe(self) -> pd.DataFrame:
|
||||
pass
|
||||
|
||||
|
||||
class CSVLogger(Logger):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self.__idx = -1
|
||||
|
||||
def _on_step(self, _: float):
|
||||
|
||||
Reference in New Issue
Block a user