Skip to content

Commit

Permalink
Add example to docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
mwcraig committed Nov 27, 2023
1 parent 912f9ff commit bd73a6e
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions stellarphot/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
<QTable length=1>
a b
int64 int64
----- -----
2 2
>>> bet.clean(a='>2')
<QTable length=1>
a b
int64 int64
----- -----
3 3
>>> t.clean()
"""
comparisons = {
'<': np.less,
Expand Down

0 comments on commit bd73a6e

Please sign in to comment.