Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
1c124037
Commit
1c124037
authored
6 years ago
by
Mattia Mancini
Browse files
Options
Downloads
Patches
Plain Diff
SW-43
: add support for attributes
parent
d6645da6
No related branches found
No related tags found
1 merge request
!44
Merge back holography to master
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
CAL/CalibrationCommon/lib/datacontainers/holography_dataset.py
+11
-0
11 additions, 0 deletions
...alibrationCommon/lib/datacontainers/holography_dataset.py
with
11 additions
and
0 deletions
CAL/CalibrationCommon/lib/datacontainers/holography_dataset.py
+
11
−
0
View file @
1c124037
...
@@ -361,6 +361,12 @@ class HolographyDataset():
...
@@ -361,6 +361,12 @@ class HolographyDataset():
"""
"""
starting_leaf
=
h5file
[
uri
]
starting_leaf
=
h5file
[
uri
]
result
=
dict
()
result
=
dict
()
# Read the attributes in the hdf5 dataset
result
[
'
ATTRIBUTES
'
]
=
dict
()
for
attribute_key
,
attribute_value
in
starting_leaf
.
attrs
:
result
[
'
ATTRIBUTES
'
][
attribute_key
]
=
attribute_value
for
key
,
value
in
starting_leaf
.
items
():
for
key
,
value
in
starting_leaf
.
items
():
if
isinstance
(
value
,
h5py
.
Group
)
is
True
:
if
isinstance
(
value
,
h5py
.
Group
)
is
True
:
...
@@ -391,6 +397,11 @@ class HolographyDataset():
...
@@ -391,6 +397,11 @@ class HolographyDataset():
else
:
else
:
starting_leaf
=
h5file
[
uri
]
starting_leaf
=
h5file
[
uri
]
# Store the attributes in the hdf5 dataset
attributes
=
data_to_store
.
pop
(
'
ATTRIBUTES
'
,
dict
())
for
attribute_key
,
attribute_value
in
attributes
.
items
():
starting_leaf
.
attrs
[
attribute_key
]
=
attribute_value
for
key
,
value
in
data_to_store
.
items
():
for
key
,
value
in
data_to_store
.
items
():
if
isinstance
(
value
,
dict
)
is
True
:
if
isinstance
(
value
,
dict
)
is
True
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment