diff --git a/python/corsika/io/outputs/observation_plane.py b/python/corsika/io/outputs/observation_plane.py index bd18edc8ed89b20f5b68faac1a87370775bfb9b1..3b2680e17f6e98c395d94496f870c18fb57e427a 100644 --- a/python/corsika/io/outputs/observation_plane.py +++ b/python/corsika/io/outputs/observation_plane.py @@ -30,10 +30,7 @@ class ObservationPlane(Output): path: str The path to the directory containing this output. """ - - # load and store our path and config - self.path = path - self.__config = self.load_config(path) + super().__init__(path) # try and load our data try: @@ -53,7 +50,7 @@ class ObservationPlane(Output): bool: True if this is a good output. """ - return self.__data is not None and self.__config is not None + return self.__data is not None def astype(self, dtype: str = "pandas", **kwargs: Any) -> Any: """ @@ -83,21 +80,6 @@ class ObservationPlane(Output): ) ) - @property - def config(self) -> Dict[str, Any]: - """ - Return the config file for this output. - - Parameters - ---------- - - Returns - ------- - Dict[str, any] - The configuration file for this output. - """ - return self.__config - def __repr__(self) -> str: """ Return a string representation of this class. diff --git a/python/corsika/io/outputs/output.py b/python/corsika/io/outputs/output.py index 3a1353f5e8059e6f18eeca36f772d1144846a519..83a4c7928b786b9bad4301bec39b7e03aaf567f8 100644 --- a/python/corsika/io/outputs/output.py +++ b/python/corsika/io/outputs/output.py @@ -20,7 +20,6 @@ class Output(ABC): that wish to provide reading support for CORSIKA8 outputs. """ - @abstractmethod def __init__(self, path: str): """ __init__ must load the output files and check @@ -31,7 +30,10 @@ class Output(ABC): path: str The path to the directory containing this output. """ - pass + # load and store our path and config + self.path = path + self.__config = self.load_config(path) + self.__summary = self.load_summary(path) @abstractmethod def is_good(self) -> bool: @@ -68,7 +70,6 @@ class Output(ABC): pass @property - @abstractmethod def config(self) -> Dict[str, Any]: """ Return the config file for this output. @@ -81,7 +82,22 @@ class Output(ABC): Dict[str, any] The configuration file for this output. """ - pass + return self.__config + + @property + def summary(self) -> Dict[str, Any]: + """ + Return the summary file for this output. + + Parameters + ---------- + + Returns + ------- + Dict[str, any] + The summary file for this output. + """ + return self.__summary @property def data(self) -> Any: