Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tomotools
Nabu
Commits
21278a92
Commit
21278a92
authored
May 11, 2020
by
Pierre Paleo
Browse files
NXWriter: dont write config if not existing
parent
01a02f88
Changes
1
Hide whitespace changes
Inline
Side-by-side
nabu/io/writer.py
View file @
21278a92
...
...
@@ -68,16 +68,15 @@ class NXProcessWriter(Writer):
nx_process
[
'date'
]
=
datetime
.
now
().
replace
(
microsecond
=
0
).
isoformat
()
nx_process
[
'sequence_index'
]
=
np
.
int32
(
processing_index
)
if
config
is
None
:
config
=
{}
export_dict_to_h5
(
config
,
self
.
fname
,
'/'
.
join
([
nx_process
.
name
,
'configuration'
]),
overwrite_data
=
True
,
mode
=
"a"
)
nx_process
[
'configuration'
].
attrs
[
'NX_class'
]
=
"NXcollection"
if
config
is
not
None
:
export_dict_to_h5
(
config
,
self
.
fname
,
'/'
.
join
([
nx_process
.
name
,
'configuration'
]),
overwrite_data
=
True
,
mode
=
"a"
)
nx_process
[
'configuration'
].
attrs
[
'NX_class'
]
=
"NXcollection"
nx_data
=
nx_process
.
require_group
(
'results'
)
nx_data
.
attrs
[
'NX_class'
]
=
"NXdata"
nx_data
.
attrs
[
'signal'
]
=
"data"
...
...
Write
Preview
Markdown
is supported
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