diff --git a/pyproject.toml b/pyproject.toml index a99393de886..c980c204b5f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -255,6 +255,7 @@ extend-select = [ "PIE", # flake8-pie "TID", # flake8-tidy-imports (absolute imports) "PYI", # flake8-pyi + "FLY", # flynt "I", # isort "PERF", # Perflint "W", # pycodestyle warnings diff --git a/xarray/convert.py b/xarray/convert.py index 29d8f9650e3..b6811797a2e 100644 --- a/xarray/convert.py +++ b/xarray/convert.py @@ -138,7 +138,7 @@ def _iris_cell_methods_to_str(cell_methods_obj): f"interval: {interval}" for interval in cell_method.intervals ) comments = " ".join(f"comment: {comment}" for comment in cell_method.comments) - extra = " ".join([intervals, comments]).strip() + extra = f"{intervals} {comments}".strip() if extra: extra = f" ({extra})" cell_methods.append(names + cell_method.method + extra) diff --git a/xarray/core/formatting.py b/xarray/core/formatting.py index fb672997706..69359462cde 100644 --- a/xarray/core/formatting.py +++ b/xarray/core/formatting.py @@ -894,7 +894,7 @@ def extra_items_repr(extra_keys, mapping, ab_side, kwargs): attrs_summary.append(attr_s) temp = [ - "\n".join([var_s, attr_s]) if attr_s else var_s + f"{var_s}\n{attr_s}" if attr_s else var_s for var_s, attr_s in zip(temp, attrs_summary, strict=True) ] diff --git a/xarray/tests/test_cftime_offsets.py b/xarray/tests/test_cftime_offsets.py index 75269286007..de02d431bfa 100644 --- a/xarray/tests/test_cftime_offsets.py +++ b/xarray/tests/test_cftime_offsets.py @@ -274,7 +274,7 @@ def test_to_offset_annual(month_label, month_int, multiple, offset_str): freq = offset_str offset_type = _ANNUAL_OFFSET_TYPES[offset_str] if month_label: - freq = "-".join([freq, month_label]) + freq = f"{freq}-{month_label}" if multiple: freq = f"{multiple}{freq}" result = to_offset(freq) @@ -303,7 +303,7 @@ def test_to_offset_quarter(month_label, month_int, multiple, offset_str): freq = offset_str offset_type = _QUARTER_OFFSET_TYPES[offset_str] if month_label: - freq = "-".join([freq, month_label]) + freq = f"{freq}-{month_label}" if multiple: freq = f"{multiple}{freq}" result = to_offset(freq)
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: