-
Notifications
You must be signed in to change notification settings - Fork 67
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 Ensembl release 83 #135
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,9 @@ | |
""" | ||
from __future__ import absolute_import | ||
|
||
from pyensembl import ensembl_grch38 as ensembl | ||
from pyensembl import cached_release | ||
|
||
ensembl = cached_release(77) | ||
|
||
def test_exon_object_by_id(): | ||
""" | ||
|
@@ -25,8 +27,8 @@ def test_exon_object_by_id(): | |
|
||
def test_exon_object_by_id_on_negative_strand(): | ||
""" | ||
test_exon_object_by_id : check properties of exon 1 from CXCR3 when looked | ||
up by ID in Ensembl 77. | ||
test_exon_object_by_id_on_negative_strand : check properties of exon 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Curious why you're just repeating the name of the test? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's to combat something annoying that nose does when you're running tests. If a test has a docstring then the name nose shows gets replaced by the docstring, which then obscures which test it's running. |
||
from CXCR3 when looked up by ID in Ensembl 77. | ||
""" | ||
exon = ensembl.exon_by_id("ENSE00001817013") | ||
assert exon.gene_name == "CXCR3", \ | ||
|
@@ -69,3 +71,22 @@ def test_exon_object_at_locus_on_negative_strand(): | |
assert exon.on_negative_strand | ||
assert exon.start <= 71618517, "Unexpected exon start: %s" % exon.start | ||
assert exon.end >= 71618517, "Unexpected exon end: %s" % exon.end | ||
|
||
def test_exon_basic_properties_str(): | ||
exon = ensembl.exon_by_id("ENSE00001817013") | ||
assert isinstance(str(exon), str) | ||
assert isinstance(repr(exon), str) | ||
# for now we're assuming that __repr__ and __str__ do the same thing, | ||
# if we later change that assumption we should do so explicitly and | ||
# change this test | ||
assert str(exon) == repr(exon), "%s != %s" % (str(exon), repr(exon)) | ||
|
||
def test_exon_basic_properties_hash(): | ||
exon = ensembl.exon_by_id("ENSE00001817013") | ||
assert isinstance(hash(exon), int), \ | ||
"Hash function returns %s instead of int" % ( | ||
type(hash(exon),)) | ||
assert hash(exon) == hash(exon), "Hash function is non-deterministic!" | ||
other_exon = ensembl.exon_by_id("ENSE00003464041") | ||
assert exon != other_exon | ||
assert hash(exon) != hash(other_exon) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know much about
__all__
other than some brief Googling; any particular reason you decided to add this now?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it might be slightly better package etiquette to restrict which things get imported as '*'. I'm not totally sure if it's necessary though.
https://docs.python.org/2/tutorial/modules.html#importing-from-a-package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍