Skip to content

Commit

Permalink
Merge pull request #1092 from vasole/BrokenLink
Browse files Browse the repository at this point in the history
[GUI] String datasets marked as broken links
  • Loading branch information
vasole authored Nov 18, 2024
2 parents 6742fc1 + 7910d44 commit 884bfc0
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/PyMca5/PyMcaGui/io/hdf5/HDF5Widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,20 @@ def children(self):
for i in range(len(finalList)):
# avoid an error at silx level with the linechecking "if finalList[i][1] and "
finalListIsTrue = True
if hasattr(finalList[i][1], "shape"):
if not len(finalList[i][1].shape):
finalListIsTrue = False
dataset = finalList[i][1]
if hasattr(dataset, "shape"):
if not len(dataset.shape):
# it can still be a string
if hasattr(dataset, "dtype"):
if safe_str(dataset.dtype).startswith("|S"):
pass
elif safe_str(dataset.dtype) == "object":
# issue 1059
pass
else:
finalListIsTrue = False
else:
finalListIsTrue = False
if finalListIsTrue and not isinstance(finalList[i][1], str):
finalList[i][1]._posixPath = posixpath.join(self.name,
finalList[i][0])
Expand Down

0 comments on commit 884bfc0

Please sign in to comment.