Skip to content

[pre-commit.ci] pre-commit autoupdate #738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ repos:
- id: check-toml

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.9.10'
rev: 'v0.11.2'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
2 changes: 1 addition & 1 deletion cyclops/data/df/feature.py
Original file line number Diff line number Diff line change
@@ -676,7 +676,7 @@ def _ordinal_to_indicators(
# Convert to binary categorical indicators
return self._to_feature_types(
data,
{feat: CATEGORICAL_INDICATOR for feat in features},
dict.fromkeys(features, CATEGORICAL_INDICATOR),
inplace=False,
)

6 changes: 3 additions & 3 deletions cyclops/data/df/vectorized.py
Original file line number Diff line number Diff line change
@@ -248,7 +248,7 @@ def add_normalizer(
self,
axis: Union[str, int],
normalization_method: Optional[str] = None,
normalizer_map: Optional[Dict[str, str]] = None,
normalizer_map: Optional[Dict[Any, str]] = None,
) -> None:
"""Add a normalizer.

@@ -284,12 +284,12 @@ def add_normalizer(
index_map = self.index_maps[axis_index]
if normalizer_map is None:
# Use the same normalization method for all features
normalizer_map = {feat: normalization_method for feat in index_map} # type: ignore
normalizer_map = dict.fromkeys(index_map, normalization_method) # type: ignore
else:
missing = set(normalizer_map.keys()) - set(index_map.keys())
if len(missing) != 0:
raise ValueError(f"Invalid index values {', '.join(missing)}.")
normalizer = VectorizedNormalizer(axis_index, normalizer_map)
normalizer = VectorizedNormalizer(axis_index, normalizer_map) # type: ignore
self.normalizer = normalizer

def add_normalizer_direct(self, normalizer: VectorizedNormalizer) -> None:
2 changes: 1 addition & 1 deletion cyclops/tasks/classification.py
Original file line number Diff line number Diff line change
@@ -531,7 +531,7 @@ def evaluate(
missing_labels = [
label for label in self.task_target if label not in dataset.column_names
]
if len(missing_labels):
if missing_labels:

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