Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
alibylite
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Swain Lab
aliby
alibylite
Commits
c9a718d0
Commit
c9a718d0
authored
2 years ago
by
Alán Muñoz
Browse files
Options
Downloads
Patches
Plain Diff
feat(load_attributes): add parameters as dict
parent
f64117ce
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
io/writer.py
+3
-0
3 additions, 0 deletions
io/writer.py
with
3 additions
and
0 deletions
io/writer.py
+
3
−
0
View file @
c9a718d0
...
@@ -7,6 +7,7 @@ from typing import Dict
...
@@ -7,6 +7,7 @@ from typing import Dict
import
h5py
import
h5py
import
numpy
as
np
import
numpy
as
np
import
pandas
as
pd
import
pandas
as
pd
import
yaml
from
utils_find_1st
import
cmp_equal
,
find_1st
from
utils_find_1st
import
cmp_equal
,
find_1st
from
agora.io.bridge
import
BridgeH5
from
agora.io.bridge
import
BridgeH5
...
@@ -18,6 +19,8 @@ from agora.io.utils import timed
...
@@ -18,6 +19,8 @@ from agora.io.utils import timed
def
load_attributes
(
file
:
str
,
group
=
"
/
"
):
def
load_attributes
(
file
:
str
,
group
=
"
/
"
):
with
h5py
.
File
(
file
,
"
r
"
)
as
f
:
with
h5py
.
File
(
file
,
"
r
"
)
as
f
:
meta
=
dict
(
f
[
group
].
attrs
.
items
())
meta
=
dict
(
f
[
group
].
attrs
.
items
())
if
"
parameters
"
in
meta
:
meta
[
"
parameters
"
]
=
yaml
.
safe_load
(
meta
[
"
parameters
"
])
return
meta
return
meta
...
...
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