G-Node / G-Node/python-odml

Convenience functions for filtering

Đang mở
#128 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
v1.4
Ngôn ngữ chính
Python
Star
25
Fork
30
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Currently it is possible to filter for specific odML objects using the iter-functions with a lambda function, e.g.:
```
odmldoc.itersections(filter_func=lambda x: x.name=="SpikeSorting" or x.type=="spikesorting")
odmldoc.iterproperties(filter_func=lambda x:x.name=="IsSpikeSorted")
odmldoc.itervalues(filter_func=lambda x: x.dtype==odml.DType.boolean and x.parent.name=="IsSpikeSorted")
```

To optimize the visibility of this functionality it would be nice to have (in addition) convenience functions for filtering (cookie-cutter-filter-functions), e.g. by objects:
```
odmldoc.filter_sections(name="SpikeSorting", type="spikesorting", operation="or")
odmldoc.filter_properties(name="IsSpikeSorted")
odmldoc.filter_values(dtype=odml.DType.boolean, parent_name="IsSpikeSorted", operation="and")
```

Or by attributes, e.g.:
`odmldoc.filter_by_name("SpikeSorting", exact=True)`

Or we even discuss the design of a "generic" filter function, e.g.:
`odmldoc.filter(objecttype=["sections", "properties"], **kwords)`
The question here is how to handle operations (and vs or) within and between search attributes.

And in addition we could think about a "template"-search.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.