Skip to content

Commit

Permalink
Cleaned up
Browse files Browse the repository at this point in the history
  • Loading branch information
ecomodeller committed Jan 29, 2025
1 parent 7557c48 commit d73b94a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 26 deletions.
27 changes: 2 additions & 25 deletions modelskill/comparison/_comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -1272,29 +1272,6 @@ def _save(self) -> xr.DataTree:

raise NotImplementedError(f"Unknown gtype: {self.gtype}")

def _save(self) -> xr.DataTree:
ds = self.data

if self.gtype == "point":
dt = xr.DataTree()
dt["matched"] = ds
dt["raw"] = xr.DataTree()

for key, ts_mod in self.raw_mod_data.items():
ts_mod = ts_mod.copy()
dt["raw"][key] = ts_mod.data

dt.attrs["gtype"] = "point"
return dt
elif self.gtype == "track":
# There is no need to save raw data for track data, since it is identical to the matched data
dt = xr.DataTree()
dt.attrs["gtype"] = "track"
dt["matched"] = ds
return dt

raise NotImplementedError(f"Unknown gtype: {self.gtype}")

def save(self, filename: Union[str, Path]) -> None:
"""Save to netcdf file
Expand All @@ -1313,12 +1290,12 @@ def _load(data: xr.DataTree | xr.DataArray) -> "Comparer":
return Comparer(matched_data=data["matched"].to_dataset())

if data.gtype == "point":
raw_mod_data: Dict[str, TimeSeries] = {}
raw_mod_data: Dict[str, PointModelResult] = {}

names = [x for x in data["raw"].children]
for var in names:
ds = data["raw"][var].to_dataset()
ts = PointObservation(data=ds, name=var)
ts = PointModelResult(data=ds, name=var)

raw_mod_data[var] = ts

Expand Down
2 changes: 1 addition & 1 deletion modelskill/plotting/_scatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ def _plot_summary_table(
## Render, and get width
# plt.draw() # TOOO this causes an error and I have no idea why it is here
dx = (
dx
dx # type: ignore
+ figure_transform.inverted().transform(
[text_col_i.get_window_extent().bounds[2], 0]
)[0]
Expand Down

0 comments on commit d73b94a

Please sign in to comment.