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

correct shuffling of annotations in nhood enrichment #775

Merged
merged 19 commits into from
Feb 5, 2024

Conversation

giovp
Copy link
Member

@giovp giovp commented Dec 8, 2023

IMPORTANT: Please search among the Pull requests before creating one.

Description

How has this been tested?

Closes

@codecov-commenter
Copy link

codecov-commenter commented Dec 8, 2023

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (68d2c13) 69.86% compared to head (c132877) 69.87%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #775      +/-   ##
==========================================
+ Coverage   69.86%   69.87%   +0.01%     
==========================================
  Files          39       39              
  Lines        5479     5498      +19     
  Branches     1023     1031       +8     
==========================================
+ Hits         3828     3842      +14     
- Misses       1360     1363       +3     
- Partials      291      293       +2     
Files Coverage Δ
src/squidpy/gr/_utils.py 60.11% <100.00%> (+2.25%) ⬆️
src/squidpy/pl/_spatial_utils.py 78.70% <100.00%> (ø)
src/squidpy/pl/_interactive/_controller.py 11.65% <50.00%> (+0.54%) ⬆️
src/squidpy/pl/_utils.py 49.27% <50.00%> (+0.14%) ⬆️
src/squidpy/pl/_interactive/_utils.py 33.33% <33.33%> (+1.19%) ⬆️
src/squidpy/gr/_nhood.py 77.35% <37.50%> (-2.25%) ⬇️

@giovp giovp requested a review from timtreis December 8, 2023 16:02
@giovp giovp marked this pull request as ready for review December 8, 2023 16:02
cluster_annotations = rng.choice([1, 2, 3, 4], size=(size,))
else:
cluster_annotations = rng.choice(["X", "Y", "Z"], size=(size,))
rs = np.random.RandomState(seed)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't you use your rng from above here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

Shuffled annotations.
"""
cluster_annotation_output = np.empty(libraries.shape, dtype=cluster_annotation.dtype)
for c in libraries.cat.categories:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

categories will always be small, right? Or is there the need to vectorized?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

categories should always be small yes

@giovp giovp merged commit 4a12678 into main Feb 5, 2024
9 checks passed
@giovp giovp deleted the nhoodenrich/shuffle_class branch February 5, 2024 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants