Conversation
… mechanism. If there is no mod file for the implementation, returns "". Note the first line of the code is the name of the modfile.
>>> from neuron import h
>>> s = h.Section(name='s')
>>> mt = h.MechanismType(0)
>>> dir(mt)
['__bool__', '__call__', '__class__', '__delattr__', '__delitem__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__init__', '__iter__', '__le__', '__len__', '__lt__', '__module__', '__ne__', '__new__', '__next__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__setstate__', '__sizeof__', '__str__', '__subclasshook__', 'action', 'baseattr', 'code', 'count', 'file', 'has_net_event', 'hname', 'hocobjptr', 'internal_type', 'is_artificial', 'is_netcon_target', 'make', 'menu', 'pp_begin', 'pp_next', 'remove', 'same', 'select', 'selected']
>>> mt.select('hh')
0.0
>>> mt.file()
'hh.mod'
>>> print('\n'.join(mt.code().split('\n')[:4]))
TITLE hh.mod squid sodium, potassium, and leak channels
COMMENT
This is the original Hodgkin-Huxley treatment for the set of sodium,
a ::: commented full path line if realpath available, inserts the text of the INCLUDE file, and closes the text with a ::: commented "end INCLUDE fname" line.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.