Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
XRD
darfix
Commits
05091086
Commit
05091086
authored
Jul 09, 2021
by
Julia Garriga Ferrer
Browse files
[core][dataset] Fix typo when data is empty
parent
2a702853
Pipeline
#50354
passed with stage
in 2 minutes and 7 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
darfix/core/dataset.py
View file @
05091086
...
...
@@ -796,6 +796,7 @@ class Dataset():
io_utils
.
advancement_display
(
0
,
len
(
data
),
"Applying shift"
)
if
dimension
is
not
None
:
# Convert dimension and value into list
if
type
(
dimension
[
0
])
is
int
:
dimension
[
0
]
=
[
dimension
[
0
]]
...
...
@@ -1550,7 +1551,6 @@ class Data(numpy.ndarray):
del
_file
[
"dataset"
]
_file
.
create_dataset
(
"dataset"
,
new_shape
,
dtype
=
self
.
dtype
)
for
i
,
img
in
enumerate
(
data
):
_file
[
"dataset"
][
i
]
=
img
urls
.
append
(
DataUrl
(
file_path
=
path
,
data_path
=
"/dataset"
,
data_slice
=
i
,
scheme
=
'silx'
))
...
...
@@ -1628,7 +1628,9 @@ class Data(numpy.ndarray):
raise
TypeError
(
"Axis must be None, 0 or 1"
)
else
:
if
axis
==
0
:
if
not
data
.
shape
[
0
]:
if
data
.
size
==
0
:
return
numpy
.
array
([])
elif
not
data
.
shape
[
0
]:
return
numpy
.
zeros
(
data
[
0
].
shape
)
zsum
=
numpy
.
array
(
data
[
0
],
dtype
=
numpy
.
float64
)
for
i
in
range
(
1
,
len
(
data
)):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment