Skip to content

Commit

Permalink
* Print length of observations
Browse files Browse the repository at this point in the history
* Only apply status filter if given.
  • Loading branch information
wtgee committed Oct 8, 2024
1 parent c353654 commit 2ab81c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/panoptes/data/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ def search_observations(
obs_df.query(f'unit_id in {listify(unit_ids)}', inplace=True)
print(f'Found {len(obs_df)} observations after unit filter')

with suppress(Exception):
if status is not None:
obs_df.query(f'status in {listify(status)}', inplace=True)
print(f'Found {len(obs_df)} observations after status filter')
print(f'Found {len(obs_df)} observations after {status=} filter')

print(f'Found {len(obs_df)} observations after filtering')

Expand Down
1 change: 1 addition & 0 deletions src/panoptes/data/utils/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ def search(
'total_exptime', 'time']
markdown_table = results.set_index('sequence_id')[display_cols].to_markdown()
print(markdown_table)
print(f'Found {len(results)} observations.')


if __name__ == "__main__":
Expand Down

0 comments on commit 2ab81c5

Please sign in to comment.