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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AL-1331] Api reference updates #1384

Merged
merged 11 commits into from
Dec 13, 2021
Merged

[AL-1331] Api reference updates #1384

merged 11 commits into from
Dec 13, 2021

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

Adds/improves documentation for the following:-

  1. Tensor .tobytes
  2. New htypes (audio, text, json, list)
  3. hub.delete
  4. Dataset .pytorch
  5. .eval in .compose and .compute

@codecov
Copy link

codecov bot commented Dec 9, 2021

Codecov Report

Merging #1384 (6278f1f) into main (c9c8b41) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1384      +/-   ##
==========================================
+ Coverage   92.80%   92.85%   +0.04%     
==========================================
  Files         174      174              
  Lines       12793    12793              
==========================================
+ Hits        11873    11879       +6     
+ Misses        920      914       -6     
Flag Coverage 螖
unittests 92.85% <100.00%> (+0.04%) 猬嗭笍

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

Impacted Files Coverage 螖
hub/__init__.py 96.96% <酶> (酶)
hub/compression.py 97.29% <酶> (酶)
hub/core/dataset/dataset.py 94.02% <酶> (酶)
hub/core/tensor.py 79.14% <酶> (酶)
hub/htype.py 100.00% <酶> (酶)
hub/core/transform/transform.py 95.76% <100.00%> (酶)
hub/integrations/pytorch/dataset.py 93.11% <0.00%> (+1.61%) 猬嗭笍
hub/integrations/tests/test_pytorch_dataloader.py 97.84% <0.00%> (+2.15%) 猬嗭笍

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 c9c8b41...6278f1f. Read the comment docs.

hub/core/dataset/dataset.py Outdated Show resolved Hide resolved
@@ -451,6 +451,16 @@ def data(self) -> Any:
return self.numpy()

def tobytes(self) -> bytes:
"""Returns the bytes of the tensor. Only works for a single sample of tensor.
If the tensor is compressed, it returns the compressed bytes.
Copy link
Contributor

Choose a reason for hiding this comment

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

@AbhinavTuli Does this work if the raw data is not compressed? If it errors, we should say that you can't run this operation for uncompressed data.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added explanations for all 3 cases, uncompressed, sample compressed and chunk compressed.

hub/core/transform/transform.py Outdated Show resolved Hide resolved
@istranic
Copy link
Contributor

@AbhinavTuli Can you pls make the information below into a table or bullet points, or something that's easier to read:

image

@AbhinavTuli AbhinavTuli merged commit 40dcecd into main Dec 13, 2021
@AbhinavTuli AbhinavTuli deleted the update/api-reference branch December 13, 2021 15:56
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