From 3e4f3b88bb77d606e677544610532ad7c624a663 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 18 Jul 2024 13:12:45 +0100 Subject: [PATCH] chore: update pre-commit hooks (#501) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: update pre-commit hooks updates: - [github.com/astral-sh/ruff-pre-commit: v0.4.10 → v0.5.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.10...v0.5.2) - [github.com/adamchainz/blacken-docs: 1.16.0 → 1.18.0](https://github.com/adamchainz/blacken-docs/compare/1.16.0...1.18.0) - [github.com/pre-commit/mirrors-mypy: v1.10.0 → v1.10.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.10.0...v1.10.1) * Use is not == for type identity checks. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Patrick Peglar --- .pre-commit-config.yaml | 6 +++--- src/iris_grib/__init__.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 713a378b..6401409e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -51,7 +51,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.4.10" + rev: "v0.5.2" hooks: - id: ruff types: [file, python] @@ -67,7 +67,7 @@ repos: additional_dependencies: [tomli] - repo: https://github.com/adamchainz/blacken-docs - rev: 1.16.0 + rev: 1.18.0 hooks: - id: blacken-docs types: [file, rst] @@ -79,7 +79,7 @@ repos: types: [file, python] - repo: https://github.com/pre-commit/mirrors-mypy - rev: 'v1.10.0' + rev: 'v1.10.1' hooks: - id: mypy exclude: 'noxfile\.py|docs/conf\.py' diff --git a/src/iris_grib/__init__.py b/src/iris_grib/__init__.py index c9265e06..7c35d4af 100644 --- a/src/iris_grib/__init__.py +++ b/src/iris_grib/__init__.py @@ -259,14 +259,14 @@ def __getattr__(self, key): res = np.int32(eccodes.codes_get_long(self.grib_message, key)) else: key_type = eccodes.codes_get_native_type(self.grib_message, key) - if key_type == int: + if key_type is int: res = np.int32(eccodes.codes_get_long(self.grib_message, key)) - elif key_type == float: + elif key_type is float: # Because some computer keys are floats, like # longitudeOfFirstGridPointInDegrees, a float32 # is not always enough... res = np.float64(eccodes.codes_get_double(self.grib_message, key)) - elif key_type == str: + elif key_type is str: res = eccodes.codes_get_string(self.grib_message, key) else: emsg = "Unknown type for {} : {}"