diff --git a/src/obnb/__init__.py b/src/obnb/__init__.py index 14702bdf..6a4dc47f 100644 --- a/src/obnb/__init__.py +++ b/src/obnb/__init__.py @@ -1,4 +1,5 @@ """Collection of network learning evaluation utilities.""" + from obnb import graph, label, model_trainer from obnb.dataset import Dataset, OpenBiomedNetBench from obnb.util.checkers import checkVersion diff --git a/src/obnb/config/__init__.py b/src/obnb/config/__init__.py index b43fbf65..cf18b0cd 100644 --- a/src/obnb/config/__init__.py +++ b/src/obnb/config/__init__.py @@ -1,4 +1,5 @@ """Configurations used by obnb.""" + from obnb.typing import Dict __all__ = [ diff --git a/src/obnb/data/__init__.py b/src/obnb/data/__init__.py index 926947e2..dd0e512a 100644 --- a/src/obnb/data/__init__.py +++ b/src/obnb/data/__init__.py @@ -1,4 +1,5 @@ """Interface with various databases to retrieve data.""" + from obnb.data import annotated_ontology, annotation, network, ontology from obnb.data.annotated_ontology import ( DISEASES, diff --git a/src/obnb/data/annotated_ontology/__init__.py b/src/obnb/data/annotated_ontology/__init__.py index 2ebbf6c4..e8905502 100644 --- a/src/obnb/data/annotated_ontology/__init__.py +++ b/src/obnb/data/annotated_ontology/__init__.py @@ -1,4 +1,5 @@ """Annotated ontology data.""" + from obnb.data.annotated_ontology.diseases import ( DISEASES, DISEASES_ExperimentsFiltered, diff --git a/src/obnb/data/annotation/__init__.py b/src/obnb/data/annotation/__init__.py index ab2956c6..76ed4807 100644 --- a/src/obnb/data/annotation/__init__.py +++ b/src/obnb/data/annotation/__init__.py @@ -1,4 +1,5 @@ """Annotation data.""" + from obnb.data.annotation.diseases import DISEASESAnnotation from obnb.data.annotation.disgenet import DisGeNETAnnotation from obnb.data.annotation.gene_ontology import GeneOntologyAnnotation diff --git a/src/obnb/data/experimental/__init__.py b/src/obnb/data/experimental/__init__.py index 88ac3765..cb241081 100644 --- a/src/obnb/data/experimental/__init__.py +++ b/src/obnb/data/experimental/__init__.py @@ -8,6 +8,7 @@ versions of the package. """ + from obnb.data.experimental.alevinfry import AlevinFry __all__ = [ diff --git a/src/obnb/data/network/__init__.py b/src/obnb/data/network/__init__.py index 343999eb..72c3fd22 100644 --- a/src/obnb/data/network/__init__.py +++ b/src/obnb/data/network/__init__.py @@ -1,4 +1,5 @@ """Network data.""" + from obnb.data.network.biogrid import BioGRID from obnb.data.network.bioplex import BioPlex from obnb.data.network.comppi import ComPPIHumanInt diff --git a/src/obnb/data/ontology/__init__.py b/src/obnb/data/ontology/__init__.py index 0190bef6..44fa3376 100644 --- a/src/obnb/data/ontology/__init__.py +++ b/src/obnb/data/ontology/__init__.py @@ -1,4 +1,5 @@ """Ontology data.""" + from obnb.data.ontology.gene_ontology import GeneOntology from obnb.data.ontology.mondo import MondoDiseaseOntology diff --git a/src/obnb/dataset/__init__.py b/src/obnb/dataset/__init__.py index e8e14079..fe9727b3 100644 --- a/src/obnb/dataset/__init__.py +++ b/src/obnb/dataset/__init__.py @@ -1,4 +1,5 @@ """Dataset objects.""" + from obnb.dataset.base import Dataset from obnb.dataset.dataset import OpenBiomedNetBench from obnb.dataset.dataset_dgl import OpenBiomedNetBenchDGL diff --git a/src/obnb/dataset/base.py b/src/obnb/dataset/base.py index 39eddfee..1bf4f1d7 100644 --- a/src/obnb/dataset/base.py +++ b/src/obnb/dataset/base.py @@ -1,4 +1,5 @@ """Dataset object.""" + import numpy as np from sklearn.preprocessing import KBinsDiscretizer diff --git a/src/obnb/dataset/dataset.py b/src/obnb/dataset/dataset.py index 660e8448..c72dc83a 100644 --- a/src/obnb/dataset/dataset.py +++ b/src/obnb/dataset/dataset.py @@ -1,4 +1,5 @@ """Helper functions to construct processed datasets.""" + import obnb.data import obnb.label.split from obnb.dataset.base import Dataset diff --git a/src/obnb/dataset/dataset_dgl.py b/src/obnb/dataset/dataset_dgl.py index 6e904812..7e7a53f1 100644 --- a/src/obnb/dataset/dataset_dgl.py +++ b/src/obnb/dataset/dataset_dgl.py @@ -1,4 +1,5 @@ """DGL dataset object.""" + import os.path as osp try: diff --git a/src/obnb/dataset/dataset_pyg.py b/src/obnb/dataset/dataset_pyg.py index fb3aee91..a3071563 100644 --- a/src/obnb/dataset/dataset_pyg.py +++ b/src/obnb/dataset/dataset_pyg.py @@ -1,4 +1,5 @@ """PyTorch Geometric dataset object.""" + import os.path as osp try: diff --git a/src/obnb/ext/attnwalk.py b/src/obnb/ext/attnwalk.py index 76f7793f..a965e68d 100644 --- a/src/obnb/ext/attnwalk.py +++ b/src/obnb/ext/attnwalk.py @@ -11,6 +11,7 @@ } """ + from typing import Union import networkx as nx diff --git a/src/obnb/ext/orbital_features.py b/src/obnb/ext/orbital_features.py index 743a6aa9..0b0de04d 100644 --- a/src/obnb/ext/orbital_features.py +++ b/src/obnb/ext/orbital_features.py @@ -1,4 +1,5 @@ """Grpahlet orbital feature extraction.""" + import itertools import multiprocessing from functools import partial diff --git a/src/obnb/feature/__init__.py b/src/obnb/feature/__init__.py index 15e3855a..1820407e 100644 --- a/src/obnb/feature/__init__.py +++ b/src/obnb/feature/__init__.py @@ -1,4 +1,5 @@ """Feature objects.""" + from obnb.feature.multifeat import MultiFeatureVec from obnb.feature.singlefeat import FeatureVec diff --git a/src/obnb/feature/multifeat.py b/src/obnb/feature/multifeat.py index 58e40aae..29bec19c 100644 --- a/src/obnb/feature/multifeat.py +++ b/src/obnb/feature/multifeat.py @@ -1,4 +1,5 @@ """Multi modality feature objects.""" + from itertools import chain import numpy as np diff --git a/src/obnb/feature/singlefeat.py b/src/obnb/feature/singlefeat.py index 42907dba..7a7d3f74 100644 --- a/src/obnb/feature/singlefeat.py +++ b/src/obnb/feature/singlefeat.py @@ -1,4 +1,5 @@ """Single modality feature objects.""" + import numpy as np from obnb.feature.base import BaseFeature diff --git a/src/obnb/graph/__init__.py b/src/obnb/graph/__init__.py index 370a32be..378b3f03 100644 --- a/src/obnb/graph/__init__.py +++ b/src/obnb/graph/__init__.py @@ -1,4 +1,5 @@ """Graph and feature vector objects.""" + from obnb.graph.dense import DenseGraph from obnb.graph.ontology import OntologyGraph from obnb.graph.sparse import DirectedSparseGraph, SparseGraph diff --git a/src/obnb/label/__init__.py b/src/obnb/label/__init__.py index 8950654a..c4f25195 100644 --- a/src/obnb/label/__init__.py +++ b/src/obnb/label/__init__.py @@ -1,4 +1,5 @@ """Labelset collection with splitting and filtering utilities.""" + from obnb.label import filters, split from obnb.label.collection import LabelsetCollection diff --git a/src/obnb/label/filters/__init__.py b/src/obnb/label/filters/__init__.py index 9329b110..b5689547 100644 --- a/src/obnb/label/filters/__init__.py +++ b/src/obnb/label/filters/__init__.py @@ -1,4 +1,5 @@ """Filter objecst for preprocessing the labelset collection.""" + from obnb.label.filters.base import Compose from obnb.label.filters.existence_filter import ( EntityExistenceFilter, diff --git a/src/obnb/label/split/__init__.py b/src/obnb/label/split/__init__.py index 2657e2ea..204e5dc8 100644 --- a/src/obnb/label/split/__init__.py +++ b/src/obnb/label/split/__init__.py @@ -1,4 +1,5 @@ """Genearting data splits from the labelset collection.""" + from obnb.label.split.holdout import ( AllHoldout, RandomRatioHoldout, diff --git a/src/obnb/metric/__init__.py b/src/obnb/metric/__init__.py index 3db2080f..be2f4c9b 100644 --- a/src/obnb/metric/__init__.py +++ b/src/obnb/metric/__init__.py @@ -1,4 +1,5 @@ """Metric functions used for evaluation.""" + from obnb.metric.standard import auroc, log2_auprc_prior, precision_at_topk __all__ = [ diff --git a/src/obnb/metric/graphgym_metric.py b/src/obnb/metric/graphgym_metric.py index 1578ee5c..d03af384 100644 --- a/src/obnb/metric/graphgym_metric.py +++ b/src/obnb/metric/graphgym_metric.py @@ -1,4 +1,5 @@ """Custom metrics compatible with GraphGym logger.""" + from functools import wraps import torch diff --git a/src/obnb/metric/standard.py b/src/obnb/metric/standard.py index 070344c2..5e6acb55 100644 --- a/src/obnb/metric/standard.py +++ b/src/obnb/metric/standard.py @@ -1,4 +1,5 @@ """Standard metric extending those available in sklearn.""" + from functools import wraps try: diff --git a/src/obnb/model_trainer/__init__.py b/src/obnb/model_trainer/__init__.py index 86840734..593cc912 100644 --- a/src/obnb/model_trainer/__init__.py +++ b/src/obnb/model_trainer/__init__.py @@ -1,4 +1,5 @@ """Unified framework for training different types of models.""" + from obnb.model_trainer.label_propagation import LabelPropagationTrainer from obnb.model_trainer.supervised_learning import ( MultiSupervisedLearningTrainer, diff --git a/src/obnb/registry.py b/src/obnb/registry.py index 8f84bef4..d3c95362 100644 --- a/src/obnb/registry.py +++ b/src/obnb/registry.py @@ -3,6 +3,7 @@ Helps interface with user defined modules for OBNB pipelines. """ + from obnb.typing import Any from obnb.util.misc import DotDict diff --git a/src/obnb/transform/base.py b/src/obnb/transform/base.py index 30be8d8f..1fa2a061 100644 --- a/src/obnb/transform/base.py +++ b/src/obnb/transform/base.py @@ -33,5 +33,4 @@ def fullname(self) -> str: class BaseDatasetTransform(BaseTransform, ABC): @abstractmethod - def __call__(self, dataset): - ... + def __call__(self, dataset): ... diff --git a/src/obnb/transform/node_feature.py b/src/obnb/transform/node_feature.py index 6ddc4d02..1d7f82e8 100644 --- a/src/obnb/transform/node_feature.py +++ b/src/obnb/transform/node_feature.py @@ -1,4 +1,5 @@ """Node feature transformation module.""" + import warnings from abc import ABC, abstractmethod @@ -50,8 +51,7 @@ def __call__(self, dataset): dataset.feature = FeatureVec.from_mat(feat, node_ids) @abstractmethod - def _prepare_feat(self, dataset) -> np.ndarray: - ... + def _prepare_feat(self, dataset) -> np.ndarray: ... @register_nodefeat diff --git a/src/obnb/typing.py b/src/obnb/typing.py index 432a8a3f..bf81068b 100644 --- a/src/obnb/typing.py +++ b/src/obnb/typing.py @@ -1,4 +1,5 @@ """Collection of types used in obnb.""" + from typing import ( Any, Callable, diff --git a/src/obnb/util/checkers.py b/src/obnb/util/checkers.py index 81fbf4b2..f2ae1872 100755 --- a/src/obnb/util/checkers.py +++ b/src/obnb/util/checkers.py @@ -4,6 +4,7 @@ a function call is valid. """ + import os import warnings from typing import get_args diff --git a/src/obnb/util/cx_explorer.py b/src/obnb/util/cx_explorer.py index f6f24a3b..2aee4651 100644 --- a/src/obnb/util/cx_explorer.py +++ b/src/obnb/util/cx_explorer.py @@ -1,4 +1,5 @@ """Utility for exploring NDEx CX data.""" + import itertools import json from collections import defaultdict diff --git a/src/obnb/util/logger.py b/src/obnb/util/logger.py index ebc0dc7e..3d4888e1 100644 --- a/src/obnb/util/logger.py +++ b/src/obnb/util/logger.py @@ -1,4 +1,5 @@ """Logger utils.""" + import logging import logging.config import os diff --git a/src/obnb/util/path.py b/src/obnb/util/path.py index 878b9d61..4cd8e988 100644 --- a/src/obnb/util/path.py +++ b/src/obnb/util/path.py @@ -1,4 +1,5 @@ """Path utilities.""" + import hashlib import os.path as osp diff --git a/src/obnb/util/version.py b/src/obnb/util/version.py index 83d1ce15..a31761a3 100644 --- a/src/obnb/util/version.py +++ b/src/obnb/util/version.py @@ -1,4 +1,5 @@ """Version utility module for obnb.""" + from obnb import config from obnb.typing import List