Skip to content

Commit

Permalink
Update pre-commit repo versions
Browse files Browse the repository at this point in the history
  • Loading branch information
druzsan committed Feb 6, 2024
1 parent e714a30 commit c7baed0
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 46 deletions.
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ repos:

# "official" pre-commit hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
exclude: \.secret\.
Expand All @@ -42,22 +42,22 @@ repos:

# third-pary hooks
- repo: https://github.com/psf/black
rev: 23.1.0
rev: 24.1.1
hooks:
- id: black
- id: black-jupyter
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
rev: v4.0.0-alpha.8
hooks:
- id: prettier
exclude: (\.secret\.)|(pnpm-lock.yaml)
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.34.0
rev: v9.0.0-alpha.2
hooks:
- id: eslint
files: src
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.21.0
rev: 0.28.0
hooks:
- id: check-github-actions
- id: check-github-workflows
Expand All @@ -67,6 +67,6 @@ repos:
- id: shellcheck
- id: shfmt
- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
rev: 0.7.1
hooks:
- id: nbstripout
32 changes: 12 additions & 20 deletions renumics/spotlight/dataset/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,18 +393,15 @@ def __delitem__(self, item: Union[str, IndexType, Indices1dType]) -> None:
@overload
def __getitem__(
self, item: Union[str, Tuple[str, Indices1dType], Tuple[Indices1dType, str]]
) -> np.ndarray:
...
) -> np.ndarray: ...

@overload
def __getitem__(self, item: IndexType) -> Dict[str, Optional[OutputType]]:
...
def __getitem__(self, item: IndexType) -> Dict[str, Optional[OutputType]]: ...

@overload
def __getitem__(
self, item: Union[Tuple[str, IndexType], Tuple[IndexType, str]]
) -> Optional[OutputType]:
...
) -> Optional[OutputType]: ...

def __getitem__(
self,
Expand Down Expand Up @@ -463,20 +460,19 @@ def __setitem__(
self,
item: Union[str, Tuple[str, Indices1dType], Tuple[Indices1dType, str]],
value: Union[ColumnInputType, Iterable[ColumnInputType]],
) -> None:
...
) -> None: ...

@overload
def __setitem__(self, item: IndexType, value: Dict[str, ColumnInputType]) -> None:
...
def __setitem__(
self, item: IndexType, value: Dict[str, ColumnInputType]
) -> None: ...

@overload
def __setitem__(
self,
item: Union[Tuple[str, IndexType], Tuple[IndexType, str]],
value: ColumnInputType,
) -> None:
...
) -> None: ...

def __setitem__(
self,
Expand Down Expand Up @@ -635,16 +631,14 @@ def keys(self) -> List[str]:
return list(self._column_names)

@overload
def iterrows(self) -> Iterable[Dict[str, Optional[OutputType]]]:
...
def iterrows(self) -> Iterable[Dict[str, Optional[OutputType]]]: ...

@overload
def iterrows(
self, column_names: Union[str, Iterable[str]]
) -> Union[
Iterable[Dict[str, Optional[OutputType]]], Iterable[Optional[OutputType]]
]:
...
]: ...

def iterrows(
self, column_names: Optional[Union[str, Iterable[str]]] = None
Expand Down Expand Up @@ -1902,12 +1896,10 @@ def insert_row(self, index: IndexType, values: Dict[str, ColumnInputType]) -> No
self._update_generation_id()

@overload
def pop(self, item: str) -> np.ndarray:
...
def pop(self, item: str) -> np.ndarray: ...

@overload
def pop(self, item: IndexType) -> Dict[str, Optional[OutputType]]:
...
def pop(self, item: IndexType) -> Dict[str, Optional[OutputType]]: ...

def pop(
self, item: Union[str, IndexType]
Expand Down
12 changes: 6 additions & 6 deletions renumics/spotlight/dtypes/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ def __init__(self, value: NormalizedValue, dtype: dtypes.DType) -> None:
N = TypeVar("N", bound=NormalizedValue)

Converter = Callable[[N, dtypes.DType], ConvertedValue]
_converters_table: Dict[
Type[NormalizedValue], Dict[str, List[Converter]]
] = defaultdict(lambda: defaultdict(list))
_simple_converters_table: Dict[
Type[NormalizedValue], Dict[str, List[Converter]]
] = defaultdict(lambda: defaultdict(list))
_converters_table: Dict[Type[NormalizedValue], Dict[str, List[Converter]]] = (
defaultdict(lambda: defaultdict(list))
)
_simple_converters_table: Dict[Type[NormalizedValue], Dict[str, List[Converter]]] = (
defaultdict(lambda: defaultdict(list))
)


def register_converter(
Expand Down
12 changes: 4 additions & 8 deletions renumics/spotlight/embeddings/decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
@overload
def embed(
dtype: Union[Literal["image", "Image"], Image], *, name: Optional[str] = None
) -> Callable[[EmbedImageFunc], EmbedImageFunc]:
...
) -> Callable[[EmbedImageFunc], EmbedImageFunc]: ...


@overload
Expand All @@ -30,8 +29,7 @@ def embed(
*,
name: Optional[str] = None,
sampling_rate: int,
) -> Callable[[EmbedArrayFunc], EmbedArrayFunc]:
...
) -> Callable[[EmbedArrayFunc], EmbedArrayFunc]: ...


@overload
Expand All @@ -43,15 +41,13 @@ def embed(
],
*,
name: Optional[str] = None,
) -> Callable[[EmbedArrayFunc], EmbedArrayFunc]:
...
) -> Callable[[EmbedArrayFunc], EmbedArrayFunc]: ...


@overload
def embed(
dtype: Any, *, name: Optional[str] = None, sampling_rate: Optional[int] = None
) -> Callable[[EmbedFunc], EmbedFunc]:
...
) -> Callable[[EmbedFunc], EmbedFunc]: ...


def embed(
Expand Down
9 changes: 3 additions & 6 deletions renumics/spotlight/layout/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,7 @@ def similaritymap(
color_by_column: Optional[str] = None,
size_by_column: Optional[str] = None,
filter: bool = False,
) -> Similaritymap:
...
) -> Similaritymap: ...


@overload
Expand All @@ -303,8 +302,7 @@ def similaritymap(
*,
umap_metric: Optional[_UmapMetric] = None,
umap_balance: Optional[_UmapBalance] = None,
) -> Similaritymap:
...
) -> Similaritymap: ...


@overload
Expand All @@ -317,8 +315,7 @@ def similaritymap(
filter: bool = False,
*,
pca_normalization: Optional[_PCANormalization] = None,
) -> Similaritymap:
...
) -> Similaritymap: ...


def similaritymap(
Expand Down

0 comments on commit c7baed0

Please sign in to comment.