Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PAF Backend Simulator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Niclas Esser
PAF Backend Simulator
Commits
3f2a713f
Commit
3f2a713f
authored
8 months ago
by
User
Browse files
Options
Downloads
Patches
Plain Diff
[add]: docstring for h5reader.py
parent
baf8e909
No related branches found
Branches containing commit
No related tags found
1 merge request
!3
[add]: hdf5 file reader: h5reader.py
Pipeline
#212424
passed
8 months ago
Stage: build
Stage: test
Stage: stats
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pafsim/signal_generator/h5reader.py
+28
-1
28 additions, 1 deletion
pafsim/signal_generator/h5reader.py
with
28 additions
and
1 deletion
pafsim/signal_generator/h5reader.py
+
28
−
1
View file @
3f2a713f
...
...
@@ -2,12 +2,30 @@
import
h5py
def
open_hdf5_file
(
filename
):
'''
Open hdf5 file
arguments
filename of the hdf5 file
returns
h5py.File object
'''
return
h5py
.
File
(
filename
)
def
get_item_by_path
(
dataset
,
path
):
'''
Get item by path
arguments
dataset: h5py.File object
path: path of the item
returns
item
'''
indice
=
path
.
split
(
'
/
'
)
indice_length
=
len
(
indice
)
try
:
...
...
@@ -31,6 +49,15 @@ def get_item_by_path(dataset, path):
return
dataset
def
get_structure_tree
(
h5_object
):
'''
Get structure tree of the hdf5 file
arguments
h5_object: h5py.File object
returns
string representation of the structure tree
'''
def
print_attrs
(
name
,
obj
):
nonlocal
string_pointer
level
=
name
.
count
(
'
/
'
)
...
...
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