Skip to content

Commit

Permalink
Run linting changes (isort and black) to pass Github linting test
Browse files Browse the repository at this point in the history
  • Loading branch information
nanglo123 committed Aug 12, 2024
1 parent 8dc1918 commit 616f162
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/pyobo/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import bioversions

from ..utils.path import prefix_directory_join
from ..constants import VERSION_PINS
from ..utils.path import prefix_directory_join

__all__ = [
"get_version",
Expand Down
35 changes: 16 additions & 19 deletions src/pyobo/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,15 @@

"""Constants for PyOBO."""

import json
import logging
import re
import os
import json
import click
import re

import click
import pystow

__all__ = [
"RAW_DIRECTORY",
"DATABASE_DIRECTORY",
"SPECIES_REMAPPING",
"VERSION_PINS"
]
__all__ = ["RAW_DIRECTORY", "DATABASE_DIRECTORY", "SPECIES_REMAPPING", "VERSION_PINS"]

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -112,18 +107,20 @@
VERSION_PINS = json.loads(VERSION_PINS_STR)
for k, v in VERSION_PINS.items():
if not isinstance(k, str) or not isinstance(v, str):
logger.error("The prefix and version name must both be "
"strings")
logger.error("The prefix and version name must both be " "strings")
VERSION_PINS = {}
break
except ValueError as e:
logger.error("The value for the environment variable VERSION_PINS"
" must be a valid JSON string")
logger.error(
"The value for the environment variable VERSION_PINS" " must be a valid JSON string"
)
VERSION_PINS = {}

click.echo(f"These are the resource versions that are pinned.\n{VERSION_PINS}. "
f"\nPyobo will download the latest version of a resource if it's "
f"not pinned.\nIf you want to use a specific version of a "
f"resource, edit your VERSION_PINS environmental "
f"variable which is a JSON string to include a prefix and version "
f"name.")
click.echo(
f"These are the resource versions that are pinned.\n{VERSION_PINS}. "
f"\nPyobo will download the latest version of a resource if it's "
f"not pinned.\nIf you want to use a specific version of a "
f"resource, edit your VERSION_PINS environmental "
f"variable which is a JSON string to include a prefix and version "
f"name."
)
2 changes: 1 addition & 1 deletion src/pyobo/sources/antibodyregistry.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from tqdm.auto import tqdm

from pyobo import Obo, Term
from pyobo.utils.path import ensure_df
from pyobo.api.utils import get_version
from pyobo.utils.path import ensure_df

__all__ = [
"AntibodyRegistryGetter",
Expand Down
2 changes: 1 addition & 1 deletion src/pyobo/sources/biogrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

import pandas as pd

from pyobo.api.utils import get_version
from pyobo.resources.ncbitaxon import get_ncbitaxon_id
from pyobo.utils.cache import cached_mapping
from pyobo.utils.path import ensure_df, prefix_directory_join
from pyobo.api.utils import get_version

PREFIX = "biogrid"
BASE_URL = "https://downloads.thebiogrid.org/Download/BioGRID/Release-Archive"
Expand Down
3 changes: 1 addition & 2 deletions src/pyobo/sources/hgnc.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
from operator import attrgetter
from typing import DefaultDict, Dict, Iterable, Optional


from tabulate import tabulate
from tqdm.auto import tqdm

from pyobo.api.utils import get_version
from pyobo.struct import (
Obo,
Reference,
Expand All @@ -29,7 +29,6 @@
)
from pyobo.struct.typedef import exact_match
from pyobo.utils.path import ensure_path, prefix_directory_join
from pyobo.api.utils import get_version

__all__ = [
"HGNCGetter",
Expand Down
2 changes: 1 addition & 1 deletion src/pyobo/sources/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

from tqdm.auto import tqdm

from pyobo.api.utils import get_version
from pyobo.identifier_utils import standardize_ec
from pyobo.struct import Obo, Reference, Synonym, Term
from pyobo.utils.cache import cached_json, cached_mapping
from pyobo.utils.io import parse_xml_gz
from pyobo.utils.path import ensure_path, prefix_directory_join
from pyobo.api.utils import get_version

__all__ = [
"MeSHGetter",
Expand Down
3 changes: 1 addition & 2 deletions src/pyobo/sources/pubchem.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@
import logging
from typing import Iterable, Mapping, Optional


import pandas as pd
from bioregistry.utils import removeprefix
from tqdm.auto import tqdm

from ..api import get_name_id_mapping
from ..api.utils import get_version
from ..struct import Obo, Reference, Synonym, Term
from ..utils.iter import iterate_gzips_together
from ..utils.path import ensure_df, ensure_path
from ..api.utils import get_version

__all__ = [
"PubChemCompoundGetter",
Expand Down
2 changes: 1 addition & 1 deletion src/pyobo/sources/rhea.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import pystow

from pyobo.api.utils import get_version
from pyobo.struct import Obo, Reference, Term
from pyobo.struct.typedef import (
TypeDef,
Expand All @@ -20,7 +21,6 @@
reaction_enabled_by_molecular_function,
)
from pyobo.utils.path import ensure_df
from pyobo.api.utils import get_version

if TYPE_CHECKING:
import rdflib
Expand Down
2 changes: 1 addition & 1 deletion src/pyobo/sources/uniprot/uniprot.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
from tqdm.auto import tqdm

from pyobo import Obo, Reference
from pyobo.api.utils import get_version
from pyobo.constants import RAW_MODULE
from pyobo.identifier_utils import standardize_ec
from pyobo.struct import Term, derives_from, enables, from_species, participates_in
from pyobo.struct.typedef import gene_product_of, located_in, molecularly_interacts_with
from pyobo.utils.io import open_reader
from pyobo.api.utils import get_version

PREFIX = "uniprot"
BASE_URL = "https://rest.uniprot.org/uniprotkb/stream"
Expand Down
2 changes: 1 addition & 1 deletion src/pyobo/struct/struct.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
term_replaced_by,
)
from .utils import comma_separate, obo_escape_slim
from ..api.utils import get_version
from ..constants import (
DATE_FORMAT,
NCBITAXON_PREFIX,
Expand All @@ -68,7 +69,6 @@
from ..utils.io import multidict, write_iterable_tsv
from ..utils.misc import obo_to_owl
from ..utils.path import get_prefix_obo_path, prefix_directory_join
from ..api.utils import get_version

__all__ = [
"Synonym",
Expand Down
2 changes: 1 addition & 1 deletion src/pyobo/xrefdb/sources/chembl.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import pandas as pd

from pyobo.api.utils import get_version
from pyobo.constants import (
PROVENANCE,
SOURCE_ID,
Expand All @@ -15,7 +16,6 @@
XREF_COLUMNS,
)
from pyobo.utils.path import ensure_df
from pyobo.api.utils import get_version

CHEMBL_COMPOUND_PREFIX = "chembl.compound"
CHEMBL_TARGET_PREFIX = "chembl.target"
Expand Down
2 changes: 1 addition & 1 deletion src/pyobo/xrefdb/sources/pubchem.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

import pandas as pd

from ...api.utils import get_version
from ...constants import XREF_COLUMNS
from ...sources.pubchem import _get_pubchem_extras_url, get_pubchem_id_to_mesh_id
from ...api.utils import get_version

__all__ = [
"get_pubchem_mesh_df",
Expand Down

0 comments on commit 616f162

Please sign in to comment.