Skip to content

Commit

Permalink
Merge pull request #9 from RENCI/getStationData
Browse files Browse the repository at this point in the history
Change forcing_metaclass to forcing_metclass
  • Loading branch information
PhillipsOwen authored Jan 29, 2024
2 parents bc68321 + a880b88 commit b10be4c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/common/pg_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def get_station_data(self, **kwargs) -> str:

# get nowcast data_source from forecast data_source
# check if data_source is tropical
if kwargs['forcing_metaclass'] == 'tropical':
if kwargs['forcing_metclass'] == 'tropical':
# if tropical split data source and replace second value (OFCL) with NOWCAST
source_parts = kwargs['data_source'].split('_')
source_parts[1] = 'NOWCAST'
Expand Down
6 changes: 3 additions & 3 deletions src/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ async def get_terria_map_catalog_data_file(file_name: Union[str, None] = Query(d
@APP.get('/get_station_data', status_code=200, response_model=None, response_class=PlainTextResponse)
def get_station_data(station_name: Union[str, None] = Query(default=None), time_mark: Union[str, None] = Query(default=None),
data_source: Union[str, None] = Query(default=None), instance_name: Union[str, None] = Query(default=None),
forcing_metaclass: Union[str, None] = Query(default=None)) -> PlainTextResponse:
forcing_metclass: Union[str, None] = Query(default=None)) -> PlainTextResponse:
"""
Returns the CSV formatted observational station.
Expand All @@ -413,12 +413,12 @@ def get_station_data(station_name: Union[str, None] = Query(default=None), time_
# example input - station name: 8651370, timemark: 2023-08-24T00:00:00, data_source: GFSFORECAST_WNAT_53K_V1.0
try:
# validate the input. nothing is optional
if station_name or time_mark or data_source or instance_name or forcing_metaclass:
if station_name or time_mark or data_source or instance_name or forcing_metclass:
# init the kwargs variable
kwargs: dict = {}

# create the param list
params: list = ['station_name', 'time_mark', 'data_source', 'instance_name', 'forcing_metaclass']
params: list = ['station_name', 'time_mark', 'data_source', 'instance_name', 'forcing_metclass']

# loop through the SP params passed in
for param in params:
Expand Down

0 comments on commit b10be4c

Please sign in to comment.