Skip to content

Commit

Permalink
use Index class
Browse files Browse the repository at this point in the history
  • Loading branch information
rabernat committed Jan 12, 2022
1 parent 0ed0db6 commit 141ef3b
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions pangeo_forge_recipes/patterns.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
"""
Filename / URL patterns.
"""
from __future__ import annotations

import inspect
from dataclasses import dataclass, field, replace
from enum import Enum
from itertools import product
from typing import (
TYPE_CHECKING,
Any,
Callable,
ClassVar,
Expand Down Expand Up @@ -94,13 +91,8 @@ def __post_init__(self):
assert self.index < self.sequence_len


if TYPE_CHECKING:
# If we just do this, we can't initialize an Index by just writing
# Index(list_of_dims)
Index = FrozenSet[DimIndex]
else:
# But if we just do this, it won't pass mypy 😖
Index = frozenset[DimIndex]
class Index(FrozenSet[DimIndex]):
pass


CombineDim = Union[MergeDim, ConcatDim]
Expand Down

0 comments on commit 141ef3b

Please sign in to comment.