You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sdap.apache.org by sk...@apache.org on 2022/12/01 20:46:48 UTC
[incubator-sdap-nexus] 01/02: Remove platform requirement from subsetter. Platform can be any value, not just int
This is an automated email from the ASF dual-hosted git repository.
skperez pushed a commit to branch cdms-subset-bugfix
in repository https://gitbox.apache.org/repos/asf/incubator-sdap-nexus.git
commit 3e77c91a0cc8425cd24268110b7a99e52f1c9479
Author: skorper <st...@gmail.com>
AuthorDate: Thu Dec 1 12:42:12 2022 -0800
Remove platform requirement from subsetter. Platform can be any value, not just int
---
analysis/webservice/algorithms/doms/subsetter.py | 12 +-----------
analysis/webservice/apidocs/openapi.yml | 9 +++------
2 files changed, 4 insertions(+), 17 deletions(-)
diff --git a/analysis/webservice/algorithms/doms/subsetter.py b/analysis/webservice/algorithms/doms/subsetter.py
index 97b7569..182d56f 100644
--- a/analysis/webservice/algorithms/doms/subsetter.py
+++ b/analysis/webservice/algorithms/doms/subsetter.py
@@ -119,9 +119,6 @@ class DomsResultsRetrievalHandler(BaseDomsHandler.BaseDomsQueryCalcHandler):
matchup_ds_names = []
parameter_s = request.get_argument('parameter', None)
- if parameter_s is None and len(matchup_ds_names) > 0:
- raise NexusProcessingException(
- reason='Parameter must be provided for insitu subset.' % parameter_s, code=400)
try:
start_time = request.get_start_datetime()
@@ -159,13 +156,6 @@ class DomsResultsRetrievalHandler(BaseDomsHandler.BaseDomsQueryCalcHandler):
reason='Depth Min should be less than Depth Max', code=400)
platforms = request.get_argument('platforms', None)
- if platforms is not None:
- try:
- p_validation = platforms.split(',')
- p_validation = [int(p) for p in p_validation]
- del p_validation
- except:
- raise NexusProcessingException(reason='platforms must be a comma-delimited list of integers', code=400)
return primary_ds_name, matchup_ds_names, parameter_s, start_time, end_time, \
bounding_polygon, depth_min, depth_max, platforms
@@ -318,7 +308,7 @@ class SubsetResult(NexusResults):
cols.append(datetime.utcfromtimestamp(result['time']).strftime('%Y-%m-%dT%H:%M:%SZ'))
for var in data_variables:
- cols.append(result['data'][var])
+ cols.append(result['data'].get(var))
if i == 0:
rows.append(','.join(headers))
rows.append(','.join(map(str, cols)))
diff --git a/analysis/webservice/apidocs/openapi.yml b/analysis/webservice/apidocs/openapi.yml
index a4c21ac..c2d6f3d 100644
--- a/analysis/webservice/apidocs/openapi.yml
+++ b/analysis/webservice/apidocs/openapi.yml
@@ -418,12 +418,10 @@ paths:
- in: query
name: parameter
description: |
- The parameter of interest. One of 'sst', 'sss', 'wind'
- required: true
+ The parameter of interest.
schema:
type: string
- enum: ['sst', 'sss', 'wind']
- example: sss
+ example: sea_surface_salinity
- in: query
name: depthMin
description: |
@@ -448,8 +446,7 @@ paths:
required: false
schema:
type: string
- default: 1,2,3,4,5,6,7,8,9
- example: 1,2,3,4,5,6,7,8,9
+ example: 3B,23
- in: query
name: output
description: |