From 3bd1d93d5457bbce241618650acf638847cced7e Mon Sep 17 00:00:00 2001 From: bkatiemills Date: Fri, 19 Apr 2024 01:45:59 -0400 Subject: [PATCH] corrections --- .github/workflows/test.yaml | 4 ++-- argovisHelpers/helpers.py | 6 +++--- tests/tests.py | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c91be23..fbe7569 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -12,11 +12,11 @@ jobs: services: database: - image: argovis/testdb:0.40 + image: argovis/testdb:0.41 redis: image: redis:7.0.2 api: - image: argovis/api:2.22.0 + image: argovis/api:2.24.1 env: ARGONODE: core diff --git a/argovisHelpers/helpers.py b/argovisHelpers/helpers.py index 3d95c09..07abb4a 100644 --- a/argovisHelpers/helpers.py +++ b/argovisHelpers/helpers.py @@ -86,7 +86,7 @@ def query(route, options={}, apikey='', apiroot='https://argovis-api.colorado.ed results = [] delay = 0 if 'polygon' in options: - #pgons = split_polygon(options['polygon'], 5, 5) + pgons = split_polygon(options['polygon'], 5, 5) for i in range(len(pgons)): ops['polygon'] = pgons[i] increment = argofetch(route, options=ops, apikey=apikey, apiroot=apiroot, suggestedLatency=delay, verbose=verbose) @@ -105,8 +105,8 @@ def query(route, options={}, apikey='', apiroot='https://argovis-api.colorado.ed # do it for boxes too just to make sure nothing funny happened on the boundaries ops = copy.deepcopy(options) ops['compression'] = 'minimal' - true_ids = argofetch(route, options=ops, apikey=apikey, apiroot=apiroot, suggestedLatency=delay, verbose=verbose)[0] - true_ids = [x[0] for x in true_ids] + true_ids = argofetch(route, options=ops, apikey=apikey, apiroot=apiroot, suggestedLatency=delay, verbose=verbose) + true_ids = [x[0] for x in true_ids[0]] fetched_ids = [x['_id'] for x in results] if len(fetched_ids) != len(list(set(fetched_ids))): # deduplicate anything scooped up by multiple cells, like on cell borders diff --git a/tests/tests.py b/tests/tests.py index 981588f..a07c305 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -169,6 +169,7 @@ def test_timeseries_recombo(apiroot, apikey): slice_response = helpers.query('/timeseries/ccmpwind', options={'startDate':'1995-01-01T00:00:00Z', 'endDate':'2019-01-01T00:00:00Z', 'polygon': [[-10,-10],[10,-10],[10,10],[-10,10],[-10,-10]], 'data':'all'}, apikey=apikey, apiroot=apiroot) noslice_response = helpers.query('/timeseries/ccmpwind', options={'startDate':'1995-01-01T00:00:00Z', 'endDate':'2019-01-01T00:00:00Z', 'id': '0.125_0.125', 'data':'all'}, apikey=apikey, apiroot=apiroot) + assert slice_response[0]['data'] == noslice_response[0]['data'], 'mismatch on data recombination' assert slice_response[0]['timeseries'] == noslice_response[0]['timeseries'], 'mismatch on timestamp recombination'