Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…biosteam into easy_input_model_stage
  • Loading branch information
yoelcortes committed Nov 6, 2024
2 parents 7be466c + e2d3942 commit 62aa8ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 5 additions & 2 deletions biosteam/evaluation/_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from .evaluation_tools import load_default_parameters
import pickle

__all__ = ('Model',)
__all__ = ('Model', 'EasyInputModel')

def replace_nones(values, replacement):
for i, j in enumerate(values):
Expand Down Expand Up @@ -1370,4 +1370,7 @@ def _info(self, p, m):
def show(self, p=None, m=None):
"""Return information on p-parameters and m-metrics."""
print(self._info(p, m))
_ipython_display_ = show
_ipython_display_ = show

EasyInputModel = Model
Model.load_parameter_distributions = Model.parameters_from_df
7 changes: 4 additions & 3 deletions biosteam/plots/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ def plot_kde(x, y, nbins=100, ax=None, fig=None,
xtick0=True, ytick0=True, xtickf=True, ytickf=True,
xbox=None, ybox=None, xbox_kwargs=None, ybox_kwargs=None,
aspect_ratio=1.25, cmaps=None, xbox_width=None,
ybox_width=None, **kwargs):
ybox_width=None, zorders=None, **kwargs):
axis_not_given = ax is None
xs = x if isinstance(x, (tuple, list)) else (x,)
ys = y if isinstance(y, (tuple, list)) else (y,)
Expand Down Expand Up @@ -895,7 +895,8 @@ def plot_kde(x, y, nbins=100, ax=None, fig=None,
else:
yboxes = ybox
if cmaps is None: cmaps = len(xs) * [None]
for x, y, cmap, xbox, ybox in zip(xs, ys, cmaps, xboxes, yboxes):
if zorders is None: zorders = len(xs) * [5]
for x, y, cmap, zorder, xbox, ybox in zip(xs, ys, cmaps, zorders, xboxes, yboxes):
# Evaluate a gaussian kde on a regular grid of nbins x nbins over data extents
k = kde.gaussian_kde([x, y])
z = k(np.vstack([x, y]))
Expand All @@ -909,7 +910,7 @@ def plot_kde(x, y, nbins=100, ax=None, fig=None,
# 2D Density with shading
plt.sca(ax)

plt.scatter(x, y, c=z, s=1., cmap=cmap, **kwargs)
plt.scatter(x, y, c=z, s=1., cmap=cmap, zorder=zorder, **kwargs)
if xbox:
plt.sca(xbox.axis)
plot_montecarlo(x, xbox.light, xbox.dark, positions=(xbox.get_position(-1),), vertical=False, outliers=False, width=xbox_width, bounds=True)
Expand Down

0 comments on commit 62aa8ae

Please sign in to comment.