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 docs rendering for classes using lazy import #651

Merged
merged 6 commits into from
Sep 1, 2024
Merged

Conversation

Lilly-May
Copy link
Collaborator

@Lilly-May Lilly-May commented Aug 30, 2024

Issue

The lazy_import introduced in PR #647 solves the issue of a failed pertpy import when not all optional dependencies are installed. However, since the classes were wrapped in multiple functions, they were no longer correctly displayed in the docs.

Description of changes

  • Updated the implementation of the lazy_import method: Instead of wrapping the class in a function, I created a Placeholder class that raises an ImportError when called. This should be equivalent to the previous implementation functionality-wise. I verified that one can import pertpy when optional dependencies are not installed in the environment, and that the docs builds correctly as long as the optional dependencies are installed.
  • Removed python version descriptions from the Apple Silicon installation guide, as including them would only cause the guide to be outdated
  • Fixed SCGEN display in docs/usage.md (updated method name)
  • Removed edger from the required packages in tools/__init__. EdgeR is installed/imported via rpy2, so checking that edger can be directly imported will fail, making the EdgeR implementation in pertpy unusable.
  • With the new anndata 0.10.9 release, anndata only allows numpy.matrix classes to be stored in varm/obsm (see 3rd bullet point of release notes here). This caused the cinemaot and PyDeseq2 tests to fail. I resolved the former by storing a numpy array instead of a JAX array in the anndata. The latter issue is due to a bug in the pydeseq package itself, so I can't resolve that one, but I have opened an issue here.

@github-actions github-actions bot added bug Something isn't working chore labels Aug 30, 2024
@Lilly-May Lilly-May marked this pull request as ready for review September 1, 2024 19:13
@Lilly-May Lilly-May requested a review from Zethson September 1, 2024 19:13
Copy link
Member

@Zethson Zethson left a comment

Choose a reason for hiding this comment

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

Thank you very much!

@Zethson Zethson merged commit 5874fd1 into main Sep 1, 2024
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working chore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants