Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to isort 5 #53

Merged
merged 1 commit into from
Jul 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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