Skip to content

Commit c0ff38d

Browse files
authored
chore: update formatting (#28)
* chore: update formatting * chore: test on 3.9 too
1 parent d72f155 commit c0ff38d

File tree

16 files changed

+63
-49
lines changed

16 files changed

+63
-49
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
- 2.7
1919
- 3.6
2020
- 3.8
21+
- 3.9
2122
name: Check Python ${{ matrix.python-version }}
2223
steps:
2324
- uses: actions/checkout@v2

.pre-commit-config.yaml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,24 @@ repos:
1717
- id: mixed-line-ending
1818
- id: requirements-txt-fixer
1919
- id: trailing-whitespace
20-
- id: fix-encoding-pragma
20+
21+
- repo: https://github.com/asottile/pyupgrade
22+
rev: v2.10.0
23+
hooks:
24+
- id: pyupgrade
25+
# args: [--py36-plus]
26+
27+
28+
- repo: https://github.com/PyCQA/isort
29+
rev: 5.7.0
30+
hooks:
31+
- id: isort
32+
33+
- repo: https://github.com/asottile/setup-cfg-fmt
34+
rev: v1.16.0
35+
hooks:
36+
- id: setup-cfg-fmt
37+
args: [--min-py3-version, "3.5"]
2138

2239
- repo: https://github.com/mgedmin/check-manifest
2340
rev: "0.46"
@@ -38,5 +55,4 @@ repos:
3855
additional_dependencies:
3956
- flake8-bugbear
4057
- flake8-docstrings
41-
- flake8-import-order
4258
- flake8-print

setup.cfg

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,45 @@
11
[metadata]
22
name = vector
3+
description = Vector classes and utilities
4+
long_description = file: README.md
5+
long_description_content_type = text/markdown
6+
url = https://github.com/scikit-hep/vector
37
author = Eduardo Rodrigues
48
author_email = [email protected]
59
maintainer = The Scikit-HEP admins
610
maintainer_email = [email protected]
7-
description = Vector classes and utilities
8-
long_description = file: README.md
9-
long_description_content_type = md
10-
url = https://github.com/scikit-hep/vector
11-
license = BSD 3-Clause License
12-
keywords =
13-
vector
11+
license = BSD-3-Clause
12+
license_file = LICENSE
1413
platforms =
15-
Any
14+
Any
1615
classifiers =
17-
Topic :: Scientific/Engineering
18-
Intended Audience :: Science/Research
19-
Intended Audience :: Developers
20-
Operating System :: OS Independent
21-
License :: OSI Approved :: BSD License
22-
Programming Language :: Python
23-
Programming Language :: Python :: 2
24-
Programming Language :: Python :: 2.7
25-
Programming Language :: Python :: 3
26-
Programming Language :: Python :: 3.6
27-
Programming Language :: Python :: 3.7
28-
Programming Language :: Python :: 3.8
29-
Development Status :: 1 - Planning
16+
Development Status :: 1 - Planning
17+
Intended Audience :: Developers
18+
Intended Audience :: Science/Research
19+
License :: OSI Approved :: BSD License
20+
Operating System :: OS Independent
21+
Programming Language :: Python
22+
Programming Language :: Python :: 2
23+
Programming Language :: Python :: 2.7
24+
Programming Language :: Python :: 3
25+
Programming Language :: Python :: 3.5
26+
Programming Language :: Python :: 3.6
27+
Programming Language :: Python :: 3.7
28+
Programming Language :: Python :: 3.8
29+
Programming Language :: Python :: 3.9
30+
Topic :: Scientific/Engineering
31+
keywords =
32+
vector
3033

3134
[options]
32-
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*
3335
packages = find:
34-
package_dir =
35-
=src
3636
install_requires =
37-
numpy >=1.13.3
38-
typing; python_version<"3.5"
39-
typing_extensions; python_version<"3.8"
37+
numpy>=1.13.3
38+
typing;python_version<"3.5"
39+
typing_extensions;python_version<"3.8"
40+
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
41+
package_dir =
42+
=src
4043

4144
[options.packages.find]
4245
where = src
@@ -46,9 +49,13 @@ addopts = -rs -s -Wd
4649
testpaths =
4750
tests
4851

52+
[tool:isort]
53+
profile = black
54+
multi_line_output = 3
55+
4956
[flake8]
5057
ignore = E203, E231, E501, E722, W503, B950
51-
select = C,E,F,W,T,B,B9,I
58+
select = C,E,F,W,T,B,B9
5259
per-file-ignores =
5360
tests/*: T
5461

@@ -72,4 +79,4 @@ universal = 1
7279

7380
[tool.check-manifest]
7481
ignore =
75-
.github
82+
.github

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"dev": [
1212
"awkward>=1.0.0",
1313
"uproot>=4.0.0",
14-
'numba>=0.50; python_version>="3"',
14+
'numba>=0.50; python_version>="3" and python_version<"3.9"',
1515
"scikit-hep-testdata>=0.2.0",
1616
"pytest>=4.6",
1717
],

src/vector/awkward/lorentz/xyzt.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from typing import Any, Dict
1111

1212
import awkward as ak
13-
1413
import numpy as np
1514

1615
import vector.core.lorentz.xyzt
@@ -19,7 +18,7 @@
1918

2019
class LorentzXYZT(ak.Record, LorentzXYZTMethodMixin):
2120
def __repr__(self):
22-
return "Lxyz({0:.3g} {1:.3g} {2:.3g} {3:.3g})".format(
21+
return "Lxyz({:.3g} {:.3g} {:.3g} {:.3g})".format(
2322
self.x, self.y, self.z, self.t
2423
)
2524

src/vector/core/lorentz/xyzt.py

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

1414
from vector.core import numpy as np
1515

16-
1716
# Functions that return a value
1817

1918
# x: already included

src/vector/numba/lorentz/xyzt.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
from vector import core
1414
from vector.single.lorentz.xyzt import LorentzXYZTFree
1515

16-
1716
# Typing phase - Teaching Numba about our types
1817

1918

src/vector/numpy/lorentz/xyzt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from __future__ import absolute_import, division, print_function
88

9-
from typing import Any, TYPE_CHECKING, cast
9+
from typing import TYPE_CHECKING, Any, cast
1010

1111
import vector.mixins.lorentz.xyzt
1212
from vector.core import numpy as np
@@ -32,15 +32,15 @@ def __init__(self, x, y, z, t):
3232

3333
def __repr__(self):
3434
# type: () -> str
35-
return "Lxyz({0}, {1}, {2}, {3})".format(self.x, self.y, self.z, self.t)
35+
return "Lxyz({}, {}, {}, {})".format(self.x, self.y, self.z, self.t)
3636

3737
def __getitem__(self, attr):
3838
# type: (str) -> ArrayLike
3939
# It has to behave the same way as the bound objects or users will get confused.
4040
if attr in ("x", "y", "z", "t"):
4141
return getattr(self, attr)
4242
else:
43-
raise ValueError("key {0} does not exist in x,y,z,t".format(attr))
43+
raise ValueError("key {} does not exist in x,y,z,t".format(attr))
4444

4545

4646
if TYPE_CHECKING:

src/vector/protocols/lorentz.py

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

44
from typing import Protocol, Tuple, TypeVar, overload
55

6-
76
Self = TypeVar("Self", bound="Scalar")
87

98

src/vector/single/lorentz/xyzt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __init__(self, x, y, z, t):
2525

2626
def __repr__(self):
2727
# type: () -> str
28-
return "Lxyz({0:.3g} {1:.3g} {2:.3g} {3:.3g})".format(
28+
return "Lxyz({:.3g} {:.3g} {:.3g} {:.3g})".format(
2929
self.x, self.y, self.z, self.t
3030
)
3131

@@ -36,7 +36,7 @@ def __getitem__(self, attr):
3636
return getattr(self, attr)
3737
else:
3838
raise ValueError(
39-
"key {0} does not exist (not in record)".format(json.dumps(attr))
39+
"key {} does not exist (not in record)".format(json.dumps(attr))
4040
)
4141

4242

0 commit comments

Comments
 (0)