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

Ensure essential packages are not detached! #402

Merged
merged 5 commits into from
Aug 7, 2024

Conversation

zhongzheng1999
Copy link
Contributor

In this branch, I removed the part detaching packages in scib.pp.normalize because it would lead to unpredictable errors when using rpy2 to run R code.
After learning from my own experience, I want to advise against detaching R packages casually. Instead, after deleting rm(list=ls()), running gc() usually suffices.
A simple example: in the final part of scib.pp.normalize, detaching most R packages, including scran and its dependency package S4Vector, would result in errors such as "cannot coerce class 'integer' to a DataFrame" if a loop code block is set up. Even if you reload scran (which depends on S4Vector) or S4Vector, the error persists and can only be resolved by restarting your kernel. Next, I'll demonstrate this issue with a simple example.

example.md

Ensure essential packages are not detached.
@mumichae mumichae requested review from LuckyMD and removed request for xlancelottx April 17, 2024 18:51
@mumichae mumichae merged commit 3d982c4 into theislab:main Aug 7, 2024
10 checks passed
Copy link

codecov bot commented Nov 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 54.66%. Comparing base (9271d92) to head (afbaf42).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #402      +/-   ##
==========================================
+ Coverage   54.60%   54.66%   +0.06%     
==========================================
  Files          22       22              
  Lines        1683     1681       -2     
==========================================
  Hits          919      919              
+ Misses        764      762       -2     
Flag Coverage Δ
unittests 54.66% <ø> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
scib/preprocessing.py 19.06% <ø> (+0.10%) ⬆️

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