NeuroML / pyNeuroML

A single package in Python unifying scripts and modules for reading, writing, simulating and analysing NeuroML2/LEMS models.
https://docs.neuroml.org/Userdocs/Software/pyNeuroML.html
GNU Lesser General Public License v3.0
36 stars 30 forks source link

Fix/libneuroml 139 #187

Closed sanjayankur31 closed 2 years ago

sanjayankur31 commented 2 years ago

Addresses: https://github.com/NeuralEnsemble/libNeuroML/issues/139

sanjayankur31 commented 2 years ago

For something like:

input = component_factory("Input", haha="nope")

users will now get this:

pyNeuroML >>> ERROR - 'haha' is not a permitted argument for ComponentType 'Input'

Input -- Specifies a single input to a **target,**  optionally giving the **segmentId**  ( default 0 ) and **fractionAlong**  the segment ( default 0. 5 ).

Please see the NeuroML standard schema documentation at https://docs.neuroml.org/Userdocs/NeuroMLv2.html for more information.

Valid members for Input are:
* fraction_along (class: ZeroToOne, Optional)
* id (class: NonNegativeInteger, Required)
* target (class: xs:string, Required)
* destination (class: NmlId, Required)
* segment_id (class: NonNegativeInteger, Optional)

Traceback (most recent call last):
  File "/home/asinha/Documents/02_Code/00_mine/models/L5bPyrCellHayEtAl2011/neuroConstruct/generatedNeuroML2/L5PC_passive.py", line 135, in <module>
    sim(model())
  File "/home/asinha/Documents/02_Code/00_mine/models/L5bPyrCellHayEtAl2011/neuroConstruct/generatedNeuroML2/L5PC_passive.py", line 98, in model
    input_ = component_factory("Input", id=0,
  File "/home/asinha/.local/share/virtualenvs/pyneuroml-dev/lib/python3.10/site-packages/pyneuroml/utils/__init__.py", line 55, in component_factory
    check_component_type_arg_list(comp, **kwargs)
  File "/home/asinha/.local/share/virtualenvs/pyneuroml-dev/lib/python3.10/site-packages/pyneuroml/utils/__init__.py", line 97, in check_component_type_arg_list
    raise ValueError
ValueError