Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskoenig committed Mar 5, 2021
1 parent 4c01cf1 commit d1c2193
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/sbmlsim/plot/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,8 +798,8 @@ class Figure(BasePlotObject):

fig_dpi = 72
fig_facecolor = "white"
fig_subplots_wspace = 0.15 # vertical spacing of subplots (fraction of axes)
fig_subplots_hspace = 0.15 # horizontal spacing of subplots (fraction of axes)
fig_subplots_wspace = 0.3 # vertical spacing of subplots (fraction of axes)
fig_subplots_hspace = 0.3 # horizontal spacing of subplots (fraction of axes)
panel_width = 7
panel_height = 5
fig_titlesize = 25
Expand Down
15 changes: 11 additions & 4 deletions src/sbmlsim/result/xresult.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,18 @@ def __str__(self) -> str:
"""Get string."""
return f"<XResult: {self.xds.__repr__()},\n{self.uinfo}>"

def dim_mean(self, key):
def dim_mean(self, key: str) -> xr.Dataset:
"""Get mean over all added dimensions."""
return self.xds[key].mean(
dim=self._redop_dims(), skipna=True
).values * self.uinfo.ureg(self.uinfo[key])
try:
data = self.xds[key].mean(
dim=self._redop_dims(), skipna=True
).values * self.uinfo.ureg(self.uinfo[key])
except KeyError as err:
logger.error(f"Key '{key}' does not exist in XResult. Add the "
f"key to the experiment via add_selections in "
f"'Experiment.datagenerators'.")
raise err
return data

def dim_std(self, key):
"""Get standard deviation over all added dimensions."""
Expand Down

0 comments on commit d1c2193

Please sign in to comment.