Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#405)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/adrienverge/yamllint.git: v1.30.0 → v1.32.0](https://github.com/adrienverge/yamllint.git/compare/v1.30.0...v1.32.0)
- [github.com/asottile/pyupgrade: v3.3.1 → v3.4.0](asottile/pyupgrade@v3.3.1...v3.4.0)
- [github.com/psf/black: 23.1.0 → 23.3.0](psf/black@23.1.0...23.3.0)
- [github.com/PyCQA/docformatter: v1.5.1 → v1.7.1](PyCQA/docformatter@v1.5.1...v1.7.1)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] committed May 27, 2023
1 parent 3f89fd0 commit 0abd87f
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 27 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.30.0
rev: v1.32.0
hooks:
- id: yamllint
args: [-c=.yamllint.yml]
Expand All @@ -25,18 +25,18 @@ repos:
- id: add-trailing-comma

- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
rev: v3.4.0
hooks:
- id: pyupgrade

- repo: https://github.com/psf/black
rev: 23.1.0
rev: 23.3.0
hooks:
- id: black
args: ["--safe"]

- repo: https://github.com/PyCQA/docformatter
rev: v1.5.1
rev: v1.7.1
hooks:
- id: docformatter
name: Format docstring
Expand Down
1 change: 0 additions & 1 deletion src/nleval/data/network/funcoup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class FunCoup(BaseNDExData):
The edge weights are PFC values, which is a probabilistic estimation about
whether a pair of genes are functionally coupled.
https://funcoup5.scilifelab.se/help/#Citation
"""
Expand Down
2 changes: 1 addition & 1 deletion src/nleval/feature/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def isempty(self) -> bool:

@property
def dim(self):
"""int: dimension of feature vectors."""
"""Int: dimension of feature vectors."""
return self._dim

@dim.setter
Expand Down
6 changes: 3 additions & 3 deletions src/nleval/graph/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,16 +203,16 @@ def num_nodes(self) -> int:

@property
def size(self):
"""int: number of nodes in graph."""
"""Int: number of nodes in graph."""
return self.num_nodes

@property
def num_edges(self) -> int:
"""int: Number of edges."""
"""Int: Number of edges."""
raise NotImplementedError

def isempty(self):
"""bool: true if graph is empty, indicated by empty idmap."""
"""Bool: true if graph is empty, indicated by empty idmap."""
return not self.size

def induced_subgraph(self, node_ids: List[str]):
Expand Down
2 changes: 1 addition & 1 deletion src/nleval/graph/dense.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __getitem__(self, key):

@property
def num_edges(self) -> int:
"""int: Number of edges."""
"""Int: Number of edges."""
return (self.mat != 0).sum()

@property
Expand Down
6 changes: 3 additions & 3 deletions src/nleval/graph/sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ def edge_data(self) -> EdgeData:

@property
def weighted(self):
"""bool: Whether weights (3rd column in edgelist) are available."""
"""Bool: Whether weights (3rd column in edgelist) are available."""
return self._weighted

@property
def directed(self):
"""bool: Indicate whether edges are directed or not."""
"""Bool: Indicate whether edges are directed or not."""
return self._directed

@weighted.setter
Expand All @@ -69,7 +69,7 @@ def directed(self, val):

@property
def num_edges(self) -> int:
"""int: Number of edges."""
"""Int: Number of edges."""
return sum(len(nbrs) for nbrs in self.edge_data)

def __getitem__(self, key: Union[str, List[str]]):
Expand Down
3 changes: 2 additions & 1 deletion src/nleval/label/filters/nonred.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ class LabelsetNonRedFilter(BaseFilter):
"""Filter out redundant labelsets in a labelset collection.
The detailed procedure can be found in the supplementary data of
https://doi.org/10.1093/bioinformatics/btaa150 In brief, given a labelset
https://doi.org/10.1093/bioinformatics/btaa150
In brief, given a labelset
collection, a graph of labelsets if first constructed based on the
redundancy score function of interest. Here, we use the combination of
Jaccard index and overlap coefficient. Then, for each connected component in
Expand Down
2 changes: 1 addition & 1 deletion src/nleval/model/label_propagation.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def __init__(

@property
def beta(self) -> float:
"""float: restart parameter."""
"""Float: restart parameter."""
return self._beta

@beta.setter
Expand Down
2 changes: 1 addition & 1 deletion src/nleval/model_trainer/gnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(

@property
def metric_best(self):
"""str: Metric used for determining the best model."""
"""Str: Metric used for determining the best model."""
return self._metric_best

@metric_best.setter
Expand Down
2 changes: 1 addition & 1 deletion src/nleval/util/idhandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def lst(self):

@property
def size(self):
"""int: number of IDs in list."""
"""Int: number of IDs in list."""
return len(self._lst)

def copy(self):
Expand Down
12 changes: 2 additions & 10 deletions test/test_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ def setUpClass(cls):
cls.case = test_case1()

def check_graph(self, graph):
"""compare graph with data, true if identical."""
"""Compare graph with data, true if identical."""
mat = self.case.data_mat[:, 1:]
IDlst = [str(int(i)) for i in self.case.data_mat[:, 0]]
for idx1, node_id1 in enumerate(IDlst):
Expand Down Expand Up @@ -1120,15 +1120,7 @@ def test_restrict_to_branch(self):
self.assertRaises(IDNotExistError, graph.restrict_to_branch, "g")

def test_read_obo(self):
r"""
a
/ | \
b c (x, y) d
| \ /
e [z] f
"""
r"""A / | \ b c (x, y) d | \ / e [z] f."""
obo_path = osp.join(SAMPLE_DATA_DIR, "toy_ontology.obo")
with self.subTest(xref_prefix=None):
# Do not capture xref when xref_prefix is unset
Expand Down

0 comments on commit 0abd87f

Please sign in to comment.