Commit c0fee4fe authored by felix kleinert's avatar felix kleinert

update __repr__

parent 141c3836
Pipeline #41387 failed with stages
in 6 minutes and 16 seconds
......@@ -92,13 +92,26 @@ class StationPrep(AbstractStationPrep):
return self.data.shape, self.get_X().shape, self.get_Y().shape
def __repr__(self):
return f"StationPrep(station={self.station}, data_path='{self.path}, " \
return f"StationPrep(station={self.station}, data_path='{self.path}', " \
f"statistics_per_var={self.statistics_per_var}, " \
f"station_type='{self.station_type}', network='{self.network}', " \
f"sampling='{self.sampling}', target_dim='{self.target_dim}', target_var='{self.target_var}', " \
f"interpolate_dim='{self.interpolate_dim}', window_history_size={self.window_history_size}, " \
f"window_lead_time={self.window_lead_time}, overwrite_local_data={self.overwrite_local_data}, " \
f"transformation={self.transformation}, **{self.kwargs})"
f"transformation={self._print_transformation_as_string}, **{self.kwargs})"
@property
def _print_transformation_as_string(self):
str_name = ''
for k, v in self.transformation.items():
if v is not None:
try:
v_pr = f"xr.DataArray.from_dict({v.to_dict()})"
except AttributeError:
v_pr = f"'{v}'"
str_name += f"'{k}':{v_pr}, "
str_name = f"{{{str_name}}}"
return str_name
def get_transposed_history(self) -> xr.DataArray:
"""Return history.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment