Skip to content

Commit 847d427

Browse files
committed
chore: ran pre-commit hooks
1 parent 245134b commit 847d427

File tree

13 files changed

+21
-29
lines changed

13 files changed

+21
-29
lines changed

.coveragerc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ exclude_lines =
66
pragma: no cover
77
if TYPE_CHECKING:
88
^\s*\.\.\.$
9-
raise NotImplementedError
9+
raise NotImplementedError

.github/workflows/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: docs
33
on:
44
push:
55
branches:
6-
- master
6+
- master
77
- main
88

99
permissions:
@@ -17,7 +17,7 @@ jobs:
1717
- uses: actions/setup-python@v4
1818
with:
1919
python-version: 3.x
20-
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
20+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
2121
- uses: actions/cache@v3
2222
with:
2323
key: mkdocs-material-${{ env.cache_id }}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
names: name of the string vertex attribute that stores the names of the
22
vertices to be written into the output file. A warning will be thrown if
33
the attribute does not exist or is not a string attribute, and the file
4-
will contain numeric vertex IDs instead if this is the case.
4+
will contain numeric vertex IDs instead if this is the case.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
outstream: the output file or stream to write the graph to. May be a
22
filename, a path-like object or a file-like object if it is backed
3-
by a low-level file handle
3+
by a low-level file handle
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
weights: name of the edge attribute that stores the weights of the edges
22
to be written into the output file. A warning will be thrown if the
33
attribute does not exist or is not a numeric attribute, and all weights
4-
will be assumed to be equal to 1 if this is the case.
4+
will be assumed to be equal to 1 if this is the case.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ addopts = "--cov-config=.coveragerc"
3939
lint.ignore = ["F405"]
4040
lint.select = ["B", "C", "E", "F", "W"]
4141

42-
[tool.ruff.per-file-ignores]
42+
[tool.ruff.lint.per-file-ignores]
4343
"src/igraph_ctypes/_internal/enums.py" = ["E501"]
44-
"src/igraph_ctypes/_internal/functions.py" = ["E501"]
44+
"src/igraph_ctypes/_internal/functions.py" = ["E501", "E741"]
4545
"src/igraph_ctypes/_internal/lib.py" = ["E501"]
4646

4747
[tool.tox]

src/codegen/internal_lib.py.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,4 +573,3 @@ igraph_set_warning_handler.restype = igraph_warning_handler_t
573573
igraph_set_warning_handler.argtypes = [igraph_warning_handler_t]
574574

575575
# The rest of this file is generated by Stimulus
576-

src/codegen/reexport.py.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@
44
# be used by end users of the library.
55
#
66
# The rest of this file is generated
7-

src/igraph_ctypes/_internal/attributes/map.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,7 @@ def set(
8686

8787
if isinstance(value, (bytes, str)):
8888
# strings and bytes are iterable but they are treated as if not
89-
avl = AttributeValueList(
90-
[value] * length, type=type, fixed_length=True
91-
) # type: ignore
89+
avl = AttributeValueList([value] * length, type=type, fixed_length=True) # type: ignore
9290
elif isinstance(value, Iterable):
9391
# iterables are mapped to an AttributeValueList. Note that this
9492
# also takes care of copying existing AttributeValueList instances
@@ -100,9 +98,7 @@ def set(
10098
else:
10199
# all other values are assumed to be a common value for all
102100
# vertices or edges
103-
avl = AttributeValueList(
104-
[value] * length, type=type, fixed_length=True
105-
) # type: ignore
101+
avl = AttributeValueList([value] * length, type=type, fixed_length=True) # type: ignore
106102

107103
assert avl.fixed_length
108104
assert not _check_length or len(avl) == length

src/igraph_ctypes/_internal/attributes/value_list.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -281,18 +281,17 @@ def __delitem__(self, index: IndexLike) -> None: # noqa: C901
281281
raise RuntimeError("cannot delete items from a fixed-length list")
282282

283283
@overload
284-
def __getitem__(self, index: IntLike) -> T | None:
285-
...
284+
def __getitem__(self, index: IntLike) -> T | None: ...
286285

287286
@overload
288287
def __getitem__(
289288
self: C, index: slice | EllipsisType | Sequence[BoolLike | IntLike]
290-
) -> C:
291-
...
289+
) -> C: ...
292290

293291
@overload
294-
def __getitem__(self, index: NDArray[np.bool_] | NDArray[np.integer]) -> NDArray:
295-
...
292+
def __getitem__(
293+
self, index: NDArray[np.bool_] | NDArray[np.integer]
294+
) -> NDArray: ...
296295

297296
def __getitem__(self, index: IndexLike):
298297
items = self._items
@@ -308,7 +307,9 @@ def __getitem__(self, index: IndexLike):
308307

309308
elif isinstance(index, Sequence):
310309
return self.__class__(
311-
self._items[index,], type=self._type, _wrap=True # type: ignore
310+
self._items[index,],
311+
type=self._type,
312+
_wrap=True, # type: ignore
312313
)
313314

314315
elif isinstance(index, np.ndarray):

0 commit comments

Comments
 (0)