Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
arbor
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Analyze
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
arbor-sim
arbor
Commits
993833df
Unverified
Commit
993833df
authored
2 years ago
by
Thorsten Hater
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Sort (in python) the mechanism names. (#1882)
parent
e8b242b1
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
python/mechanism.cpp
+3
-1
3 additions, 1 deletion
python/mechanism.cpp
with
3 additions
and
1 deletion
python/mechanism.cpp
+
3
−
1
View file @
993833df
...
...
@@ -113,7 +113,9 @@ void register_mechanisms(pybind11::module& m) {
pybind11
::
class_
<
arb
::
mechanism_catalogue
>
cat
(
m
,
"catalogue"
);
struct
mech_cat_iter_state
{
mech_cat_iter_state
(
const
arb
::
mechanism_catalogue
&
cat_
,
pybind11
::
object
ref_
)
:
names
(
cat_
.
mechanism_names
()),
ref
(
ref_
),
cat
(
cat_
)
{
}
mech_cat_iter_state
(
const
arb
::
mechanism_catalogue
&
cat_
,
pybind11
::
object
ref_
)
:
names
(
cat_
.
mechanism_names
()),
ref
(
ref_
),
cat
(
cat_
)
{
std
::
sort
(
names
.
begin
(),
names
.
end
());
}
std
::
vector
<
std
::
string
>
names
;
// cache the names else these will be allocated multiple times
pybind11
::
object
ref
;
// keep a reference to cat lest it dies while we iterate
const
arb
::
mechanism_catalogue
&
cat
;
// to query the C++ object
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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