From c27daf66e1f582ad3619c9d669a041b2ea555b1c Mon Sep 17 00:00:00 2001 From: Phil Owen <19691521+PhillipsOwen@users.noreply.github.com> Date: Thu, 10 Oct 2024 08:38:15 -0400 Subject: [PATCH] adding ensemble name param to UI data calls --- src/server.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/server.py b/src/server.py index 292f3c9..74d6fd5 100644 --- a/src/server.py +++ b/src/server.py @@ -59,8 +59,8 @@ async def get_terria_map_catalog_data(grid_type: Union[str, None] = Query(defaul storm_name: Union[str, None] = Query(default=None), cycle: Union[str, None] = Query(default=None), advisory_number: Union[str, None] = Query(default=None), run_date: Union[str, None] = Query(default=None), end_date: Union[str, None] = Query(default=None), project_code: Union[str, None] = Query(default=None), - product_type: Union[str, None] = Query(default=None), limit: Union[int, None] = Query(default=7), - use_new_wb: Union[bool, None] = Query(default=False), + ensemble_name: Union[str, None] = Query(default=None), product_type: Union[str, None] = Query(default=None), + limit: Union[int, None] = Query(default=7), use_new_wb: Union[bool, None] = Query(default=False), use_v3_sp: Union[bool, None] = Query(default=False)) -> json: """ Gets the json formatted terria map UI catalog data. @@ -75,6 +75,7 @@ async def get_terria_map_catalog_data(grid_type: Union[str, None] = Query(defaul
   run_date: Filter by the run date in the form of yyyy-mm-dd
   end_date: Filter by the data between the run date and end date
   project_code: Filter by the project code +
   ensemble_name: The name of the run ensemble
   product_type: Filter by the product type
   limit: Limit the number of catalog records returned in days (default is 7)
   use_new_wb: Use the new catalog workbench code @@ -94,7 +95,7 @@ async def get_terria_map_catalog_data(grid_type: Union[str, None] = Query(defaul # create the param list params: list = ['grid_type', 'event_type', 'instance_name', 'met_class', 'storm_name', 'cycle', 'advisory_number', 'run_date', 'end_date', - 'project_code', 'product_type', 'limit'] + 'project_code', 'product_type', 'limit', 'ensemble_name'] # loop through the SP params passed in for param in params: @@ -218,6 +219,7 @@ async def get_terria_map_catalog_data_secure(run_id: Union[str, None] = Query(de advisory_number: Union[str, None] = Query(default=None), run_date: Union[str, None] = Query(default=None), end_date: Union[str, None] = Query(default=None), project_code: Union[str, None] = Query(default=None), + ensemble_name: Union[str, None] = Query(default=None), product_type: Union[str, None] = Query(default=None), limit: Union[int, None] = Query(default=7), use_new_wb: Union[bool, None] = Query(default=False), use_v3_sp: Union[bool, None] = Query(default=False), ) -> json: @@ -236,6 +238,7 @@ async def get_terria_map_catalog_data_secure(run_id: Union[str, None] = Query(de
   run_date: Filter by the run date in the form of yyyy-mm-dd
   end_date: Filter by the data between the run date and end date
   project_code: Filter by the project code +
   ensemble_name: The name of the run ensemble
   product_type: Filter by the product type
   limit: Limit the number of catalog records returned in days (default is 7)
   use_new_wb: Use the new catalog workbench code @@ -248,15 +251,15 @@ async def get_terria_map_catalog_data_secure(run_id: Union[str, None] = Query(de try: logger.debug( 'Params - run_id: %s, grid_type: %s, event_type: %s, instance_name: %s, met_class: %s, storm_name: %s, cycle: %s, advisory_number: %s, ' - 'run_date: %s, end_date: %s, project_code %s, product_type: %s, limit: %s', run_id, grid_type, event_type, instance_name, met_class, - storm_name, cycle, advisory_number, run_date, end_date, project_code, product_type, limit) + 'run_date: %s, end_date: %s, project_code %s, product_type: %s, limit: %s, ensemble_name: %s', run_id, grid_type, event_type, instance_name, met_class, + storm_name, cycle, advisory_number, run_date, end_date, project_code, product_type, limit, ensemble_name) # init the kwargs variable kwargs: dict = {} # create the param list params: list = ['run_id', 'grid_type', 'event_type', 'instance_name', 'met_class', 'storm_name', 'cycle', 'advisory_number', 'run_date', - 'end_date', 'project_code', 'product_type', 'limit'] + 'end_date', 'project_code', 'product_type', 'limit', 'ensemble_name'] # loop through the SP params passed in for param in params: @@ -310,6 +313,7 @@ async def get_terria_map_catalog_data_file(file_name: Union[str, None] = Query(d storm_name: Union[str, None] = Query(default=None), cycle: Union[str, None] = Query(default=None), advisory_number: Union[str, None] = Query(default=None), run_date: Union[str, None] = Query(default=None), end_date: Union[str, None] = Query(default=None), project_code: Union[str, None] = Query(default=None), + ensemble_name: Union[str, None] = Query(default=None), product_type: Union[str, None] = Query(default=None), limit: Union[int, None] = Query(default=7), use_new_wb: Union[bool, None] = Query(default=False), use_v3_sp: Union[bool, None] = Query(default=False), ) -> json: @@ -327,6 +331,7 @@ async def get_terria_map_catalog_data_file(file_name: Union[str, None] = Query(d
   run_date: Filter by the run date in the form of yyyy-mm-dd
   end_date: Filter by the data between the run date and end date
   project_code: Filter by the project code +
   ensemble_name: The name of the run ensemble
   product_type: Filter by the product type
   limit: Limit the number of catalog records returned in days (default is 7)
   use_new_wb: Use the new catalog workbench code @@ -344,7 +349,7 @@ async def get_terria_map_catalog_data_file(file_name: Union[str, None] = Query(d # create the param list params: list = ['grid_type', 'event_type', 'instance_name', 'met_class', 'storm_name', 'cycle', 'advisory_number', 'run_date', 'end_date', - 'project_code', 'product_type', 'limit'] + 'project_code', 'product_type', 'limit', 'ensemble_name'] # loop through the SP params passed in for param in params: