Skip to content

Commit

Permalink
refactor: flake8 ignore rather than select
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrugman committed May 16, 2022
1 parent 254564c commit 25887dd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Expand Up @@ -16,7 +16,7 @@ repos:
additional_dependencies:
- flake8-comprehensions
- tryceratops
args: [ "--select=E9,F63,F7,F82,C4,F401,TR004,TC200,TC201,TC202"]
args: [ "--ignore=E501,E203,W503,TC003,TC101,TC300"]
- repo: https://github.com/asottile/pyupgrade
rev: v2.32.1
hooks:
Expand Down
4 changes: 2 additions & 2 deletions popmon/stats/numpy.py
Expand Up @@ -72,8 +72,8 @@ def replace(bl):
# convert string to boolean
bin_labels = np.array([replace(bl) for bl in bin_labels])

sum_true = np.sum([be for bl, be in zip(bin_labels, bin_entries) if bl == True])
sum_false = np.sum([be for bl, be in zip(bin_labels, bin_entries) if bl == False])
sum_true = np.sum([be for bl, be in zip(bin_labels, bin_entries) if bl])
sum_false = np.sum([be for bl, be in zip(bin_labels, bin_entries) if not bl])
sum_entries = sum_true + sum_false
if sum_entries == 0:
# all nans scenario
Expand Down
4 changes: 2 additions & 2 deletions popmon/visualization/backend.py
Expand Up @@ -129,7 +129,7 @@ def check_interactive_backend():
run_display = (
display is None or not display.startswith(":") or not display[1].isdigit()
)
return True if run_ipynb or not run_display else False
return run_ipynb or not run_display


def in_ipynb():
Expand All @@ -147,6 +147,6 @@ def in_ipynb():
from IPython.core import getipython as gip

cfg = gip.get_ipython().config
return True if "IPKernelApp" in cfg.keys() else False
return "IPKernelApp" in cfg.keys()
except (ModuleNotFoundError, AttributeError):
return False

0 comments on commit 25887dd

Please sign in to comment.