NeuroML / NeuroML2

This repository hosts the NeuroML 2 Schema, the ComponentType definitions in LEMS and the core documentation of NeuroML2.
https://docs.neuroml.org
GNU Lesser General Public License v3.0
50 stars 24 forks source link

[Bug] XSD: MembraneProperties does not extend either Standalone or Base and so does not have an `id` attribute #161

Closed sanjayankur31 closed 2 years ago

sanjayankur31 commented 3 years ago

I was looking at how one should refer to membrane properties while constructing a path for record from exposures. In PyNeuroML and libNeuroML, MembraneProperties does not take an id attribute. This is because in the schema, it does not extend Standalone or Base.

So, when one uses MembraneProperties(id=...) in libNeuroML, the generated NeuroML file does not have an id attribute. This means that while constructing the path, one has to use membraneProperties/... instead of the id of the membrane property. However, my understanding is that every Component should be able to take an ID. Bits that are not components should be without ID (See https://github.com/NeuroML/Documentation/issues/15).

So should membrane properties extend standalone or base in the schema to ensure it has an ID? if not, why not? Why should things like biophysical properties have IDs which can be used to refer to them but not membrane properties?

This is all just to figure out how paths are to be constructed to record from exposures etc. There needs to be some explanation of why certain elements can be referred by ID but others need to be referred by name, and this needs to be clear from the schema documentation itself (which is generated from the LEMS description xml files), since users should not have to read the XSD file to figure this out.

Extra information:

If I add an id field to the nml file manually, jnml is perfectly happy simulating the model. Of course, since it's not listed in the schema, jnml -validate does not like it.

sanjayankur31 commented 2 years ago

This has come up again because we're adding helper methods in libNeuroML to basewithoutid. MembraneProperties does not even extend that, so it inherits from GenerateDSSuper and does not receive the helper functions we've added to basewithoutid.

sanjayankur31 commented 2 years ago

https://libneuroml.readthedocs.io/en/latest/userdocs/coreclasses.html#basewithoutid

sanjayankur31 commented 2 years ago

Fixed in #189. Closing.