Skip to content
Snippets Groups Projects
Unverified Commit d2623ecf authored by thorstenhater's avatar thorstenhater Committed by GitHub
Browse files

More pythonic membership on mechanism_catalogue. (#1306)

Introduce two minor changes to the Python API
to handle mechanism_catalogues idiomatically.

Instead of

import arbor as A

cat = A.default_catalogue()

if cat.has('hh'):
  print("Found HH.")

for mech in cat.keys():
   print("*", mech)

we can now write

import arbor as A

cat = A.default_catalogue()

if 'hh' in cat:
  print("Found HH.")

for mech in cat:
   print("*", mech)

which is closer to the expectations of Python users.
parent 54ab542f
No related branches found
No related tags found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment