Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pycalibration
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Contributor 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
calibration
pycalibration
Commits
2ac3e42e
Commit
2ac3e42e
authored
2 years ago
by
Karim Ahmed
Browse files
Options
Downloads
Patches
Plain Diff
remove cal_tools.tools changes
parent
070d574f
Branches
fix/manual_edit_conditions
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!738
New calcat interface
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/cal_tools/tools.py
+0
-35
0 additions, 35 deletions
src/cal_tools/tools.py
with
0 additions
and
35 deletions
src/cal_tools/tools.py
+
0
−
35
View file @
2ac3e42e
...
@@ -880,41 +880,6 @@ def save_constant_metadata(
...
@@ -880,41 +880,6 @@ def save_constant_metadata(
const_mdata
[
"
creation-time
"
]
=
None
const_mdata
[
"
creation-time
"
]
=
None
def
load_constants_dict
(
retrieved_constants
:
dict
,
empty_constants
:
Optional
[
dict
]
=
None
,
)
->
Tuple
[
dict
,
dict
]:
"""
Load constant data from metadata in the
retrieved_constants dictionary.
:param retrieved_constants: A dict. with the constant filepaths and
dataset-name to read the constant data arrays.
{
'
Constant Name
'
: {
'
file-path
'
:
'
/gpfs/.../*.h5
'
,
'
dataset-name
'
:
'
/module_name/...
'
,
'
creation-time
'
: str(datetime),},
}
:param empty_constants: A dict of constant names keys and
the empty constant array to use in case of not non-retrieved constants.
:return constant_data: A dict of constant names keys and their data.
"""
const_data
=
dict
()
when
=
dict
()
for
cname
,
mdata
in
retrieved_constants
.
items
():
const_data
[
cname
]
=
dict
()
when
[
cname
]
=
mdata
[
"
creation-time
"
]
if
when
[
cname
]:
with
h5py
.
File
(
mdata
[
"
path
"
],
"
r
"
)
as
cf
:
const_data
[
cname
]
=
np
.
copy
(
cf
[
f
"
{
mdata
[
'
dataset
'
]
}
/data
"
])
else
:
const_data
[
cname
]
=
(
empty_constants
[
cname
]
if
empty_constants
else
None
)
return
const_data
,
when
def
load_specified_constants
(
def
load_specified_constants
(
retrieved_constants
:
dict
,
retrieved_constants
:
dict
,
empty_constants
:
Optional
[
dict
]
=
None
,
empty_constants
:
Optional
[
dict
]
=
None
,
...
...
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