Skip to content
Snippets Groups Projects
Commit 022ef40d authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Fix fix

parent 65ca6bc1
No related branches found
No related tags found
No related merge requests found
Pipeline #14168 passed with warnings
...@@ -174,7 +174,7 @@ class Branch: ...@@ -174,7 +174,7 @@ class Branch:
def __len__(self): def __len__(self):
if not self._index_chain: if not self._index_chain:
return len(self._branch) return len(self._branch)
elif isinstance(self._index_chain[0], (int, np.int32, np.int64)): elif isinstance(self._index_chain[-1], (int, np.int32, np.int64)):
if len(self._index_chain) == 1: if len(self._index_chain) == 1:
try: try:
return len(self[:]) return len(self[:])
...@@ -191,11 +191,10 @@ class Branch: ...@@ -191,11 +191,10 @@ class Branch:
def is_single(self): def is_single(self):
"""Returns True when a single branch is selected.""" """Returns True when a single branch is selected."""
if len(self._index_chain) > 0: if len(self._index_chain) > 0:
if isinstance(self._index_chain[-1], (int, np.int32, np.int64)): if isinstance(self._index_chain[0], (int, np.int32, np.int64)):
return True return True
return False return False
def __iter__(self): def __iter__(self):
self._iterator_index = 0 self._iterator_index = 0
return self return self
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment