Skip to content

Commit

Permalink
Use Python 3.9-compatible annotation style
Browse files Browse the repository at this point in the history
  • Loading branch information
mfisher87 committed Sep 5, 2024
1 parent 9604491 commit 79fccf1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions icepyx/core/APIformatting.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Generate and format information for submitting to API (CMR and NSIDC)."""

import datetime as dt
from typing import Any, Generic, Literal, TypeVar, Union, overload
from typing import Any, Generic, Literal, Optional, TypeVar, Union, overload

from icepyx.core.types import (
CMRParams,
Expand Down Expand Up @@ -190,7 +190,7 @@ def to_string(params):

ParameterType = Literal["CMR", "required", "subset"]
# DevGoal: When Python 3.12 is minimum supported version, migrate to PEP695 style
T = TypeVar("T", bound=ParameterType)
T = TypeVar("T", covariant=True, bound=ParameterType)


class _FmtedKeysDescriptor:
Expand Down Expand Up @@ -256,14 +256,15 @@ class Parameters(Generic[T]):
"""

partype: T
_reqtype: Literal["search", "download"] | None
_reqtype: Optional[Literal["search", "download"]]
fmted_keys = _FmtedKeysDescriptor()
# _fmted_keys: Union[CMRParams, EGISpecificRequiredParams, EGIParamsSubset]

def __init__(
self,
partype: T,
values: dict | None = None,
reqtype: Literal["search", "download"] | None = None,
values: Optional[dict] = None,
reqtype: Optional[Literal["search", "download"]] = None,
):
assert partype in [
"CMR",
Expand Down

0 comments on commit 79fccf1

Please sign in to comment.