Skip to content

Commit

Permalink
clear flake8 & pylint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
svirpioj committed Jan 3, 2024
1 parent 222459d commit 3345dda
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 8 additions & 1 deletion opusfilter/autogen_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
logger = logging.getLogger(__name__)


# allow scikit-learn style code here
# pylint: disable=C0103,W0613
class ArcProjection(BaseEstimator, TransformerMixin):
"""Project data to two dimensions using evenly distributed unit vectors
Expand All @@ -48,6 +50,7 @@ class ArcProjection(BaseEstimator, TransformerMixin):
"""

def __init__(self, arc='auto'):
self.components_ = None
self.n_components_ = 2
self.arc = arc

Expand Down Expand Up @@ -107,7 +110,7 @@ def costf(matrix):
matrix = np.array([
[np.cos(idx * dist), np.sin(idx * dist)] for idx in range(n_features)
])
_, best_m, best_cost = self._best_permutation(matrix.copy(), n_features, costf)
_, best_m, best_cost = self._best_permutation(matrix.copy(), n_features, costf)
logger.debug("fcorr:\n%s", corrmat.round(3))
logger.debug("vdist:\n%s", (best_m @ best_m.T).round(3))
logger.debug("diff:\n%s", (corrmat - best_m @ best_m.T).round(3))
Expand Down Expand Up @@ -161,8 +164,11 @@ def transform(self, X):
)

return X @ self.components_.T
# pylint: enable=C0103,W0613


# Would need some refactoring, but disable pylint's "too many" warnings for now.
# pylint: disable=R0902,R0912,R0914,R0915
class ScoreClusters:
"""Cluster segments by filter scores
Expand Down Expand Up @@ -337,3 +343,4 @@ def plot(self, plt, path=None, apply_rejects=True, projection='arc'):
if path is not None:
fig_clean.savefig(os.path.join(path, 'histogram_clean.pdf'))
fig_noisy.savefig(os.path.join(path, 'histogram_noisy.pdf'))
# pylint: enable=R0902,R0912,R0914,R0915
1 change: 0 additions & 1 deletion opusfilter/opusfilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import random
import tempfile
from itertools import chain
import shutil

import json
from tqdm import tqdm
Expand Down

0 comments on commit 3345dda

Please sign in to comment.