Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dataset Filtering #460

Merged
merged 17 commits into from
Jan 19, 2021
Merged

Dataset Filtering #460

merged 17 commits into from
Jan 19, 2021

Conversation

AbhinavTuli
Copy link
Contributor

@AbhinavTuli AbhinavTuli commented Jan 16, 2021

Adds filtering to datasets using a dictionary as a filter. Changes underlying implementation of datasetview and tensorview for the same, API remains the same as before.
Filtering can only be applied for keys that have product of max_shape less than 100.

Example usage:-

ds = hub.Dataset("username/dataset_name")

# single filter with multiple keys
dsv_combined = ds.filter({"fname": "Active", "lname": "loop"})

# stacking filters
dsv_1 = ds.filter({"id": 1})
dsv_1_subset = dsv_1[10:50]
dsv_2 = dsv_1_subset.filter({"name": "Active"})

@github-actions
Copy link

Locust summary

Git references

Initial: ace631f
Terminal: 9d5db62

hub/api/tensorview.py
Changes:
hub/api/datasetview.py
Changes:
hub/api/dataset.py
Changes:
hub/api/objectview.py
Changes:
hub/compute/transform.py
Changes:
hub/store/dynamic_tensor.py
Changes:
hub/compute/ray.py
Changes:
hub/exceptions.py
Changes:
hub/store/shape_detector.py
Changes:
hub/api/tests/test_dataset.py
Changes:
hub/api/tests/test_objectview.py
Changes:
hub/api/tests/test_tensorview.py
Changes:
hub/utils.py
Changes:

@codecov
Copy link

codecov bot commented Jan 16, 2021

Codecov Report

Merging #460 (9bd63d3) into master (4f537c5) will increase coverage by 0.08%.
The diff coverage is 89.52%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #460      +/-   ##
==========================================
+ Coverage   88.20%   88.29%   +0.08%     
==========================================
  Files          50       52       +2     
  Lines        3664     3724      +60     
==========================================
+ Hits         3232     3288      +56     
- Misses        432      436       +4     
Impacted Files Coverage Δ
hub/schema/sequence.py 100.00% <ø> (ø)
hub/schema/text.py 100.00% <ø> (ø)
hub/api/datasetview.py 91.39% <88.57%> (-0.04%) ⬇️
hub/api/tensorview.py 88.70% <88.70%> (ø)
hub/api/objectview.py 88.96% <88.96%> (ø)
hub/api/dataset.py 90.17% <90.69%> (+0.29%) ⬆️
hub/compute/ray.py 96.35% <100.00%> (ø)
hub/compute/transform.py 93.42% <100.00%> (ø)
hub/exceptions.py 100.00% <100.00%> (ø)
hub/store/dynamic_tensor.py 88.54% <100.00%> (+0.24%) ⬆️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4f537c5...9bd63d3. Read the comment docs.

@AbhinavTuli AbhinavTuli merged commit 66985dd into master Jan 19, 2021
@AbhinavTuli AbhinavTuli deleted the feature/filtering branch January 19, 2021 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants