Skip to content

Commit ab45ef4

Browse files
committed
linting, new black introduces new linting
Signed-off-by: Nick Papior <nickpapior@gmail.com>
1 parent eafa456 commit ab45ef4

File tree

29 files changed

+90
-56
lines changed

29 files changed

+90
-56
lines changed

src/sisl/_category.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ def __call__(cls, *args, **kwargs):
103103
@set_module("sisl.category")
104104
class Category(metaclass=CategoryMeta):
105105
r"""A category"""
106+
106107
__slots__ = ("_name", "_wrapper")
107108

108109
def __init__(self, name=None):
@@ -297,6 +298,7 @@ def is_class(cls, name):
297298
@set_module("sisl.category")
298299
class NullCategory(GenericCategory):
299300
r"""Special Null class which always represents a classification not being *anything*"""
301+
300302
__slots__ = tuple()
301303

302304
def __init__(self):

src/sisl/_dispatch_class.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class A(_Dispatchs,
1818
A.new.register ..
1919
A.hello.register ..
2020
"""
21+
2122
import logging
2223
from collections import namedtuple
2324
from typing import Any, Optional, Sequence, Union

src/sisl/geom/_composite.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
@dataclass
1616
class CompositeGeometrySection:
1717
@abstractmethod
18-
def build_section(self, previous: Geometry) -> Geometry:
19-
...
18+
def build_section(self, previous: Geometry) -> Geometry: ...
2019

2120
@abstractmethod
22-
def add_section(self, geometry: Geometry, geometry_addition: Geometry) -> Geometry:
23-
...
21+
def add_section(
22+
self, geometry: Geometry, geometry_addition: Geometry
23+
) -> Geometry: ...
2424

2525
def _junction_error(self, prev, msg, what):
2626
"""Helper function to raise an error if the junction is not valid.

src/sisl/geom/category/_coord.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class AtomFracSite(AtomCategory):
5454
... else:
5555
... assert c == B_site
5656
"""
57+
5758
__slots__ = (
5859
f"_{a}" for a in ("cell", "icell", "length", "atol", "offset", "foffset")
5960
)
@@ -159,6 +160,7 @@ class AtomXYZ(AtomCategory):
159160
AtomXYZ.fx < 3 == AtomXYZ.fx(None, 3) == AtomXYZ(f_x=(None, 3)) == AtomXYZ(f_x_lt=3)
160161
161162
"""
163+
162164
__slots__ = ("_coord_check",)
163165

164166
def __init__(self, *args, **kwargs):

src/sisl/geom/category/_kind.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class AtomZ(AtomCategory):
2626
Z : int or array_like
2727
atomic number match for several values this is equivalent to AND
2828
"""
29+
2930
__slots__ = ("_Z",)
3031

3132
def __init__(self, Z):
@@ -62,6 +63,7 @@ class AtomTag(AtomCategory):
6263
tag : str
6364
The tag you want atoms to match. It can be a regex expression.
6465
"""
66+
6567
__slots__ = ("_compiled_re", "_re")
6668

6769
def __init__(self, tag):
@@ -113,6 +115,7 @@ class AtomIndex(AtomCategory):
113115
>>> aidx = AtomIndex(mod=3) # [1, 2, 4, 5, ...]: range(na) - range(0, na, 3)
114116
>>> geom.sub(aidx) == geom.sub(range(0, len(geom), 3))
115117
"""
118+
116119
__slots__ = ("_op_val",)
117120

118121
def __init__(self, *args, **kwargs):
@@ -272,6 +275,7 @@ def __eq__(self, other):
272275

273276
class AtomEven(AtomCategory):
274277
r"""Classify atoms based on indices (even in this case)"""
278+
275279
__slots__ = []
276280

277281
def __init__(self):
@@ -291,6 +295,7 @@ def __eq__(self, other):
291295
@set_module("sisl.geom")
292296
class AtomOdd(AtomCategory):
293297
r"""Classify atoms based on indices (odd in this case)"""
298+
294299
__slots__ = []
295300

296301
def __init__(self):

src/sisl/geom/category/_neighbours.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class AtomNeighbours(AtomCategory):
3838
>>> AtomNeighbours(4, R=(1, 1.44)) # 4 neighbours within (1, Geometry.maxR())
3939
>>> AtomNeighbours(4, R=lambda atom: (0.01, PeriodicTable().radius(atom.Z))) # 4 neighbours within (0.01, <>)
4040
"""
41+
4142
__slots__ = ("_min", "_max", "_in", "_R")
4243

4344
def __init__(self, *args, **kwargs):

src/sisl/io/siesta/binaries.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2561,9 +2561,7 @@ def _type(name, obj, dic=None):
25612561
)
25622562
add_sile(
25632563
"RHOINIT",
2564-
_type(
2565-
"rhoinitSileSiesta", _gridSileSiesta, {"grid_unit": 1.0 / _Bohr2Ang**3}
2566-
),
2564+
_type("rhoinitSileSiesta", _gridSileSiesta, {"grid_unit": 1.0 / _Bohr2Ang**3}),
25672565
)
25682566
add_sile(
25692567
"RHOXC",
@@ -2583,9 +2581,7 @@ def _type(name, obj, dic=None):
25832581
)
25842582
add_sile(
25852583
"TOCH",
2586-
_type(
2587-
"totalrhoSileSiesta", _gridSileSiesta, {"grid_unit": 1.0 / _Bohr2Ang**3}
2588-
),
2584+
_type("totalrhoSileSiesta", _gridSileSiesta, {"grid_unit": 1.0 / _Bohr2Ang**3}),
25892585
)
25902586
# The following two files *require* that
25912587
# STM.DensityUnits Ele/bohr**3
@@ -2597,9 +2593,7 @@ def _type(name, obj, dic=None):
25972593
)
25982594
add_sile(
25992595
"STM.LDOS",
2600-
_type(
2601-
"stmldosSileSiesta", _gridSileSiesta, {"grid_unit": 1.0 / _Bohr2Ang**3}
2602-
),
2596+
_type("stmldosSileSiesta", _gridSileSiesta, {"grid_unit": 1.0 / _Bohr2Ang**3}),
26032597
)
26042598
add_sile("VH", _type("hartreeSileSiesta", _gridSileSiesta, {"grid_unit": _Ry2eV}))
26052599
add_sile(

src/sisl/io/tbtrans/se.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class tbtsencSileTBtrans(_devncSileTBtrans):
6262
>>> np.allclose(Hdev_pvt, Hdev[pvt_dev, pvt_dev.T])
6363
True
6464
"""
65+
6566
_trans_type = "TBT"
6667
_E2eV = Ry2eV
6768

src/sisl/io/tbtrans/tbt.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ class tbtncSileTBtrans(_devncSileTBtrans):
130130
The API for this class are largely equivalent to the arguments of the `sdata` command-line
131131
tool, with the execption that the command-line tool uses Fortran indexing numbers (1-based).
132132
"""
133+
133134
_trans_type = "TBT"
134135
_E2eV = Ry2eV
135136

src/sisl/mixing/base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
@set_module("sisl.mixing")
3737
class BaseMixer:
3838
r"""Base class mixer"""
39+
3940
__slots__ = ()
4041

4142
@abstractmethod
@@ -117,6 +118,7 @@ def __str__(self) -> str:
117118
@set_module("sisl.mixing")
118119
class BaseWeightMixer(BaseMixer):
119120
r"""Base class mixer"""
121+
120122
__slots__ = ("_weight",)
121123

122124
def __init__(self, weight: TypeWeight = 0.2):
@@ -142,6 +144,7 @@ def set_weight(self, weight: TypeWeight):
142144
@set_module("sisl.mixing")
143145
class BaseHistoryWeightMixer(BaseWeightMixer):
144146
r"""Base class mixer with history"""
147+
145148
__slots__ = ("_history",)
146149

147150
def __init__(self, weight: TypeWeight = 0.2, history: TypeArgHistory = 0):

0 commit comments

Comments
 (0)