Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aliby-mirror
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
aliby-mirror
Commits
e2c40907
Commit
e2c40907
authored
2 years ago
by
Alán Muñoz
Browse files
Options
Downloads
Patches
Plain Diff
docs(cells): Improve function docs
parent
b1ef5bee
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/agora/io/cells.py
+5
-2
5 additions, 2 deletions
src/agora/io/cells.py
with
5 additions
and
2 deletions
src/agora/io/cells.py
+
5
−
2
View file @
e2c40907
...
...
@@ -160,8 +160,11 @@ class Cells:
def
group_by_traps
(
self
,
traps
:
t
.
Collection
,
cell_labels
:
t
.
Collection
)
->
t
.
Dict
[
int
,
t
.
List
[
int
]]:
# returns a dict with traps as keys and list of labels as value
# Data is a
"""
Returns a dict with traps as keys and list of labels as value.
Note that the total number of traps are calculated from Cells.traps.
"""
iterator
=
groupby
(
zip
(
traps
,
cell_labels
),
lambda
x
:
x
[
0
])
d
=
{
key
:
[
x
[
1
]
for
x
in
group
]
for
key
,
group
in
iterator
}
d
=
{
i
:
d
.
get
(
i
,
[])
for
i
in
self
.
traps
}
...
...
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