Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitri-yatsenko committed Feb 22, 2025
1 parent b8a3a8e commit 3d1f7cb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions datajoint/blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,14 @@ def unpack(self, blob):
try:
# decompress
prefix = next(
p for p in compression if self._blob[self._pos :].startswith(p)
p for p in compression if self._blob[self._pos:].startswith(p)
)
except StopIteration:
pass # assume uncompressed but could be unrecognized compression
else:
self._pos += len(prefix)
blob_size = self.read_value()
blob = compression[prefix](self._blob[self._pos :])
blob = compression[prefix](self._blob[self._pos:])
assert len(blob) == blob_size
self._blob = blob
self._pos = 0
Expand Down Expand Up @@ -558,7 +558,7 @@ def pack_uuid(obj):

def read_zero_terminated_string(self):
target = self._blob.find(b"\0", self._pos)
data = self._blob[self._pos : target].decode()
data = self._blob[self._pos:target].decode()
self._pos = target + 1
return data

Expand All @@ -571,7 +571,7 @@ def read_value(self, dtype=None, count=1):

def read_binary(self, size):
self._pos += int(size)
return self._blob[self._pos - int(size) : self._pos]
return self._blob[self._pos - int(size):self._pos]

def pack(self, obj, compress):
self.protocol = b"mYm\0" # will be replaced with dj0 if new features are used
Expand Down
4 changes: 2 additions & 2 deletions datajoint/external.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@

def subfold(name, folds):
"""
subfolding for external storage: e.g. subfold('aBCdefg', (2, 3)) --> ['ab','cde']
subfolding for external storage: e.g. subfold('aBCdefg', (2, 3)) --> ['ab','cde']
"""
return (
(name[: folds[0]].lower(),) + subfold(name[folds[0] :], folds[1:])
(name[:folds[0]].lower(),) + subfold(name[folds[0]:], folds[1:])
if folds
else ()
)
Expand Down
2 changes: 1 addition & 1 deletion datajoint/preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def repr_html(query_expression):
info = heading.table_status
tuples = rel.fetch(limit=config["display.limit"] + 1, format="array")
has_more = len(tuples) > config["display.limit"]
tuples = tuples[0 : config["display.limit"]]
tuples = tuples[0:config["display.limit"]]

css = """
<style type="text/css">
Expand Down

0 comments on commit 3d1f7cb

Please sign in to comment.