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

fix ligrec from pandas update #609

Merged
merged 6 commits into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ dask[array]>=2021.02.0
docrep>=0.3.1
fsspec>=2021.11.0
leidenalg>=0.8.2
matplotlib>=3.3,!=3.6.1 # https://github.com/matplotlib/matplotlib/issues/24127
matplotlib-scalebar>=0.8.0
networkx>=2.6.0
numba>=0.55.0,<0.56.0
numpy>=1.21.6
omnipath>=1.0.5
pandas>=1.2.0
pandas>=1.5.0
Pillow>=8.0.0
scanpy>=1.8.0
scikit-image>=0.19
Expand Down
4 changes: 4 additions & 0 deletions squidpy/pl/_ligrec.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,10 @@ def get_dendrogram(adata: AnnData, linkage: str = "complete") -> Mapping[str, An
means = means.T

for cls, size in (pvals.groupby(level=0, axis=1)).size().to_dict().items():
size = np.unique(list(size.values()))
if len(size) != 1:
raise ValueError(f"Expected all groups to have the same number of interacting clusters, found `{size}`.")
size = size[0]
label_ranges[cls] = (start, start + size - 1)
start += size
label_ranges = {k: label_ranges[k] for k in sorted(label_ranges.keys())}
Expand Down
Binary file modified tests/_images/SpatialStatic_spatial_scatter_noimage.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ filterwarnings =
ignore:Auto-removal of grids by:DeprecationWarning:
ignore:Support for passing numbers through unit converters:DeprecationWarning
ignore:distutils Version classes are deprecated:DeprecationWarning
ignore::anndata.OldFormatWarning

[coverage:run]
branch = true
Expand Down