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

[pull] master from activeloopai:master #1

Merged
merged 33 commits into from
Apr 29, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
c90cf90
Add ClassLabel value checks
kristinagrig06 Mar 25, 2021
a2c7d0a
Move check to function, add test
kristinagrig06 Apr 5, 2021
41da0e6
Merge branch 'master' of https://github.com/activeloopai/Hub into HEAD
kristinagrig06 Apr 5, 2021
bade292
Merge commit 'a2c7d0a' into HEAD
kristinagrig06 Apr 5, 2021
e8d16b8
Remove Iterable from imports
kristinagrig06 Apr 5, 2021
ce7b10d
Fix tests
kristinagrig06 Apr 5, 2021
81ed554
Separate Text conversion
kristinagrig06 Apr 7, 2021
63aadd1
Check str in value
kristinagrig06 Apr 7, 2021
844ad8e
Update humbug requirement from <0.2,>=0.1.14 to >=0.1.14,<0.3
dependabot-preview[bot] Apr 21, 2021
7b0cb51
Add new tests
kristinagrig06 Apr 22, 2021
98a3a45
Merge remote-tracking branch 'origin' into fixes/class_label_shape
kristinagrig06 Apr 22, 2021
2b7dd2e
Fix conflicts
kristinagrig06 Apr 22, 2021
a39f23e
Fixed issue #795
Anselmoo Apr 23, 2021
0bcb1b6
Added survey to readme
istranic Apr 23, 2021
7102a76
Revert "Bump docutils from 0.16 to 0.17.1 (#783)" (#801)
AbhinavTuli Apr 26, 2021
57d9e46
Bump sphinx from 3.5.3 to 3.5.4
dependabot-preview[bot] Apr 26, 2021
d42df3b
Update requirements-optional for fix issue #797 (#798)
Anselmoo Apr 27, 2021
00a5faf
Fix issue #778 (#794)
Anselmoo Apr 27, 2021
b54e109
Bump ray from 1.2.0 to 1.3.0
dependabot-preview[bot] Apr 27, 2021
2bd5b46
Merge pull request #792 from activeloopai/dependabot/pip/ray-1.3.0
kristinagrig06 Apr 28, 2021
40edd55
Merge pull request #796 from Anselmoo/update-gitignore
kristinagrig06 Apr 28, 2021
48f88bc
Bump boto3 from 1.17.54 to 1.17.59
dependabot-preview[bot] Apr 28, 2021
59e2350
Bump docutils from 0.16 to 0.17.1
dependabot-preview[bot] Apr 28, 2021
a911df2
Merge pull request #808 from activeloopai/dependabot/pip/boto3-1.17.59
kristinagrig06 Apr 29, 2021
e744933
Update fsspec requirement from <1,>=0.8 to >=0.8,<2022
dependabot-preview[bot] Apr 29, 2021
d416936
Merge pull request #785 from activeloopai/dependabot/pip/humbug-gte-0…
kristinagrig06 Apr 29, 2021
cb8b591
Merge pull request #744 from activeloopai/fixes/class_label_shape
kristinagrig06 Apr 29, 2021
2cb194e
Merge pull request #764 from activeloopai/dependabot/pip/sphinx-3.5.4
kristinagrig06 Apr 29, 2021
0d13e3d
Merge pull request #782 from activeloopai/dependabot/pip/fsspec-gte-0…
kristinagrig06 Apr 29, 2021
e161832
Merge pull request #809 from activeloopai/dependabot/pip/docutils-0.17.1
kristinagrig06 Apr 29, 2021
fba7d53
Adds support for google repos stored on GCS (#800)
AbhinavTuli Apr 29, 2021
2fb3d52
Update version.py
AbhinavTuli Apr 29, 2021
4f3bd32
Revert "Bump docutils from 0.16 to 0.17.1" (#811)
AbhinavTuli Apr 29, 2021
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
Prev Previous commit
Next Next commit
Check str in value
  • Loading branch information
kristinagrig06 committed Apr 7, 2021
commit 63aadd19cc24830ae98bf45dc08c1c4f16e0d21c
7 changes: 4 additions & 3 deletions hub/api/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import collections.abc as abc
import json
import sys
from typing import Iterable
import traceback
from collections import defaultdict
import numpy as np
Expand Down Expand Up @@ -620,9 +621,9 @@ def __setitem__(self, slice_, value):
schema_key = schema_dict
if isinstance(schema_key, ClassLabel):
assign_value = check_class_label(assign_value, schema_key)
if (
isinstance(schema_key, (Text, bytes))
or np.array(assign_value).dtype.type is np.str_
if isinstance(schema_key, (Text, bytes)) or (
isinstance(assign_value, Iterable)
and any(isinstance(val, str) for val in assign_value)
):
# handling strings and bytes
assign_value = str_to_int(assign_value, self.tokenizer)
Expand Down
9 changes: 4 additions & 5 deletions hub/api/datasetview.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
"""

from hub.utils import _tuple_product
from typing import Iterable
from hub.api.tensorview import TensorView
import collections.abc as abc
from hub.api.dataset_utils import (
Expand Down Expand Up @@ -153,9 +152,9 @@ def __setitem__(self, slice_, value):
schema_key = schema_dict
if isinstance(schema_key, ClassLabel):
assign_value = check_class_label(assign_value, schema_key)
if (
isinstance(schema_key, (Text, bytes))
or np.array(assign_value).dtype.type is np.str_
if isinstance(schema_key, (Text, bytes)) or (
isinstance(assign_value, Iterable)
and any(isinstance(val, str) for val in assign_value)
):
# handling strings and bytes
assign_value = str_to_int(assign_value, self.dataset.tokenizer)
Expand Down
8 changes: 5 additions & 3 deletions hub/api/tensorview.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
"""
import numpy as np
from typing import Iterable
import hub
import collections.abc as abc
from hub.api.dataset_utils import get_value, slice_split, str_to_int, check_class_label
Expand Down Expand Up @@ -216,12 +217,13 @@ def __setitem__(self, slice_, value):
schema_key = schema_dict
if isinstance(schema_key, ClassLabel):
assign_value = check_class_label(assign_value, schema_key)
if (
isinstance(schema_key, (Text, bytes))
or np.array(assign_value).dtype.type is np.str_
if isinstance(schema_key, (Text, bytes)) or (
isinstance(assign_value, Iterable)
and any(isinstance(val, str) for val in assign_value)
):
# handling strings and bytes
assign_value = str_to_int(assign_value, self.dataset.tokenizer)

new_nums = self.nums.copy()
new_offsets = self.offsets.copy()
if isinstance(self.indexes, list):
Expand Down