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

update __init__.py #308

Merged
merged 4 commits into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading