Skip to content

Commit

Permalink
Fix numpy dependency and reference to values
Browse files Browse the repository at this point in the history
  • Loading branch information
eachanjohnson committed Oct 5, 2024
1 parent 1c15c1c commit 35ab01d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion carabiner/mpl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"\n\t$ pip install carabiner[mpl]\n")
else:
from matplotlib import axes, cycler, figure, rcParams
import numpy as np
from pandas import DataFrame
from tqdm.auto import tqdm

Expand Down Expand Up @@ -176,6 +177,7 @@ def scattergrid(
extras = {"label": group_name} if not dummy_group else {}
if grid_row_name == grid_col_name:
if xscale == "log":
values = group_df[grid_col_name].values
bins = np.geomspace(
values.min(),
values.max(),
Expand Down Expand Up @@ -203,5 +205,6 @@ def scattergrid(
xlabel=grid_col_name,
ylabel=ylabel,
)
ax.legend(**_legend_opts)
if not dummy_group:
ax.legend(**_legend_opts)
return fig, axes
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dependencies = [
[project.optional-dependencies]

deep = ["tensorflow"]
mpl = ["pandas", "matplotlib"]
mpl = ["pandas", "matplotlib", "numpy"]
pd = ["pandas"]
all = ["carabiner-tools[deep,mpl,pd]"]

Expand Down

0 comments on commit 35ab01d

Please sign in to comment.