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

(feat): Update notebooks for new leiden defaults #77

Merged
merged 22 commits into from
Feb 27, 2024

Conversation

ilan-gold
Copy link
Contributor

@ilan-gold ilan-gold commented Jan 17, 2024

See scverse/scanpy#2815 for implementation prompting the changes. The changes here generally reflect the reordering of labels. It does not look like results changed in a meaningful way, so changes should be minimal in that sense.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@ilan-gold
Copy link
Contributor Author

ilan-gold commented Jan 17, 2024

Current issues:

  • pbmc3k.ipynb
    • pca on highly_variable (as was the default evidently) or not in cell 22
  • spatial/basic-analysis.ipynb
    • Why did the data change (3rd cell)?
    • Why doesn't sc.pl.spatial not work in cell 14?
    • SpatialDE.run is not working for no apparent reason UPDATE: it's hasn't been updated in two years, the issue is pandas related
  • spatial/integration-scanorama.ipynb
    • number of categories for plotting the 2 image clusters is 18, but this is less than the total number (warning was present before)
    • Link for adata_processed not working? Should we regenerate?
    • scanroma result changed?

Overall issues are the number of warnings, which is quite high without suppression. Is this expected, and if so, how were they repressed in the past for building the docs?

@ilan-gold
Copy link
Contributor Author

ilan-gold commented Jan 22, 2024

So there are a few different strains here:

  1. We need to get this stuff running in a reproducible CI env (Automate tutorial building in CI #79).
  2. We need to fix the current outputs so that the code runs (currently, some notebooks outright do not run)
  3. We need to update the outputs so they match the scanpy outputs even if it is not totally reproducible (i.e., this current PR)

Points 2. and 3. will be the blockers here for 1.10. 1. can come later. The focus for now will just be on these notebooks.

@ilan-gold ilan-gold marked this pull request as ready for review January 24, 2024 15:09
@flying-sheep
Copy link
Member

flying-sheep commented Jan 25, 2024

Overall issues are the number of warnings, which is quite high without suppression. Is this expected, and if so, how were they repressed in the past for building the docs?

I have no idea why they were displayed without a stack trace in old renderings of the notebooks. Maybe some manual setting somewhere?

By the way, those are not the warnings that will make a sphinx build fail when running sphinx in CI or with -W error. The warnings thrown during notebook creation will simply be displayed unless somehow silenced/removed

@ilan-gold
Copy link
Contributor Author

@flying-sheep I understand, I was just curious. I would be in favor of silencing them if you'd be ok with that.

@flying-sheep
Copy link
Member

flying-sheep commented Jan 25, 2024

Depends:

If there’s instances of warnings coming

  • only out of library code, like all these plotting warnings, we should file corresponding scanpy bug and silence them per-notebook in a hidden code cell at the start
  • both in library code and user code, we can silence the ones coming from library code on a case by case basis by adding hidden code cells before and after the offending cell.

Otherwise:

UserWarning: Received a view of an AnnData. Making a copy.

Should be avoided with adata[...].copy().

ConvergenceWarning: lbfgs failed to converge (status=1): STOP: TOTAL NO. of ITERATIONS REACHED LIMIT.

Should probably fixed?

I don‘t think this is a good idea basically anywhere, one can almost always be more specific

warnings.filterwarnings('ignore')

Copy link

review-notebook-app bot commented Feb 26, 2024

View / edit / reply to this conversation on ReviewNB

flying-sheep commented on 2024-02-26T16:08:01Z
----------------------------------------------------------------

So the cluster order changed because you did flavor='igraph'? If so this is fine!


ilan-gold commented on 2024-02-26T16:21:36Z
----------------------------------------------------------------

Yes!

Copy link

review-notebook-app bot commented Feb 26, 2024

View / edit / reply to this conversation on ReviewNB

flying-sheep commented on 2024-02-26T16:08:02Z
----------------------------------------------------------------

The former “B” cluster is now labelled “CD8 T”, plus some other changes … this should be fixed!


ilan-gold commented on 2024-02-26T16:23:15Z
----------------------------------------------------------------

Huh, I am not sure what happened here. The local diff was correct. It's possible something didn't push.

Copy link

review-notebook-app bot commented Feb 26, 2024

View / edit / reply to this conversation on ReviewNB

flying-sheep commented on 2024-02-26T16:08:03Z
----------------------------------------------------------------

Line #4.    warnings.filterwarnings('ignore')

This seems to be left from when we thought the display version still had them. Please remove this line and rerun.


Copy link

review-notebook-app bot commented Feb 26, 2024

View / edit / reply to this conversation on ReviewNB

flying-sheep commented on 2024-02-26T16:08:05Z
----------------------------------------------------------------

very weird that this warning is still there, is that an anndata bug?


ilan-gold commented on 2024-02-26T17:30:49Z
----------------------------------------------------------------

Nope, this cell was not run

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.

The filterwarnings needs to be removed and the cluster order fixed.

Regarding the weird “obsm setting made view into actual” thing I don‘t know what’s going on.

Copy link
Contributor Author

Yes!


View entire conversation on ReviewNB

Copy link
Contributor Author

Huh, I am not sure what happened here. The local diff was correct. It's possible something didn't push.


View entire conversation on ReviewNB

Copy link
Contributor Author

Nope, this cell was not run


View entire conversation on ReviewNB

@ilan-gold ilan-gold enabled auto-merge (squash) February 26, 2024 17:31
@ilan-gold ilan-gold merged commit d42d8e6 into scverse:master Feb 27, 2024
1 check passed
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.

2 participants