Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
885 changes: 828 additions & 57 deletions dascore/core/annotation_loader.py

Large diffs are not rendered by default.

295 changes: 268 additions & 27 deletions dascore/core/annotations.py

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions dascore/io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from dascore.core.annotations import (
annotation_set_to_csv,
annotation_set_to_dataframe,
annotation_set_to_parquet,
annotation_set_to_vertices,
save_annotation_set,
)
Expand Down Expand Up @@ -60,4 +61,5 @@ class AnnotationIO(AnnotationNameSpace):
to_dataframe = annotation_set_to_dataframe
to_vertices = annotation_set_to_vertices
to_csv = annotation_set_to_csv
to_parquet = annotation_set_to_parquet
save = save_annotation_set
8 changes: 7 additions & 1 deletion dascore/utils/pd.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,13 @@ def _filter_contains(query_dict, df, bool_index):
"""Filter based on rows containing specified values."""
for key, val in query_dict.items():
_check_misdirected_range_query(key, val, df)
bool_index = np.logical_and(bool_index, df[key].isin(val))
# An ellipsis names no value, so it matches nothing and is dropped
# before `isin` sees it: pandas' arrow-backed string columns refuse a
# value arrow has no type for, where its numpy-backed ones quietly
# never match. The range check above still sees it -- an open bound
# in a membership query is what that check exists to name.
wanted = [x for x in val if x is not ...]
bool_index = np.logical_and(bool_index, df[key].isin(wanted))
return bool_index


Expand Down
Loading
Loading