Skip to content

Commit

Permalink
update obo_optional_attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
tanghaibao committed Sep 28, 2023
1 parent 1bf64e1 commit 0ccab64
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions goatools/godag/obo_optional_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import re
import collections as cx

from ..base import logger


class OboOptionalAttrs:
"""Manage optional GO-DAG attributes."""
Expand Down Expand Up @@ -258,13 +260,14 @@ def get_optional_attrs(optional_attrs, attrs_opt):
try:
iter(optional_attrs)
except TypeError:
pat = (
"**FATAL: GODag's optional_attrs MUST BE A SET CONTAINING ANY OF: {ATTRS}\n"
logger.fatal(
"GODag's optional_attrs MUST BE A SET CONTAINING ANY OF: %s\n"
" "
"**FATAL: BAD GODag optional_attrs({BADVAL})"
"BAD GODag optional_attrs(%s)",
" ".join(attrs_opt),
optional_attrs,
)
msg = pat.format(ATTRS=" ".join(attrs_opt), BADVAL=optional_attrs)
raise TypeError(msg)
exit()
getnm = lambda aopt: aopt if aopt != "defn" else "def"
opts = None
if isinstance(optional_attrs, str) and optional_attrs in attrs_opt:
Expand Down

0 comments on commit 0ccab64

Please sign in to comment.