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

DensMAP support #2946

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open

Conversation

keller-mark
Copy link

@keller-mark keller-mark commented Mar 22, 2024

I tried to follow the feedback described in a previous PR that contributed DensMAP #2684 (comment) but re-implemented on top of the state of the current scanpy main branch.

I did not add release notes because the contributor guide says to wait for PR feedback https://scanpy.readthedocs.io/en/latest/dev/documentation.html#adding-to-the-docs

  • Release notes not necessary because:

Copy link

codecov bot commented Mar 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.39%. Comparing base (f7acd02) to head (faaf5ae).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2946      +/-   ##
==========================================
+ Coverage   75.36%   75.39%   +0.02%     
==========================================
  Files         112      113       +1     
  Lines       13219    13231      +12     
==========================================
+ Hits         9963     9976      +13     
+ Misses       3256     3255       -1     
Files with missing lines Coverage Δ
src/scanpy/tools/__init__.py 91.30% <ø> (ø)
src/scanpy/tools/_types.py 100.00% <100.00%> (ø)
src/scanpy/tools/_umap.py 73.52% <100.00%> (+4.17%) ⬆️

@keller-mark keller-mark changed the title DensMAP support 2 DensMAP support Dec 10, 2024
@keller-mark
Copy link
Author

Hi, it seems the Check if milestone or "no milestone" label is present GH Actions check fails but I am not able to add a PR label

Copy link
Member

@flying-sheep flying-sheep left a comment

Choose a reason for hiding this comment

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

Hi, thanks for you contribution! Please add a plot test that shows sufficiently different results from umap.

# Convenience function for densMAP


def densmap(
Copy link
Member

Choose a reason for hiding this comment

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

I’d rather not maintain that. Just method='densmap' should be sufficient, but if densmap = partial(umap, method='densmap') works and displays in the docs as expected, I’d consider it.

If you want to make it more visible, you could add an example to the sc.pl.umap docs and maybe even a tutorial about what it’s for and how to best use it

Copy link
Author

Choose a reason for hiding this comment

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

I tried the partial option, but there seem to be issues with inference of the types from the parent umap function when generating the autodoc for sphinx that are not straightforward to resolve.

@flying-sheep flying-sheep added this to the 1.11.0 milestone Dec 16, 2024
@keller-mark
Copy link
Author

I have added a plotting test - this is how the UMAP and DensMAP results for this test look Screenshot 2024-12-17 at 12 05 28 PM

@flying-sheep flying-sheep modified the milestones: 1.11.0, 1.12.0 Dec 20, 2024
@keller-mark
Copy link
Author

keller-mark commented Jan 4, 2025

Hi, it seems that the plotting test that I added is failing in Azure CI, despite passing locally. I have read the plotting test notes at https://scanpy.readthedocs.io/en/stable/dev/testing.html#plotting-tests and https://github.com/scverse/scanpy/blob/main/docs/dev/ci.md#plotting-tests but cannot seem to find a place to view the generated image files in the Azure CI Attachments interface.

Screenshot 2025-01-04 at 10 38 11 AM

https://dev.azure.com/scverse/scanpy/_build/results?buildId=9158&view=ms.vss-test-web.build-test-results-tab&runId=30098&resultId=100650&paneView=attachments

E       AssertionError: Image files did not match.
E       RMS Value:  16.984969731422655
E       Expected:   file:///home/vsts/work/1/s/tests/_images/densmap_nocolor/expected.png
E       Actual:     file:///home/vsts/work/1/s/tests/_images/densmap_nocolor/actual.png
E       Difference: file:///home/vsts/work/1/s/tests/_images/densmap_nocolor/actual-failed-diff.png
E       Tolerance:  15

@ilan-gold ilan-gold self-requested a review January 6, 2025 02:50
@ilan-gold ilan-gold self-assigned this Jan 6, 2025
@keller-mark
Copy link
Author

I could use some help debugging this, the image-diffing test keeps failing with RMS values slightly above 15 but only in the PyTest minimum_versions environment.

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.

densmap
3 participants