Skip to content

Commit d281c50

Browse files
[pre-commit.ci] pre-commit autoupdate (#738)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.9.10 → v0.11.2](astral-sh/ruff-pre-commit@v0.9.10...v0.11.2) * [pre-commit.ci] Add auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Ignore type error --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Amrit Krishnan <[email protected]>
1 parent 6dad76b commit d281c50

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ repos:
1616
- id: check-toml
1717

1818
- repo: https://github.com/astral-sh/ruff-pre-commit
19-
rev: 'v0.9.10'
19+
rev: 'v0.11.2'
2020
hooks:
2121
- id: ruff
2222
args: [--fix, --exit-non-zero-on-fix]

cyclops/data/df/feature.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ def _ordinal_to_indicators(
676676
# Convert to binary categorical indicators
677677
return self._to_feature_types(
678678
data,
679-
{feat: CATEGORICAL_INDICATOR for feat in features},
679+
dict.fromkeys(features, CATEGORICAL_INDICATOR),
680680
inplace=False,
681681
)
682682

cyclops/data/df/vectorized.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def add_normalizer(
248248
self,
249249
axis: Union[str, int],
250250
normalization_method: Optional[str] = None,
251-
normalizer_map: Optional[Dict[str, str]] = None,
251+
normalizer_map: Optional[Dict[Any, str]] = None,
252252
) -> None:
253253
"""Add a normalizer.
254254
@@ -284,12 +284,12 @@ def add_normalizer(
284284
index_map = self.index_maps[axis_index]
285285
if normalizer_map is None:
286286
# Use the same normalization method for all features
287-
normalizer_map = {feat: normalization_method for feat in index_map} # type: ignore
287+
normalizer_map = dict.fromkeys(index_map, normalization_method) # type: ignore
288288
else:
289289
missing = set(normalizer_map.keys()) - set(index_map.keys())
290290
if len(missing) != 0:
291291
raise ValueError(f"Invalid index values {', '.join(missing)}.")
292-
normalizer = VectorizedNormalizer(axis_index, normalizer_map)
292+
normalizer = VectorizedNormalizer(axis_index, normalizer_map) # type: ignore
293293
self.normalizer = normalizer
294294

295295
def add_normalizer_direct(self, normalizer: VectorizedNormalizer) -> None:

cyclops/tasks/classification.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ def evaluate(
531531
missing_labels = [
532532
label for label in self.task_target if label not in dataset.column_names
533533
]
534-
if len(missing_labels):
534+
if missing_labels:
535535

536536
def add_missing_labels(examples: Dict[str, Any]) -> Dict[str, Any]:
537537
for label in missing_labels:

0 commit comments

Comments
 (0)