Skip to content

Commit 3f202cf

Browse files
authored
Added isort to pre-commit config (#1451)
* Added isort to pre-commit config * Added isort badge to README.md
1 parent ae755b5 commit 3f202cf

File tree

116 files changed

+365
-377
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+365
-377
lines changed

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ b0cd5f85c9b0c2705359fee3a3f4f3feda53bfa0
55

66
# Add black to pre-commit config
77
88981b5ae1c99f9b64758db44dfb39f2c20b10db
8+
9+
# Add clang-format to pre-commit config
10+
ae755b57a9aeeb09435594aa7f6a04bf4cdc55fa

.pre-commit-config.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@ repos:
2828
hooks:
2929
- id: black
3030
args: ["--check", "--diff", "--color"]
31+
- repo: https://github.com/pycqa/isort
32+
rev: 5.12.0
33+
hooks:
34+
- id: isort
35+
name: isort (python)
36+
- id: isort
37+
name: isort (cython)
38+
types: [cython]
39+
- id: isort
40+
name: isort (pyi)
41+
types: [pyi]
3142
- repo: https://github.com/pocc/pre-commit-hooks
3243
rev: v1.3.5
3344
hooks:

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
2+
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
23
[![Pre-commit](https://github.com/IntelPython/dpnp/actions/workflows/pre-commit.yml/badge.svg?branch=master&event=push)](https://github.com/IntelPython/dpnp/actions/workflows/pre-commit.yml)
34
[![Conda package](https://github.com/IntelPython/dpnp/actions/workflows/conda-package.yml/badge.svg?branch=master&event=push)](https://github.com/IntelPython/dpnp/actions/workflows/conda-package.yml)
45
[![Coverage Status](https://coveralls.io/repos/github/IntelPython/dpnp/badge.svg?branch=master)](https://coveralls.io/github/IntelPython/dpnp?branch=master)

benchmarks/benchmarks/bench_elementwise.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import numpy
2+
23
import dpnp
4+
35
from .common import Benchmark
46

57

benchmarks/benchmarks/bench_linalg.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
from .common import Benchmark, get_squares_, get_indexes_rand, TYPES1
2-
31
import numpy
2+
43
import dpnp
54

5+
from .common import TYPES1, Benchmark, get_indexes_rand, get_squares_
6+
67

78
class Eindot(Benchmark):
89
params = [

benchmarks/benchmarks/bench_random.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import numpy
2+
23
import dpnp
4+
35
from .common import Benchmark
46

57

benchmarks/benchmarks/common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import numpy
21
import random
32

3+
import numpy
4+
45
# Various pre-crafted datasets/variables for testing
56
# !!! Must not be changed -- only appended !!!
67
# while testing numpy we better not rely on numpy to produce random

benchmarks/pytest_benchmark/test_random.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
# THE POSSIBILITY OF SUCH DAMAGE.
2626
# *****************************************************************************
2727

28+
import numpy as np
2829
import pytest
2930

3031
import dpnp
31-
import numpy as np
3232

3333
ROUNDS = 30
3434
ITERATIONS = 4

dpnp/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,9 @@
5151

5252
from dpnp.dpnp_array import dpnp_array as ndarray
5353
from dpnp.dpnp_flatiter import flatiter as flatiter
54-
5554
from dpnp.dpnp_iface_types import *
5655
from dpnp.dpnp_iface import *
5756
from dpnp.dpnp_iface import __all__ as _iface__all__
5857
from dpnp.version import __version__
5958

60-
6159
__all__ = _iface__all__

dpnp/config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
import os
2929

30-
3130
__DPNP_ORIGIN__ = int(os.getenv("DPNP_ORIGIN", 0))
3231
"""
3332
Explicitly use original host Python NumPy

0 commit comments

Comments
 (0)