Skip to content

Commit

Permalink
Type valid data product short names
Browse files Browse the repository at this point in the history
  • Loading branch information
mfisher87 committed Sep 4, 2024
1 parent e6e7fe2 commit 0440fa9
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions icepyx/core/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,31 @@

from typing_extensions import NotRequired

IcesatProductShortName = Literal[
"ATL01",
"ATL02",
"ATL03",
"ATL04",
"ATL06",
"ATL07",
"ATL07QL",
"ATL08",
"ATL09",
"ATL09QL",
"ATL10",
"ATL11",
"ATL12",
"ATL13",
"ATL14",
"ATL15",
"ATL16",
"ATL17",
"ATL19",
"ATL20",
"ATL21",
"ATL23",
]

CMRParamsBase = TypedDict(
"CMRParamsBase",
{
Expand Down Expand Up @@ -37,12 +62,11 @@ class EGISpecificParamsBase(TypedDict):
TODO: Validate more strongly (with Pydantic and its annotated types?
https://docs.pydantic.dev/latest/concepts/types/#composing-types-via-annotated):
* short_name is `ATL##` (or Literal list of values?)
* version is 1-3 digits
* version is 3 digits
* 0 < page_size <= 2000
"""

short_name: str # alias: "product"
short_name: IcesatProductShortName # alias: "product"
version: str
page_size: int # default 2000
page_num: int # default 0
Expand Down

0 comments on commit 0440fa9

Please sign in to comment.