Skip to content

Commit

Permalink
Merge pull request #53 from ing-bank/feature/isort-upgrade
Browse files Browse the repository at this point in the history
Upgrade to isort 5
  • Loading branch information
tomcis authored Jul 10, 2020
2 parents 869779e + bad5168 commit e1d7f1a
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 19 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,7 @@ cython_debug/
docs/build

.vscode
.idea/
.idea/

# Developer's playground
/playground/
10 changes: 4 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
ifeq ($(check),1)
ISORT_ARG= --check-only
BLACK_ARG= --check
CHECK_ARG= --check
else
ISORT_ARG=
BLACK_ARG=
CHECK_ARG=
endif

lint:
isort $(ISORT_ARG) --project popmon --thirdparty histogrammar --thirdparty pybase64 --multi-line=3 --trailing-comma --force-grid-wrap=0 --use-parentheses --line-width=88 -y
black $(BLACK_ARG) .
isort $(CHECK_ARG) --profile black --project popmon --thirdparty histogrammar --thirdparty pybase64 .
black $(CHECK_ARG) .

install:
pip install -e .
10 changes: 4 additions & 6 deletions make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ setlocal enabledelayedexpansion

IF "%1%" == "lint" (
IF "%2%" == "check" (
SET ISORT_ARG= --check-only
SET BLACK_ARG= --check
SET CHECK_ARG= --check
) ELSE (
set ISORT_ARG=
set BLACK_ARG=
set CHECK_ARG=
)
isort !ISORT_ARG! --project popmon --thirdparty histogrammar --thirdparty pybase64 --multi-line=3 --trailing-comma --force-grid-wrap=0 --use-parentheses --line-width=88 -y
black !BLACK_ARG! .
isort !CHECK_ARG! --profile black --project popmon --thirdparty histogrammar --thirdparty pybase64 .
black !CHECK_ARG! .
GOTO end
)

Expand Down
2 changes: 1 addition & 1 deletion popmon/analysis/profiling/hist_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import pandas as pd
from phik import phik

import popmon.stats.numpy as pm_np
from popmon.stats import numpy as pm_np

from ...analysis.hist_numpy import get_2dgrid
from ...base import Module
Expand Down
3 changes: 2 additions & 1 deletion popmon/hist/filling/spark_histogrammar.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

try:
from pyspark.sql import DataFrame
from pyspark.sql.functions import col as sparkcol, approxCountDistinct
from pyspark.sql.functions import approxCountDistinct
from pyspark.sql.functions import col as sparkcol
except (ModuleNotFoundError, AttributeError):
pass

Expand Down
2 changes: 1 addition & 1 deletion popmon/visualization/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def in_ipynb():
:rtype: bool
"""
try:
import IPython.core.getipython as gip
from IPython.core import getipython as gip

cfg = gip.get_ipython().config
return True if "IPKernelApp" in cfg.keys() else False
Expand Down
2 changes: 1 addition & 1 deletion popmon/visualization/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
import math
from io import BytesIO

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pybase64
from ing_theme_matplotlib import mpl_style
from matplotlib import pyplot as plt

NUM_NS_DAY = 24 * 3600 * int(1e9)

Expand Down
3 changes: 1 addition & 2 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
flake8>=3.7.8
pytest>=4.0.2
pytest-pylint>=0.13.0
nbconvert>=5.3.1
jupyter_client>=5.2.3
ipykernel>=5.1.3
black>=19.10b0
isort==4.3.21
isort>=5.0.7

0 comments on commit e1d7f1a

Please sign in to comment.