-
Notifications
You must be signed in to change notification settings - Fork 274
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: Export samtools wrappers #1306
Conversation
Ideally such documentation would be in doc/developer.rst or would be unnecessary, but neither seems to be the case. Me, I generally build with With this I could verify whether your PR solves the problem. Unfortunately it does not — faidx: pysam.utils.PysamDispatcher
# etc |
Personally I'd like to deprecate having the samtools subcommands in the root import pysam.bcftools
pysam.bcftools.view(…) And the samtools subcommands can be used similarly: import pysam.samtools
pysam.samtools.view(…) (And both of the above are type hinted appropriately.) Additionally at present the following also work for samtools: import pysam
pysam.samtools.view(…)
pysam.view(…) Thus the samtools subcommands are available after plain If we also deprecated having |
@tfenne and I are both in favor of that deprecation. 🙂 |
Cheers. In the meantime, I've figured out how to get the typechecking to work — alternative PR incoming soon. |
Turns out this type checking is determined by pysam/samtools.py's definition of Your PR puts it back, but mypy still doesn't understand it. I think this has something to do with the complexity of the code there, because PR #1315 fixes it by setting Thanks for reporting this issue (and trying to fix it). I'd prefer not to add the samtools subcommands to pysam/__init__.py's Closing as superseded by PR #1315, which you may be interested in looking at. |
pysam
does not currently export the various wrapper functions in thesamtools
module, resulting in type-checking errors.e.g.
I've followed the pattern implemented in the other modules, exporting attributes in a module-specific
__all__
declaration and then adding this list to the package's__all__
.I believe this PR addresses the problem, but I'm unable to verify - when I install the updated package locally with
pip install -e
,mypy
cannot find the type stubs forpysam
. (As an aside - is there aCONTRIBUTING
or other documentation for local install/testing?)Thanks!