Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 8, 2024
1 parent 1fdac58 commit 9efecec
Show file tree
Hide file tree
Showing 36 changed files with 38 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/obnb/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions src/obnb/config/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Configurations used by obnb."""

from obnb.typing import Dict

__all__ = [
Expand Down
1 change: 1 addition & 0 deletions src/obnb/data/__init__.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/obnb/data/annotated_ontology/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Annotated ontology data."""

from obnb.data.annotated_ontology.diseases import (
DISEASES,
DISEASES_ExperimentsFiltered,
Expand Down
1 change: 1 addition & 0 deletions src/obnb/data/annotation/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions src/obnb/data/experimental/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
versions of the package.
"""

from obnb.data.experimental.alevinfry import AlevinFry

__all__ = [
Expand Down
1 change: 1 addition & 0 deletions src/obnb/data/network/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions src/obnb/data/ontology/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Ontology data."""

from obnb.data.ontology.gene_ontology import GeneOntology
from obnb.data.ontology.mondo import MondoDiseaseOntology

Expand Down
1 change: 1 addition & 0 deletions src/obnb/dataset/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions src/obnb/dataset/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Dataset object."""

import numpy as np
from sklearn.preprocessing import KBinsDiscretizer

Expand Down
1 change: 1 addition & 0 deletions src/obnb/dataset/dataset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Helper functions to construct processed datasets."""

import obnb.data
import obnb.label.split
from obnb.dataset.base import Dataset
Expand Down
1 change: 1 addition & 0 deletions src/obnb/dataset/dataset_dgl.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""DGL dataset object."""

import os.path as osp

try:
Expand Down
1 change: 1 addition & 0 deletions src/obnb/dataset/dataset_pyg.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""PyTorch Geometric dataset object."""

import os.path as osp

try:
Expand Down
1 change: 1 addition & 0 deletions src/obnb/ext/attnwalk.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
}
"""

from typing import Union

import networkx as nx
Expand Down
1 change: 1 addition & 0 deletions src/obnb/ext/orbital_features.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Grpahlet orbital feature extraction."""

import itertools
import multiprocessing
from functools import partial
Expand Down
1 change: 1 addition & 0 deletions src/obnb/feature/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Feature objects."""

from obnb.feature.multifeat import MultiFeatureVec
from obnb.feature.singlefeat import FeatureVec

Expand Down
1 change: 1 addition & 0 deletions src/obnb/feature/multifeat.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Multi modality feature objects."""

from itertools import chain

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions src/obnb/feature/singlefeat.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Single modality feature objects."""

import numpy as np

from obnb.feature.base import BaseFeature
Expand Down
1 change: 1 addition & 0 deletions src/obnb/graph/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions src/obnb/label/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Labelset collection with splitting and filtering utilities."""

from obnb.label import filters, split
from obnb.label.collection import LabelsetCollection

Expand Down
1 change: 1 addition & 0 deletions src/obnb/label/filters/__init__.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/obnb/label/filters/range_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def get_val_getter(self, lsc):
def val_getter(label_id):
y_all, masks = lsc.split(self.splitter, **self.kwargs)
neg_idx = lsc.entity[lsc.get_negative(label_id)]
self.logger.debug(f"{label_id = } {neg_idx = }")
self.logger.debug(f"{label_id =} {neg_idx =}")
# TODO: make label_ids to index mapping?
y = y_all[:, lsc.label_ids.index(label_id)]
min_num_pos = min_num_neg = np.inf
Expand All @@ -175,7 +175,7 @@ def val_getter(label_id):
min_num_pos = min(min_num_pos, num_pos)
if self.count_negatives:
num_neg = np.intersect1d(neg_idx, masked_idx).size
self.logger.debug(f"{num_neg = }, {masked_idx = }")
self.logger.debug(f"{num_neg =}, {masked_idx =}")
min_num_neg = min(min_num_neg, num_neg)
self.logger.info(f"{label_id}, {min_num_pos=}, {min_num_neg=}")
return min(min_num_pos, min_num_neg)
Expand Down
1 change: 1 addition & 0 deletions src/obnb/label/split/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Genearting data splits from the labelset collection."""

from obnb.label.split.holdout import (
AllHoldout,
RandomRatioHoldout,
Expand Down
1 change: 1 addition & 0 deletions src/obnb/metric/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Metric functions used for evaluation."""

from obnb.metric.standard import auroc, log2_auprc_prior, precision_at_topk

__all__ = [
Expand Down
1 change: 1 addition & 0 deletions src/obnb/metric/graphgym_metric.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Custom metrics compatible with GraphGym logger."""

from functools import wraps

import torch
Expand Down
1 change: 1 addition & 0 deletions src/obnb/metric/standard.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Standard metric extending those available in sklearn."""

from functools import wraps

try:
Expand Down
1 change: 1 addition & 0 deletions src/obnb/model_trainer/__init__.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/obnb/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Helps interface with user defined modules for OBNB pipelines.
"""

from obnb.typing import Any
from obnb.util.misc import DotDict

Expand Down
3 changes: 1 addition & 2 deletions src/obnb/transform/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,4 @@ def fullname(self) -> str:

class BaseDatasetTransform(BaseTransform, ABC):
@abstractmethod
def __call__(self, dataset):
...
def __call__(self, dataset): ...
4 changes: 2 additions & 2 deletions src/obnb/transform/node_feature.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Node feature transformation module."""

import warnings
from abc import ABC, abstractmethod

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/obnb/typing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Collection of types used in obnb."""

from typing import (
Any,
Callable,
Expand Down
1 change: 1 addition & 0 deletions src/obnb/util/checkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
a function call is valid.
"""

import os
import warnings
from typing import get_args
Expand Down
1 change: 1 addition & 0 deletions src/obnb/util/cx_explorer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utility for exploring NDEx CX data."""

import itertools
import json
from collections import defaultdict
Expand Down
1 change: 1 addition & 0 deletions src/obnb/util/logger.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Logger utils."""

import logging
import logging.config
import os
Expand Down
1 change: 1 addition & 0 deletions src/obnb/util/path.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Path utilities."""

import hashlib
import os.path as osp

Expand Down
1 change: 1 addition & 0 deletions src/obnb/util/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Version utility module for obnb."""

from obnb import config
from obnb.typing import List

Expand Down

0 comments on commit 9efecec

Please sign in to comment.