Kappa-Dev / KAMI

Bio-curation library for modelling cellular signalling
MIT License
7 stars 0 forks source link

Possible fix to add_interaction from hierarchy.py #19

Open slegare2 opened 6 years ago

slegare2 commented 6 years ago

I always got the following error when trying to build a KAMI model with add_interaction():

 File "intact.py", line 821, in <module>
    kami_model.add_interaction(kami_interactions[0], anatomize=False)
  File "/home/slegare/ENS/venv_meta_update/lib/python3.6/site-packages/kami-1.2-py3.6.egg/kami/hierarchy.py", line 851, in add_interaction
    nugget, nugget_type = generate_from_interaction(interaction)
TypeError: generate_from_interaction() missing 1 required positional argument: 'interaction'

Looking at function generate_from_interaction(), it requires 2 arguments; hierarchy and interaction. To fix the error, I added "self" to the arguments in line 851 of hierarchy.py:

nugget, nugget_type = generate_from_interaction(self, interaction)

It works, but is it weird to add "self" as argument? If this fix is ok I would push it.