Using `--use-getter-setter=none` does not add `add_anytypeobjs_`, but this...
Brought to you by:
dkuhlman
We've used --use-getter-setter=none
to generate our Python file from the XSD. I see that this does not result in the definition of any add_anytypeobjs_()
methods, but at the same time, there are lines that use this method: self.add_anytypeobjs_(content)
. This results in errors of the type "... has no method add_anytypeobjs_".
Should this method be used if it is not being declared?
$ grep -n "add_anytypeobjs" nml.py 1218: self.add_anytypeobjs_(content_) 8994: self.add_anytypeobjs_(content_) 9341: self.add_anytypeobjs_(content_) 12343: self.add_anytypeobjs_(content_) 17312: self.add_anytypeobjs_(content_) 17438: self.add_anytypeobjs_(content_)
The xsd and related files are all attached.
Here's an example error that we get while running our unit tests:
The attached tweaks in the generated nml.py file "fixes" this error.
I've made a fix to this. This patch will prevent the generation of the call to
add_anytypeobjs_
.Could you tell me what XML schema you are using that generates this error. That would enable me to test this change.
Thanks.
Dave
Thanks very much, and sorry for the late reply.
I've attached the XSD and other files we use for generation to the issue. You can also see them in our repository here:
https://github.com/NeuralEnsemble/libNeuroML/tree/development/neuroml/nml
The schema is currently at version 2.2
Ankur,
I tried this with NeuroML_v2.2.xsd. See comments from generated module, below.
I cannot find any references to
add_anytypeobjs_
. This was fixed ingenerateds
v. 2.39.10, I believe.Let me know if
generateds
is still causing this problem.Dave
Thanks very much, Dave. I can confirm that this is now fixed. Please close this ticket as "fixed" :)