From 0d801732ab2624529c41d1ada8b40ed4471e337d Mon Sep 17 00:00:00 2001 From: Tom Aldcroft Date: Sun, 14 May 2023 09:33:37 -0400 Subject: [PATCH 1/2] Fix misleading doc string --- cheta/fetch.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/cheta/fetch.py b/cheta/fetch.py index 331dcd1a..115a014c 100644 --- a/cheta/fetch.py +++ b/cheta/fetch.py @@ -1128,12 +1128,11 @@ def filter_bad_times(self, start=None, stop=None, table=None, copy=False): in with fetch.read_bad_times(). - Supply both ``start`` and ``stop`` values where each is a single value in a valid DateTime format. - - Supply an ``table`` parameter in the form of a 2-column table of - start and stop dates (space-delimited) or the name of a file with - data in the same format. + - Supply a ``table`` parameter with one of two forms: (1) list of bad time + interval strings, where each string contains the start and stop dates + separated by a space; (2) string with the name of a file in the same format. - The ``table`` parameter must be supplied as a table or the name of a - table file, for example:: + Examples:: bad_times = ['2008:292:00:00:00 2008:297:00:00:00', '2008:305:00:12:00 2008:305:00:12:03', @@ -1143,7 +1142,7 @@ def filter_bad_times(self, start=None, stop=None, table=None, copy=False): :param start: Start of time interval to exclude (any DateTime format) :param stop: End of time interval to exclude (any DateTime format) - :param table: Two-column table (start, stop) of bad time intervals + :param table: List of str with start and stop for bad time intervals :param copy: return a copy of MSID object with bad times filtered """ if table is not None: @@ -1645,12 +1644,12 @@ def filter_bad_times(self, start=None, stop=None, table=None, copy=False): in with fetch.read_bad_times(). - Supply both ``start`` and ``stop`` values where each is a single value in a valid DateTime format. - - Supply an ``table`` parameter in the form of a 2-column table of - start and stop dates (space-delimited) or the name of a file with - data in the same format. + - Supply a ``table`` parameter with one of two forms: (1) list of bad time + interval strings, where each string contains the start and stop dates + separated by a space; (2) string with the name of a file in the same format. + + Examples:: - The ``table`` parameter must be supplied as a table or the name of a - table file, for example:: msidset.filter_bad_times() bad_times = ['2008:292:00:00:00 2008:297:00:00:00', From af670c04ef3ba98764d130ee8b8e35ac4c64bb49 Mon Sep 17 00:00:00 2001 From: Tom Aldcroft Date: Sun, 14 May 2023 09:58:22 -0400 Subject: [PATCH 2/2] More fixes --- cheta/fetch.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cheta/fetch.py b/cheta/fetch.py index 115a014c..46a40049 100644 --- a/cheta/fetch.py +++ b/cheta/fetch.py @@ -1142,7 +1142,8 @@ def filter_bad_times(self, start=None, stop=None, table=None, copy=False): :param start: Start of time interval to exclude (any DateTime format) :param stop: End of time interval to exclude (any DateTime format) - :param table: List of str with start and stop for bad time intervals + :param table: List of str with start and stop for bad time intervals or str + with name of file containing list of bad time intervals :param copy: return a copy of MSID object with bad times filtered """ if table is not None: @@ -1660,7 +1661,8 @@ def filter_bad_times(self, start=None, stop=None, table=None, copy=False): :param start: Start of time interval to exclude (any DateTime format) :param stop: End of time interval to exclude (any DateTime format) - :param table: Two-column table (start, stop) of bad time intervals + :param table: List of str with start and stop for bad time intervals or str + with name of file containing list of bad time intervals :param copy: return a copy of MSID object with intervals selected """ obj = self.copy() if copy else self