@@ -70,7 +70,7 @@ class AnnDataInterface(hv.core.Interface):
7070 @classmethod
7171 def init (
7272 cls ,
73- eltype : hv .Element , # noqa: ARG003
73+ eltype : hv .Element , # ruff:ignore[unused-class-method-argument]
7474 data : AnnData ,
7575 kdims : list [Dimension ] | None ,
7676 vdims : list [Dimension ] | None ,
@@ -93,7 +93,7 @@ def init(
9393
9494 @classmethod
9595 def dims (cls , dataset : Dataset ) -> tuple [Literal ["obs" , "var" ], ...]:
96- """Detect if the data is gridded or columnar and which anndata dimensions it spans.""" # noqa: E501
96+ """Detect if the data is gridded or columnar and which anndata dimensions it spans.""" # ruff:ignore[line-too-long]
9797 vdim = cls ._dim (dataset , dataset .vdims [0 ]) if dataset .vdims else None
9898 if len (dataset .kdims ) == 0 and vdim :
9999 # e.g. Violin plot doesn’t have kdims
@@ -147,7 +147,7 @@ def _dim(dataset: Dataset, k: Dimension | str | int) -> AdDim:
147147 )
148148
149149 @classmethod
150- def validate (cls , dataset : Dataset , vdims : bool = True ) -> None : # noqa: FBT001, FBT002
150+ def validate (cls , dataset : Dataset , vdims : bool = True ) -> None : # ruff:ignore[boolean-type-hint-positional-argument, boolean-default-value-positional-argument]
151151 """Check if all dimensions (or key dimensions if `vdims==False`) are present."""
152152 dims = "all" if vdims else "key"
153153 not_found = [
@@ -173,7 +173,7 @@ def validate_selection_dim(
173173 if len (ref .dims ) > 1 :
174174 raise DataError (MSG_1D )
175175 [dim ] = ref .dims
176- # TODO: support ranges and sequences # noqa: TD003
176+ # TODO: support ranges and sequences # ruff:ignore[missing-todo-link]
177177 if dim not in {"obs" , "var" }: # pragma: no cover
178178 msg = f"Cannot { action } along unknown dim: { dim } "
179179 raise AssertionError (msg )
@@ -255,8 +255,8 @@ def select(
255255 def reindex (
256256 cls ,
257257 dataset : Dataset ,
258- kdims : list [Dimension ] | None = None , # noqa: ARG003
259- vdims : list [Dimension ] | None = None , # noqa: ARG003
258+ kdims : list [Dimension ] | None = None , # ruff:ignore[unused-class-method-argument]
259+ vdims : list [Dimension ] | None = None , # ruff:ignore[unused-class-method-argument]
260260 ) -> AnnData :
261261 """Reindex the data (a no-op)."""
262262 return dataset .data
@@ -267,18 +267,18 @@ def values(
267267 data : Dataset ,
268268 ref : Dimension | str ,
269269 / ,
270- expanded : bool = True , # noqa: FBT001, FBT002, ARG003
271- flat : bool = True , # noqa: FBT001, FBT002
270+ expanded : bool = True , # ruff:ignore[boolean-type-hint-positional-argument, boolean-default-value-positional-argument, unused-class-method-argument]
271+ flat : bool = True , # ruff:ignore[boolean-type-hint-positional-argument, boolean-default-value-positional-argument]
272272 * ,
273- compute : bool = True , # noqa: ARG003
274- keep_index : bool = False , # noqa: ARG003
273+ compute : bool = True , # ruff:ignore[unused-class-method-argument]
274+ keep_index : bool = False , # ruff:ignore[unused-class-method-argument]
275275 ) -> ValueType :
276276 """Retrieve values for a dimension."""
277277 ref = cls ._dim (data , ref )
278278 adata = cast ("AnnData" , data .data )
279279 values = adata [ref ]
280280 if flat and values .ndim > 1 :
281- assert not isinstance (values , ExtensionArray ) # noqa: S101
281+ assert not isinstance (values , ExtensionArray ) # ruff:ignore[assert]
282282 values = values .flatten ()
283283 return _simplify_numpy (values )
284284
@@ -332,7 +332,7 @@ def iloc(
332332 def _iloc_2d (
333333 cls ,
334334 dims : tuple [Literal ["obs" , "var" ], ...],
335- rows : slice [int | None ], # noqa: ARG003
335+ rows : slice [int | None ], # ruff:ignore[unused-class-method-argument]
336336 cols : slice [None ],
337337 ) -> tuple [slice [int | None ], slice [int | None ]] | None :
338338 """Validate indexing. Overridden in `AnnDataGriddedInterface`."""
@@ -351,7 +351,7 @@ def aggregate(
351351 dataset : Dataset ,
352352 kdims : list [Dimension | str ],
353353 function : Callable [[ValueType ], ValueType ],
354- ** kwargs : Any , # noqa: ANN401
354+ ** kwargs : Any , # ruff:ignore[any-type]
355355 ) -> tuple [pd .DataFrame , list [Dimension ]]:
356356 """Aggregate the current view."""
357357 agg = Dataset (
@@ -364,9 +364,9 @@ def aggregate(
364364 @classmethod
365365 def unpack_scalar (
366366 cls ,
367- dataset : Dataset , # noqa: ARG003
367+ dataset : Dataset , # ruff:ignore[unused-class-method-argument]
368368 data : AnnData | pd .DataFrame ,
369- ) -> Any : # noqa: ANN401
369+ ) -> Any : # ruff:ignore[any-type]
370370 """Unpacks scalar data if it is a DataFrame containing a single value."""
371371 if isinstance (data , AnnData ):
372372 return data
@@ -381,7 +381,7 @@ def groupby(
381381 dimensions : Sequence [str | AdDim ],
382382 container_type : type [T ],
383383 group_type : type [Dataset | dict ] | Literal ["raw" ],
384- ** kwargs : Any , # noqa: ANN401
384+ ** kwargs : Any , # ruff:ignore[any-type]
385385 ) -> T :
386386 """Group the dataset along the provided dimensions."""
387387 values = {}
@@ -464,7 +464,7 @@ def coords(
464464 dataset : Dataset ,
465465 ref : Dimension | str ,
466466 / ,
467- ordered : bool = False , # noqa: FBT001, FBT002
467+ ordered : bool = False , # ruff:ignore[boolean-type-hint-positional-argument, boolean-default-value-positional-argument]
468468 * ,
469469 expanded : bool = False ,
470470 edges : bool = False ,
@@ -473,14 +473,14 @@ def coords(
473473
474474 Ordered ensures coordinates are in ascending order and expanded creates
475475 ND-array matching the dimensionality of the dataset.
476- """ # noqa: DOC201
476+ """ # ruff:ignore[docstring-missing-returns]
477477 ref = cls ._dim (dataset , ref )
478478 vdim = dataset .vdims [0 ]
479479 if expanded :
480480 data = expand_grid_coords (dataset , ref )
481481 if edges and data .shape == vdim (dataset .data ).shape :
482- data = GridInterface ._infer_interval_breaks (data , axis = 1 ) # noqa: SLF001
483- data = GridInterface ._infer_interval_breaks (data , axis = 0 ) # noqa: SLF001
482+ data = GridInterface ._infer_interval_breaks (data , axis = 1 ) # ruff:ignore[private-member-access]
483+ data = GridInterface ._infer_interval_breaks (data , axis = 0 ) # ruff:ignore[private-member-access]
484484 return data
485485
486486 data = ref (dataset .data )
@@ -489,7 +489,7 @@ def coords(
489489 shape = cls .shape (dataset , gridded = True )
490490 if ref in dataset .kdims :
491491 idx = dataset .get_dimension_index (ref )
492- # TODO: don’t do this, it’s broken if diff(shape) == 1 # noqa: TD003
492+ # TODO: don’t do this, it’s broken if diff(shape) == 1 # ruff:ignore[missing-todo-link]
493493 is_edges = (
494494 ref in dataset .kdims
495495 and len (shape ) == dataset .ndims
@@ -498,7 +498,7 @@ def coords(
498498 else :
499499 is_edges = False
500500 if edges and not is_edges :
501- data = GridInterface ._infer_interval_breaks (data ) # noqa: SLF001
501+ data = GridInterface ._infer_interval_breaks (data ) # ruff:ignore[private-member-access]
502502 elif not edges and is_edges :
503503 data = data [:- 1 ] + np .diff (data ) / 2.0
504504 return data
@@ -508,11 +508,11 @@ def values(
508508 cls ,
509509 data : Dataset ,
510510 ref : Dimension | str ,
511- expanded : bool = True , # noqa: FBT001, FBT002
512- flat : bool = True , # noqa: FBT001, FBT002
511+ expanded : bool = True , # ruff:ignore[boolean-type-hint-positional-argument, boolean-default-value-positional-argument]
512+ flat : bool = True , # ruff:ignore[boolean-type-hint-positional-argument, boolean-default-value-positional-argument]
513513 * ,
514- compute : bool = True , # noqa: ARG003
515- keep_index : bool = False , # noqa: ARG003
514+ compute : bool = True , # ruff:ignore[unused-class-method-argument]
515+ keep_index : bool = False , # ruff:ignore[unused-class-method-argument]
516516 ) -> ValueType :
517517 """Retrieve values for a dimension."""
518518 ref = cls ._dim (data , ref )
@@ -544,7 +544,7 @@ def values(
544544 if transpose != flat :
545545 values = values .T
546546 case _:
547- assert ref in data .vdims , "test_init_errors[tab-x_2d] prevents 2D kdims" # noqa: S101
547+ assert ref in data .vdims , "test_init_errors[tab-x_2d] prevents 2D kdims" # ruff:ignore[assert]
548548 error = (
549549 "When requesting data for a value dimension, "
550550 "it is invalid to request expanded=False. "
0 commit comments