From b7f0aea2f8d1439e9c2f7d83ef818d40d4ee4ced Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Thu, 3 Apr 2025 21:56:12 +0200 Subject: [PATCH] Apply ruff preview rule RUF046 RUF046 Value being cast to `int` is already an integer --- pyproject.toml | 3 +-- xarray/core/resample_cftime.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c0062107db5..194d77ca5a6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -276,11 +276,10 @@ ignore = [ "RUF001", # string contains ambiguous unicode character "RUF002", # docstring contains ambiguous acute accent unicode character "RUF003", # comment contains ambiguous no-break space unicode character - "RUF005", # consider upacking operator instead of concatenation + "RUF005", # consider unpacking operator instead of concatenation "RUF012", # mutable class attributes ] - [tool.ruff.lint.per-file-ignores] # don't enforce absolute imports "asv_bench/**" = ["TID252"] diff --git a/xarray/core/resample_cftime.py b/xarray/core/resample_cftime.py index 949a95e32de..0f509a7b1f9 100644 --- a/xarray/core/resample_cftime.py +++ b/xarray/core/resample_cftime.py @@ -475,7 +475,7 @@ def exact_cftime_datetime_difference(a: CFTimeDatetime, b: CFTimeDatetime): datetime.timedelta """ seconds = b.replace(microsecond=0) - a.replace(microsecond=0) - seconds = int(round(seconds.total_seconds())) + seconds = round(seconds.total_seconds()) microseconds = b.microsecond - a.microsecond return datetime.timedelta(seconds=seconds, microseconds=microseconds) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy