From bd73a6ea1234c0df2047c91b6c7e27a5971eccb5 Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Mon, 27 Nov 2023 08:49:58 -0600 Subject: [PATCH] Add example to docstring --- stellarphot/core.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/stellarphot/core.py b/stellarphot/core.py index 54db0447..63fa6837 100644 --- a/stellarphot/core.py +++ b/stellarphot/core.py @@ -335,6 +335,32 @@ def clean(self, remove_rows_with_mask=True, **other_restrictions): same type as object whose method was called Table with filtered data + + Examples + -------- + + >>> from astropy.table import Table + >>> from stellarphot import BaseEnhancedTable # Any subclasses will work too + >>> t = Table([[1, 2, 3], [1, 2, 3]], names=('a', 'b')) + >>> bet = BaseEnhancedTable(t) + >>> bet['a'].mask = [True, False, False] + >>> bet['b'].mask = [False, False, True] + >>> bet.clean(remove_rows_with_mask=True) + + a b + int64 int64 + ----- ----- + 2 2 + + >>> bet.clean(a='>2') + + a b + int64 int64 + ----- ----- + 3 3 + + + >>> t.clean() """ comparisons = { '<': np.less,