-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updates pydantic and fix optional parameters for the API
- Loading branch information
1 parent
0820715
commit 5927b63
Showing
13 changed files
with
158 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,27 @@ | ||
import datetime | ||
from enum import Enum | ||
from typing import Optional | ||
from pydantic import BaseModel | ||
|
||
|
||
class AtmosphericModelTypes(str, Enum): | ||
STANDARD_ATMOSPHERE: str = "STANDARD_ATMOSPHERE" | ||
CUSTOM_ATMOSPHERE: str = "CUSTOM_ATMOSPHERE" | ||
WYOMING_SOUNDING: str = "WYOMING_SOUNDING" | ||
NOAARUCSOUNDING: str = "NOAARUCSOUNDING" | ||
FORECAST: str = "FORECAST" | ||
REANALYSIS: str = "REANALYSIS" | ||
ENSEMBLE: str = "ENSEMBLE" | ||
|
||
|
||
class Env(BaseModel): | ||
latitude: float = 0 | ||
longitude: float = 0 | ||
elevation: Optional[int] = 1400 | ||
latitude: float | ||
longitude: float | ||
elevation: Optional[int] = None | ||
|
||
# Opional parameters | ||
atmospheric_model_type: Optional[str] = "standard_atmosphere" | ||
atmospheric_model_file: Optional[str] = "GFS" | ||
# Optional parameters | ||
atmospheric_model_type: Optional[AtmosphericModelTypes] = None | ||
atmospheric_model_file: Optional[str] = None | ||
date: Optional[datetime.datetime] = ( | ||
datetime.datetime.today() + datetime.timedelta(days=1) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.