This is an automated email from the ASF dual-hosted git repository.

eamonford pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-sdap-nexus.git


The following commit(s) were added to refs/heads/master by this push:
     new 8361085  SDAP-263: Support for querying tiles with date 01-01-1970 
(#103)
8361085 is described below

commit 836108596f36c222c4f9c87809cebe4c2a995114
Author: Eamon Ford <[email protected]>
AuthorDate: Thu Jul 16 10:34:23 2020 -0700

    SDAP-263: Support for querying tiles with date 01-01-1970 (#103)
    
    Co-authored-by: Eamon Ford <[email protected]>
---
 data-access/nexustiles/dao/SolrProxy.py | 14 +++++++-------
 data-access/nexustiles/nexustiles.py    |  6 +++---
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/data-access/nexustiles/dao/SolrProxy.py 
b/data-access/nexustiles/dao/SolrProxy.py
index beba557..bf41107 100644
--- a/data-access/nexustiles/dao/SolrProxy.py
+++ b/data-access/nexustiles/dao/SolrProxy.py
@@ -286,7 +286,7 @@ class SolrProxy(object):
             ]
         }
 
-        if 0 < start_time <= end_time:
+        if 0 <= start_time <= end_time:
             search_start_s = 
datetime.utcfromtimestamp(start_time).strftime(SOLR_FORMAT)
             search_end_s = 
datetime.utcfromtimestamp(end_time).strftime(SOLR_FORMAT)
 
@@ -318,7 +318,7 @@ class SolrProxy(object):
             ]
         }
 
-        if 0 < start_time <= end_time:
+        if 0 <= start_time <= end_time:
             search_start_s = 
datetime.utcfromtimestamp(start_time).strftime(SOLR_FORMAT)
             search_end_s = 
datetime.utcfromtimestamp(end_time).strftime(SOLR_FORMAT)
 
@@ -350,7 +350,7 @@ class SolrProxy(object):
             ]
         }
 
-        if 0 < start_time <= end_time:
+        if 0 <= start_time <= end_time:
             search_start_s = 
datetime.utcfromtimestamp(start_time).strftime(SOLR_FORMAT)
             search_end_s = 
datetime.utcfromtimestamp(end_time).strftime(SOLR_FORMAT)
 
@@ -387,7 +387,7 @@ class SolrProxy(object):
             'facet.mincount': 1
         }
 
-        if 0 < start_time <= end_time:
+        if 0 <= start_time <= end_time:
             search_start_s = 
datetime.utcfromtimestamp(start_time).strftime(SOLR_FORMAT)
             search_end_s = 
datetime.utcfromtimestamp(end_time).strftime(SOLR_FORMAT)
 
@@ -424,7 +424,7 @@ class SolrProxy(object):
             ]
         }
 
-        if 0 < start_time <= end_time:
+        if 0 <= start_time <= end_time:
             search_start_s = 
datetime.utcfromtimestamp(start_time).strftime(SOLR_FORMAT)
             search_end_s = 
datetime.utcfromtimestamp(end_time).strftime(SOLR_FORMAT)
 
@@ -556,7 +556,7 @@ class SolrProxy(object):
             'fq': metadata
         }
 
-        if 0 < start_time <= end_time:
+        if 0 <= start_time <= end_time:
             
additionalparams['fq'].append(self.get_formatted_time_clause(start_time, 
end_time))
 
         self._merge_kwargs(additionalparams, **kwargs)
@@ -603,7 +603,7 @@ class SolrProxy(object):
             min_lon, min_lat, max_lon, max_lat = bounding_polygon.bounds
             additionalparams['fq'].append("geo:[%s,%s TO %s,%s]" % (min_lat, 
min_lon, max_lat, max_lon))
 
-        if 0 < start_time <= end_time:
+        if 0 <= start_time <= end_time:
             
additionalparams['fq'].append(self.get_formatted_time_clause(start_time, 
end_time))
 
         if metadata:
diff --git a/data-access/nexustiles/nexustiles.py 
b/data-access/nexustiles/nexustiles.py
index cb8d2e9..24db1ae 100644
--- a/data-access/nexustiles/nexustiles.py
+++ b/data-access/nexustiles/nexustiles.py
@@ -254,7 +254,7 @@ class NexusTileService(object):
                                  **kwargs):
         tiles = self.find_tiles_in_box(min_lat, max_lat, min_lon, max_lon, ds, 
start_time, end_time, **kwargs)
         tiles = self.mask_tiles_to_bbox(min_lat, max_lat, min_lon, max_lon, 
tiles)
-        if 0 < start_time <= end_time:
+        if 0 <= start_time <= end_time:
             tiles = self.mask_tiles_to_time_range(start_time, end_time, tiles)
 
         return tiles
@@ -263,7 +263,7 @@ class NexusTileService(object):
         tiles = self.find_tiles_in_polygon(polygon, ds, start_time, end_time,
                                            **kwargs)
         tiles = self.mask_tiles_to_polygon(polygon, tiles)
-        if 0 < start_time <= end_time:
+        if 0 <= start_time <= end_time:
             tiles = self.mask_tiles_to_time_range(start_time, end_time, tiles)
 
         return tiles
@@ -398,7 +398,7 @@ class NexusTileService(object):
         :param tiles: List of tiles
         :return: A list tiles with data masked to specified time range
         """
-        if 0 < start_time <= end_time:
+        if 0 <= start_time <= end_time:
             for tile in tiles:
                 tile.times = ma.masked_outside(tile.times, start_time, 
end_time)
 

Reply via email to