From 5a79d3e6fb3ea9d5f5ae5d5ee241d1e7b08f4db9 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Fri, 13 Oct 2023 16:02:06 -0300 Subject: [PATCH] use defaults when nothing is provided --- gliderpy/fetchers.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/gliderpy/fetchers.py b/gliderpy/fetchers.py index 82b6a93..f5b0f83 100644 --- a/gliderpy/fetchers.py +++ b/gliderpy/fetchers.py @@ -100,12 +100,12 @@ def to_pandas(self): def query( self, - min_lat, - max_lat, - min_lon, - max_lon, - min_time, - max_time, + min_lat=None, + max_lat=None, + min_lon=None, + max_lon=None, + min_time=None, + max_time=None, delayed=False, ): """ @@ -119,6 +119,14 @@ def query( :param max_time: end time, can be datetime object or string :return: search query with argument constraints applied """ + # FIXME: The time constrain could be better implemented by just dropping it instead. + min_time = min_time if min_time else "1970-01-01" + max_time = max_time if max_time else "2038-01-19" + min_lat = min_lat if min_lat else -90.0 + max_lat = max_lat if max_lat else 90.0 + min_lon = min_lon if min_lon else -180.0 + max_lon = max_lon if max_lon else 180.0 + self.fetcher.constraints = { "time>=": min_time, "time<=": max_time,