Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 28, 2024
1 parent ce08419 commit 8c0366d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/litdata/streaming/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,9 @@ def deserialize(self, data: bytes) -> Any:
return tifffile.imread(io.BytesIO(data)) # This is a NumPy array

def can_serialize(self, item: Any) -> bool:
print(f"Checking can_serialize for: {item}, exists: {os.path.isfile(item)}, suffix: {item.lower().endswith(('.tif', '.tiff'))}")
print(
f"Checking can_serialize for: {item}, exists: {os.path.isfile(item)}, suffix: {item.lower().endswith(('.tif', '.tiff'))}"
)
return isinstance(item, str) and os.path.isfile(item) and item.lower().endswith((".tif", ".tiff"))


Expand Down
1 change: 0 additions & 1 deletion tests/streaming/test_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ def test_tiff_serializer():
data, _ = serializer.serialize(file_path)
assert isinstance(data, bytes)


# Deserialize
deserialized_data = serializer.deserialize(data)
assert isinstance(deserialized_data, np.ndarray)
Expand Down

0 comments on commit 8c0366d

Please sign in to comment.