Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jul 12, 2024
1 parent 72483cb commit a47363c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion xarray/conventions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from collections import defaultdict
from collections.abc import Hashable, Iterable, Mapping, MutableMapping
from typing import TYPE_CHECKING, Any, Literal, Union, TypeVar
from typing import TYPE_CHECKING, Any, Literal, TypeVar, Union

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -383,7 +383,10 @@ def _update_bounds_encoding(variables: T_Variables) -> None:
if "calendar" in encoding:
bounds_encoding.setdefault("calendar", encoding["calendar"])


T = TypeVar("T")


def _item_or_default(obj: Mapping[Any, T] | T, key: Hashable, default: T = None) -> T:
"""
Return item by key if obj is mapping and key is present, else return default value.
Expand Down

0 comments on commit a47363c

Please sign in to comment.