Skip to content

Commit

Permalink
Fixes for windows issues (#528)
Browse files Browse the repository at this point in the history
fixes windows issues
  • Loading branch information
AbhinavTuli authored Feb 4, 2021
1 parent 1a5ff81 commit 0128704
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,4 @@ jobs:
docker push $IMAGE_NAME:$IMAGE_TAG
- slack/status:
fail_only: true
webhook: $SLACK_WEBHOOK
webhook: $SLACK_WEBHOOK
12 changes: 6 additions & 6 deletions hub/api/tests/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,8 @@ def test_dataset_batch_write_2():
def test_dataset_hub():
password = os.getenv("ACTIVELOOP_HUB_PASSWORD")
login_fn("testingacc", password)
test_dataset("testingacc/test_dataset_private", public=False)
test_dataset("testingacc/test_dataset_public")
test_dataset("testingacc/test_dataset_private_2", public=False)
test_dataset("testingacc/test_dataset_public_2")


@pytest.mark.skipif(not gcp_creds_exist(), reason="requires gcp credentials")
Expand Down Expand Up @@ -753,7 +753,7 @@ def test_dataset_filtering():
"fname": Text((None,), max_shape=(10,)),
"lname": Text((None,), max_shape=(10,)),
}
ds = Dataset("./test/filtering", shape=(100,), schema=my_schema, mode="w")
ds = Dataset("./data/tests/filtering", shape=(100,), schema=my_schema, mode="w")
for i in range(100):
ds["fname", i] = "John"
ds["lname", i] = "Doe"
Expand Down Expand Up @@ -803,7 +803,7 @@ def test_dataset_filtering():
"lname": Text((None,), max_shape=(10,)),
"image": Image((1920, 1080, 3)),
}
ds = Dataset("./test/filtering2", shape=(100,), schema=my_schema2, mode="w")
ds = Dataset("./data/tests/filtering", shape=(100,), schema=my_schema2, mode="w")
with pytest.raises(LargeShapeFilteringException):
ds.filter({"image": np.ones((1920, 1080, 3))})
with pytest.raises(KeyError):
Expand All @@ -823,7 +823,7 @@ def test_dataset_filtering_2():
"img": Image((None, None, 3), max_shape=(100, 100, 3)),
"cl": ClassLabel(names=["cat", "dog", "horse"]),
}
ds = Dataset("./test/filtering_3", shape=(100,), schema=schema, mode="w")
ds = Dataset("./data/tests/filtering_2", shape=(100,), schema=schema, mode="w")
for i in range(100):
ds["cl", i] = 0 if i % 5 == 0 else 1
ds["img", i] = i * np.ones((5, 6, 3))
Expand All @@ -844,7 +844,7 @@ def test_dataset_filtering_3():
"img": Image((None, None, 3), max_shape=(100, 100, 3)),
"cl": ClassLabel(names=["cat", "dog", "horse"]),
}
ds = Dataset("./test/filtering_3", shape=(100,), schema=schema, mode="w")
ds = Dataset("./data/tests/filtering_3", shape=(100,), schema=schema, mode="w")
for i in range(100):
ds["cl", i] = 0 if i < 10 else 1
ds["img", i] = i * np.ones((5, 6, 3))
Expand Down
4 changes: 2 additions & 2 deletions hub/compute/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from pathos.pools import ProcessPool, ThreadPool
from hub.schema.sequence import Sequence
from hub.schema.features import featurify
import posixpath
import os
from hub.defaults import OBJECT_CHUNK


Expand Down Expand Up @@ -123,7 +123,7 @@ def __getitem__(self, slice_):
num, ofs = slice_extract_info(slice_list[0], self.shape[0])
ds_view = self._ds[slice_list[0]]

path = posixpath.expanduser("~/.activeloop/tmparray")
path = os.path.expanduser("~/.activeloop/tmparray")
new_ds = self.store(path, length=num, ds=ds_view, progressbar=False)

index = 1 if len(slice_) > 1 else 0
Expand Down
4 changes: 2 additions & 2 deletions hub/schema/tests/test_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ def test_hub_feature_flatten():


def test_feature_dict_str():
input_dict = {"myint": int, "mystr": str}
input_dict = {"myint": "int64", "mystr": str}
feature_dict_object = SchemaDict(input_dict)
expected_output = "SchemaDict({'myint': 'int64', 'mystr': '<U0'})"
assert expected_output == feature_dict_object.__str__()


def test_feature_dict_repr():
input_dict = {"myint": int, "mystr": str}
input_dict = {"myint": "int64", "mystr": str}
feature_dict_object = SchemaDict(input_dict)
expected_output = "SchemaDict({'myint': 'int64', 'mystr': '<U0'})"
assert expected_output == feature_dict_object.__repr__()
Expand Down
4 changes: 2 additions & 2 deletions hub/schema/tests/test_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ def test_tensor_flattening():


def test_primitive_str():
primitve_object = Primitive(int)
primitve_object = Primitive("int64")
assert "'int64'" == primitve_object.__str__()


def test_primitive_repr():
primitve_object = Primitive(int)
primitve_object = Primitive("int64")
assert "'int64'" == primitve_object.__repr__()


Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ azure-storage-blob==12.6.0
pathos>=0.2.2
psutil>=5.7.3
Pillow>=8.0.1
cloudpickle==1.6.0
msgpack==1.0.2

0 comments on commit 0128704

Please sign in to comment.