Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

map_neighbors() docstring example fails with seaborn 0.13.0 #480

Closed
CommonClimate opened this issue Nov 29, 2023 · 1 comment
Closed

map_neighbors() docstring example fails with seaborn 0.13.0 #480

CommonClimate opened this issue Nov 29, 2023 · 1 comment
Assignees
Labels

Comments

@CommonClimate
Copy link
Collaborator

In upgrading to Python 3.11, I also upgraded to seaborn 0.13.0, and this docstring example is failing:

Traceback (most recent call last):

  Cell In[3], line 17
    gs.map_neighbors(mgs, radius=4000)

  File ~/Documents/GitHub/Pyleoclim_util/pyleoclim/core/geoseries.py:446 in map_neighbors
    fig, ax_d = mapping.scatter_map(neighborhood, fig=fig, gs_slot=gridspec_slot, hue=hue, size=size, marker=marker, projection=projection,

  File ~/Documents/GitHub/Pyleoclim_util/pyleoclim/utils/mapping.py:1205 in scatter_map
    _, ax_d = plot_scatter(df=df, x=x, y=y, hue_var=hue, size_var=size, marker_var=marker, ax_d=ax_d, proj=None, edgecolor=edgecolor,

  File ~/Documents/GitHub/Pyleoclim_util/pyleoclim/utils/mapping.py:946 in plot_scatter
    sns.scatterplot(data=hue_data, x=x, y=y, hue=hue_var, size=size_var,transform=transform, #change to transform=scatter_kwargs['transform']

  File ~/opt/miniconda3/envs/pyleo/lib/python3.11/site-packages/seaborn/relational.py:624 in scatterplot
    p.plot(ax, kwargs)

  File ~/opt/miniconda3/envs/pyleo/lib/python3.11/site-packages/seaborn/relational.py:458 in plot
    self.add_legend_data(ax, _scatter_legend_artist, kws, attrs)

  File ~/opt/miniconda3/envs/pyleo/lib/python3.11/site-packages/seaborn/_base.py:1270 in add_legend_data
    artist = func(label=label, **{"color": ".2", **common_kws, **level_kws})

  File ~/opt/miniconda3/envs/pyleo/lib/python3.11/site-packages/seaborn/utils.py:922 in _scatter_legend_artist
    if edgecolor == "face":

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

The problem goes away if I revert to seaborn 0.12.2, keeping all other packages the same. I opened an issue with seaborn. Until it is resolved, I will pin the seaborn version to 0.12.2.

I will also investigate why this was not caught by the CI test.

@CommonClimate CommonClimate self-assigned this Nov 29, 2023
CommonClimate added a commit that referenced this issue Nov 29, 2023
ran locally on my machine after downgrading seaborn to 0.12.2 to alleviate issue #480
@jordanplanders
Copy link
Contributor

Resolved for now as part of #559

edgecolor is currently not as configurable as it used to be in Seaborn. Hopefully that will change soon (it looks like a lot is going on over there).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

2 participants