Skip to content

Commit

Permalink
update __init__.py (#308)
Browse files Browse the repository at this point in the history
* Add test_i304_regulates.py

* update version

* minor

* update __init__.py
  • Loading branch information
tanghaibao authored Nov 9, 2024
1 parent 60479ca commit 2dfb6af
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
14 changes: 7 additions & 7 deletions goatools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
from datetime import datetime
from pkg_resources import get_distribution, DistributionNotFound
from importlib.metadata import version, PackageNotFoundError

__author__ = ("Haibao Tang", "DV Klopfenstein")
__copyright__ = "Copyright (C) 2009-{}, Haibao Tang, DV Klopfenstein".format(
datetime.now().year
__copyright__ = (
f"Copyright (C) 2009-{datetime.now().year}, Haibao Tang, DV Klopfenstein"
)
__email__ = "[email protected]"
__license__ = "BSD"
__status__ = "Development"

try:
VERSION = get_distribution(__name__).version
except DistributionNotFound: # pragma: no cover
VERSION = version(__name__)
except PackageNotFoundError: # pragma: no cover
try:
from .version import version as VERSION # noqa
except ImportError: # pragma: no cover
except ImportError as exc: # pragma: no cover
raise ImportError(
"Failed to find (autogenerated) version.py. "
"This might be because you are installing from GitHub's tarballs, "
"use the PyPI ones."
)
) from exc
__version__ = VERSION
15 changes: 15 additions & 0 deletions tests/test_i304_regulates.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from goatools.gosubdag.gosubdag import GoSubDag
from goatools.obo_parser import GODag


def test_i304_regulates():
godag = GODag("go-basic.obo", optional_attrs=["relationship"])
optional_relationships = {
"regulates",
"negatively_regulates",
"positively_regulates",
}
anc = GoSubDag(
["GO:0019222"], godag, optional_relationships, prt=None
).rcntobj.go2ancestors["GO:0019222"]
assert len(anc) == 4

0 comments on commit 2dfb6af

Please sign in to comment.