Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tomotools
tomoscan
Commits
f692d7d0
Commit
f692d7d0
authored
Jul 31, 2020
by
payno
Browse files
[hdf5tomoscan] fix: path is the master file and not the folder path
parent
e70955e3
Pipeline
#30753
passed with stages
in 3 minutes and 21 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
tomoscan/esrf/hdf5scan.py
View file @
f692d7d0
...
...
@@ -122,16 +122,6 @@ class HDF5TomoScan(TomoScanBase):
scan
=
os
.
path
.
dirname
(
scan
)
else
:
self
.
master_file
=
self
.
get_master_file
(
scan
)
self
.
master_file
=
os
.
path
.
join
(
scan
,
os
.
path
.
basename
(
scan
))
if
os
.
path
.
exists
(
self
.
master_file
+
'.nx'
):
self
.
master_file
=
self
.
master_file
+
'.nx'
elif
os
.
path
.
exists
(
self
.
master_file
+
'.hdf5'
):
self
.
master_file
=
self
.
master_file
+
'.hdf5'
elif
os
.
path
.
exists
(
self
.
master_file
+
'.h5'
):
self
.
master_file
=
self
.
master_file
+
'.h5'
else
:
self
.
master_file
=
self
.
master_file
+
'.nx'
else
:
self
.
master_file
=
None
...
...
@@ -284,6 +274,7 @@ class HDF5TomoScan(TomoScanBase):
@
docstring
(
TomoScanBase
.
to_dict
)
def
to_dict
(
self
)
->
dict
:
res
=
super
().
to_dict
()
res
[
self
.
DICT_PATH_KEY
]
=
self
.
master_file
res
[
self
.
_DICT_ENTRY_KEY
]
=
self
.
entry
return
res
...
...
@@ -312,6 +303,7 @@ class HDF5TomoScan(TomoScanBase):
assert
self
.
DICT_PATH_KEY
in
data
self
.
path
=
data
[
self
.
DICT_PATH_KEY
]
self
.
_entry
=
data
[
self
.
_DICT_ENTRY_KEY
]
self
.
master_file
=
self
.
get_master_file
(
self
.
path
)
return
self
@
property
...
...
tomoscan/esrf/test/test_hdf5scan.py
View file @
f692d7d0
...
...
@@ -85,7 +85,7 @@ class TestHDF5Scan(HDF5TestBaseClass):
# check conversion to dict
_dict
=
self
.
scan
.
to_dict
()
scan2
=
HDF5TomoScan
.
from_dict
(
_dict
)
self
.
assertEqual
(
scan2
.
path
,
self
.
scan
.
path
)
self
.
assertEqual
(
scan2
.
master_file
,
self
.
scan
.
master_file
)
self
.
assertEqual
(
scan2
.
entry
,
self
.
scan
.
entry
)
def
testFrames
(
self
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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