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
74a72920
Commit
74a72920
authored
4 months ago
by
Thomas Kluyver
Browse files
Options
Downloads
Patches
Plain Diff
Ignore missing sources when finding memory cell patterns
parent
b69bde07
No related branches found
No related tags found
1 merge request
!1114
[LPD] [Correct] Ignore missing sources when finding memory cell patterns
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/cal_tools/lpdlib.py
+6
-2
6 additions, 2 deletions
src/cal_tools/lpdlib.py
with
6 additions
and
2 deletions
src/cal_tools/lpdlib.py
+
6
−
2
View file @
74a72920
...
@@ -4,7 +4,7 @@ from typing import Optional
...
@@ -4,7 +4,7 @@ from typing import Optional
from
warnings
import
warn
from
warnings
import
warn
import
numpy
as
np
import
numpy
as
np
from
extra_data
import
RunDirectory
from
extra_data
import
RunDirectory
,
SourceNameError
def
get_mem_cell_pattern
(
run
,
sources
)
->
np
.
ndarray
:
def
get_mem_cell_pattern
(
run
,
sources
)
->
np
.
ndarray
:
...
@@ -15,7 +15,11 @@ def get_mem_cell_pattern(run, sources) -> np.ndarray:
...
@@ -15,7 +15,11 @@ def get_mem_cell_pattern(run, sources) -> np.ndarray:
"""
"""
patterns
=
[]
patterns
=
[]
for
source
in
sources
:
for
source
in
sources
:
cell_id_data
=
run
[
source
,
'
image.cellId
'
].
drop_empty_trains
()
try
:
cell_id_data
=
run
[
source
,
'
image.cellId
'
].
drop_empty_trains
()
except
SourceNameError
:
continue
# Source missing
if
len
(
cell_id_data
.
train_ids
)
==
0
:
if
len
(
cell_id_data
.
train_ids
)
==
0
:
continue
# No data for this module
continue
# No data for this module
cell_ids
=
cell_id_data
[
0
].
ndarray
().
flatten
()
cell_ids
=
cell_id_data
[
0
].
ndarray
().
flatten
()
...
...
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