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

[Small] Added dtype to sample.py __array__ method #1470

Merged
merged 6 commits into from
Feb 2, 2022

Conversation

AbhinavTuli
Copy link
Contributor

🚀 🚀 Pull Request

Checklist:

  • My code follows the style guidelines of this project and the Contributing document
  • I have commented my code, particularly in hard-to-understand areas
  • I have kept the coverage-rate up
  • I have performed a self-review of my own code and resolved any problems
  • I have checked to ensure there aren't any other open Pull Requests for the same change
  • I have described and made corresponding changes to the relevant documentation
  • New and existing unit tests pass locally with my changes

Changes

  • np.array(hub.read("some/path"), dtype=np.uint8) will work now
  • Useful for updating tiled samples with hub.read

@AbhinavTuli AbhinavTuli changed the title Added dtype to sample.py __array__ method [Small] Added dtype to sample.py __array__ method Feb 1, 2022
Copy link
Contributor

@khustup khustup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works with my script

@codecov
Copy link

codecov bot commented Feb 2, 2022

Codecov Report

Merging #1470 (0918bd4) into main (8be1800) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1470      +/-   ##
==========================================
+ Coverage   91.54%   91.55%   +0.01%     
==========================================
  Files         179      179              
  Lines       14788    14808      +20     
==========================================
+ Hits        13537    13557      +20     
  Misses       1251     1251              
Flag Coverage Δ
unittests 91.55% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
hub/core/sample.py 88.09% <100.00%> (+0.21%) ⬆️
hub/util/tests/test_read.py 100.00% <100.00%> (ø)
hub/integrations/tests/test_pytorch_dataloader.py 95.69% <0.00%> (-2.16%) ⬇️
hub/integrations/pytorch/dataset.py 91.33% <0.00%> (-1.16%) ⬇️
hub/core/ipc.py 0.00% <0.00%> (ø)
hub/__init__.py 97.87% <0.00%> (+0.04%) ⬆️
hub/core/query/filter.py 87.35% <0.00%> (+0.05%) ⬆️
hub/core/dataset/dataset.py 93.67% <0.00%> (+0.13%) ⬆️
hub/core/compression.py 78.96% <0.00%> (+0.18%) ⬆️
hub/tests/path_fixtures.py 92.63% <0.00%> (+0.52%) ⬆️
... and 4 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 8be1800...0918bd4. Read the comment docs.

@AbhinavTuli AbhinavTuli merged commit b4173bc into main Feb 2, 2022
@AbhinavTuli AbhinavTuli deleted the fix/tiling_hub_read_update branch February 2, 2022 15:21
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