From d854637325e624efd8dfbdf6f2e58fa1657c5521 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 24 Mar 2025 19:03:52 +0000 Subject: [PATCH 1/3] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.9.10 → v0.11.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.9.10...v0.11.2) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0b3132884..b02e0694f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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] From f3e091f8fd3a8f82733871e9e7aca95a96b96867 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 24 Mar 2025 19:04:32 +0000 Subject: [PATCH 2/3] [pre-commit.ci] Add auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- cyclops/data/df/feature.py | 2 +- cyclops/data/df/vectorized.py | 2 +- cyclops/tasks/classification.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cyclops/data/df/feature.py b/cyclops/data/df/feature.py index 6ac30200e..921ccc8bc 100644 --- a/cyclops/data/df/feature.py +++ b/cyclops/data/df/feature.py @@ -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, ) diff --git a/cyclops/data/df/vectorized.py b/cyclops/data/df/vectorized.py index 36711ebd8..093159143 100644 --- a/cyclops/data/df/vectorized.py +++ b/cyclops/data/df/vectorized.py @@ -284,7 +284,7 @@ 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: diff --git a/cyclops/tasks/classification.py b/cyclops/tasks/classification.py index 578c81e79..7290cb4eb 100644 --- a/cyclops/tasks/classification.py +++ b/cyclops/tasks/classification.py @@ -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: From ddec9283f56567290cb557707673f1eaeca4e55b Mon Sep 17 00:00:00 2001 From: Amrit Krishnan Date: Fri, 28 Mar 2025 13:25:11 -0400 Subject: [PATCH 3/3] Ignore type error --- cyclops/data/df/vectorized.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cyclops/data/df/vectorized.py b/cyclops/data/df/vectorized.py index 093159143..f9954c8e5 100644 --- a/cyclops/data/df/vectorized.py +++ b/cyclops/data/df/vectorized.py @@ -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. @@ -289,7 +289,7 @@ def add_normalizer( 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: