Hello,
Thanks very much for generateDS. We use it in NeuroML to generate our Python bindings from the Schema (https://github.com/NeuralEnsemble/libNeuroML/).
While recently regenerating the schema to include some tweaks to our helper methods, I ran into an issue where our tests would fail with the given message: "TypeError: %d format: a number is required, not str". I tracked it down to the gds_format_integer
method in the GeneratedSuper
class:
def gds_format_integer(self, input_data, input_name=''):
return '%d' % input_data
Here, since input_data
is a string, it throws the error. So, a tweak like this seems to "fix" it:
return '%d' % int(input_data)
(A similar tweak is required for the gdf_format_float
method also)
I was wondering if this is because of an error in our Schema (or its usage), or if it's perhaps a tweak needed in generateDS? I attach the Schema and the generated file here and will be happy to help diagnose the issue further.
Thanks very much,
We're still seeing this on
generateDS.py version 2.39.9
with Python 3.9.Modifying the generated file to include the tweak mentioned above still fixes it.
Could this please be looked at (and if the tweak is correct, included in the next release)?