Activity for generateds

  • generateds generateds released /generateds-2.44.3.tar.gz

  • Dave Kuhlman committed [0d5f62] on Code

    v. 2.44.3 Fixed generation of validate_ methods for superclasses

  • Robert Sachunsky Robert Sachunsky created ticket #42

    reverse node mapping

  • generateds generateds released /generateds-2.44.1.tar.gz

  • Dave Kuhlman Dave Kuhlman committed [7d5296] on Code

    v. 2.44.1 black formatting; fix regexprs for Py 3.12

  • Nik Nik posted a comment on ticket #1

    Hi, we just implemented this in a fork on our gitlab.com group: https://gitlab.com/cdehealth/generateds/-/tree/2.44.1+20240201?ref_type=tags Because of possible references before definition of classes, like unordered in the XSDs, we had to use forward references, not: id: NmlID = None but: id: 'NmlID' = None but we can still use it with getattr(self.id, type_name) It seems Intellisense is not catching it, but we can still use it as intended. Maybe we could merge this into the main repo here. Feedback...

  • Albert Albert created ticket #41

    Wanings in respect to generated code

  • generateds generateds released /generateDS-2.43.3.tar.gz

  • Dave Kuhlman Dave Kuhlman committed [73261a] on Code

    v. 2.43.3 Added warning union inside simpleType and type_substitution unit test

  • generateds generateds released /generateDS-2.43.2.tar.gz

  • Dave Kuhlman Dave Kuhlman committed [aa7474] on Code

    v. 2.43.2 Several fixes for GraphQL support

  • David Camperos David Camperos created ticket #40

    AttributeError: 'str' object has no attribute 'year'

  • Samuel Berntzen Samuel Berntzen created ticket #39

    externalEncoding for UTF-8 outfile

  • generateds generateds released /generateDS-2.43.1.tar.gz

  • Dave Kuhlman Dave Kuhlman committed [1d3773] on Code

    v.. 2.43.1 Added split/join modules capability

  • generateds generateds released /generateDS-2.42.2.tar.gz

  • Dave Kuhlman Dave Kuhlman committed [51051c] on Code

    v. 2.42.2 Added graphql unit test. Added graphql demo.

  • Dave Kuhlman Dave Kuhlman modified a comment on discussion General Discussion

    I have added support for the generation of modules that implement a GraphQL server that can be run with the Strawberry GraphQL Python package (https://strawberry.rocks/docs). You can learn about it here -- http://www.davekuhlman.org/generateDS.html#graphql-support There are likely bugs in this, but I did generate and run it with two reasonably complex examples: (1) the Demos/People schema and XML instance doc in the generateDS repository and (2) the neuroml schema (https://github.com/NeuroML/NeuroML2.git...

  • Dave Kuhlman Dave Kuhlman posted a comment on discussion General Discussion

    I have added support for the generation of modules that implement a GraphQL server that can be run with the Strawberry GraphQL Python package (https://strawberry.rocks/docs). You can learn about it here -- http://www.davekuhlman.org/generateDS.html#graphql-support There are likely bugs in this, but I did generate and run it with two reasonably complex examples: (1) the Demos/People schema and XML instance doc in the generateDS repository and (2) the neuroml schema (https://github.com/NeuroML/NeuroML2.git...

  • generateds generateds released /generateDS-2.42.1.tar.gz

  • Dave Kuhlman Dave Kuhlman committed [15c863] on Code

    v. 2.42.1 Added support for Strawberry and GraphQL

  • David Camperos David Camperos posted a comment on discussion General Discussion

    Forgot to mention: I have added an __init__.py file in the same directory as the models.

  • David Camperos David Camperos posted a comment on discussion General Discussion

    Hello, I have issues when I try to run the generated code from external modules. I have generated Python classes using subclass, so I have a model.py and a model_subs.py files. From my external code I can reach models_subs but from it I cannot reach model.py, so something is happening with the interpreter path. I am able to workaround it by applying in models_subs the following statement: sys.path.append(os.path.abspath(__file__ + "/..")) I place it before the import models as supermod, and everything...

  • generateds generateds released /generateDS-2.41.5.tar.gz

  • Dave Kuhlman Dave Kuhlman committed [326093] on Code

    v. 2.41.5 Changed name of generated method "_hasContent" --> "has__content"

  • generateds generateds released /generateDS-2.41.4.tar.gz

  • Dave Kuhlman Dave Kuhlman committed [7d0cde] on Code

    v. 2.41.4 Fix to formatting of floats.

  • Marco Bomben Marco Bomben modified a comment on ticket #17

    Dear all, I am using generateDS since 2014 and it is a fantastic tool, thanks Dave! I have recently switched to 2.43.1 and I have the problem reported above: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/mbomben/work/python_scripts/make_plots.py", line 17, in mp plot.build(root) File "/Users/mbomben/work/python_scripts/root_multi_graph.py", line 2132, in build self.ns_prefix_ = node.prefix AttributeError: 'xml.etree.ElementTree.Element' object has no attribute...

  • Marco Bomben Marco Bomben posted a comment on ticket #17

    Dear all, I am using generateDS since 2014 and it is a fantastic tool, thanks Dave! I have recently switched to 2.43.1 and I have the problem reported above: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/mbomben/work/python_scripts/make_plots.py", line 17, in mp plot.build(root) File "/Users/mbomben/work/python_scripts/root_multi_graph.py", line 2132, in build self.ns_prefix_ = node.prefix AttributeError: 'xml.etree.ElementTree.Element' object has no attribute...

  • Dave Kuhlman Dave Kuhlman posted a comment on ticket #38

    Thank you for your report. However, I do not know what to do about this. You may be right in suggesting that the behavior should be different. Do you want to submit a patch? If so I'll consider it. But, I do not want to make a change that I do not understand. Maybe you could explain in detail how you think it should function. Or maybe tell me how the current behavior is a problem for you. Is there some behavior that you need and cannot get in main.py? I'll welcome suggestions.

  • Jędrzej Wasik Jędrzej Wasik created ticket #38

    xs:list element type mismatch

  • Jędrzej Wasik Jędrzej Wasik created ticket #37

    "ref" attribute support error

  • Ameya Vikram Singh Ameya Vikram Singh posted a comment on ticket #30

    I hit into this issue recently while trying to convert an xsd specification to python classes using this tool. I am using the following repository to convert IP-XACT xsd specification: https://github.com/olofk/ipxact_gen I used the following command to generate a single file output: PYTHONPATH=. generateDS -f -o pyout/ipx.py --user-methods=gends_user_methods.py 2014/index.xsd Which results in successful conversion with some warnings: *** warning. Removing child with duplicate name: "activeInterface"...

  • Ankur  Sinha Ankur Sinha created ticket #36

    Citing generateDS

  • Laurenz Seidel Laurenz Seidel modified a comment on discussion General Discussion

    Hi there, Have a look at Section 6.2 of the introduction and tutorial. From how I understand your problem, you would need to have a look at the classes generated by generateDS and how they create instances. Then you can create those instances yourself using your DataFrames. In the tutorial, the section shows this for an example and then also exports the resulting XML. Hope that helps, good luck!

  • Laurenz Seidel Laurenz Seidel posted a comment on discussion General Discussion

    Hi there, Have a look at section 6.2 of the introduction and tutorial. From how I understand your problem, you would need to have a look at the classes generated by generateDS and how they create instances. Then you can create those instances yourself using your DataFrames. In the tutorial, the section shows this for an example and then also exports the resulting XML. Hope that helps, good luck!

  • Valerio Miccoli Valerio Miccoli posted a comment on discussion General Discussion

    Hi, first of all i want to say thanks for creating generateDS. I'm managing a vacation house and I need to give the city tourist office an xml report that has some information about the tourist tax payment. Those info are spread across two different management platforms, so I created some python code that takes the data I need from different reports and groups them in a Pandas DataFrame. Then, from an xml report example i created an XSD Schema (the attached file). What I thought I could do is to...

  • generateds generateds released /generateDS-2.41.3.tar.gz

  • Dave Kuhlman Dave Kuhlman committed [d2487e] on Code

    v. 2.41.3 Recognize mixed=true on complexContent

  • generateds generateds released /generateDS-2.41.2.tar.gz

  • Dave Kuhlman Dave Kuhlman committed [08d852] on Code

    v. 2.41.2 Fix to export of mixed and simpleContent

  • Nik Nik posted a comment on ticket #35

    We are aware that this is not true for further child elements. So there should be a check if there is only a text/content/valueOf alone in this element, and written without eol_.

  • Nik Nik created ticket #35

    export adds eol and indent inside of content/valueOf

  • Ashim Giyanani Ashim Giyanani modified a comment on discussion General Discussion

    I followed the examples and suggestions of handling namespaces to read in an xml file. However, I am unable to resolve the issue. Below is the code I am using to generate the Classes and subclasses python generateDS.py -a "gml:" -o gmx_codelists.py -s gmx_codelists_app.py gmxCodelists.xml The error is as follows: AttributeError: 'NoneType' object has no attribute 'annotate' I am attaching the xml file here. I performed a similar conversion from an xsd Catalog file and that worked properly. Can someone...

  • Ashim Giyanani Ashim Giyanani posted a comment on discussion General Discussion

    I followed the examples and suggestions of handling namespaces to read in an xml file. However, I am unable to resolve the issue. Below is the code I am using to generate the Classes and subclasses python generateDS.py -a "gml:" -o gmx_codelists.py -b gmx_codelists_app.py gmxCodelists.xml The error is as follows: AttributeError: 'NoneType' object has no attribute 'annotate' I am attaching the xml file here. I performed a similar conversion from an xsd Catalog file and that worked properly. Can someone...

  • generateds generateds released /generateDS-2.41.1.tar.gz

  • Dave Kuhlman Dave Kuhlman committed [f32dd5]

    v. 2.41.1 Added command line option --use-regex-module

  • Ankur  Sinha Ankur Sinha posted a comment on ticket #1

    +1 for this feature (although I don't know how much work this is to implement). At the moment, our classes all look like this: Izhikevich2007Cell(neuro_lex_id=None, id=None, metaid=None, notes=None, properties=None, annotation=None, C=None, v0=None, k=None, vr=None, vt=None, vpeak=None, a=None, b=None, c=None, d=None, gds_collector_=None, **kwargs_) which means users don't really get any information about what each argument to the constructor should be---they need to go look at our schema documentation...

  • Mustafa Şenol Coşar Mustafa Şenol Coşar created merge request #5

    Fix imports in episodic compilation

  • Mikhail Kulinich Mikhail Kulinich posted a comment on ticket #34

    Dave, Fair enough. Thank you. I am not sure I'll be having enough enthusiasm to support that too. Keep it in backlog if for some reason anyone would want to implement that.

  • Dave Kuhlman Dave Kuhlman posted a comment on ticket #34

    Mikhail, Thanks for your detailed report. Yes, this seems like a reasonable request to me. But ... In response to your ticket and your questions, I have searched a bit at the code in generateDS.py looking for support for namespaces on attributes. I cannot find any. And, adding/implementing that support for namespace prefixes on attribute names would require significant changes at a number of locations in the code. That is not a task that I'm willing to take on. In addition, I'm a bit confused about...

  • Mikhail Kulinich Mikhail Kulinich created ticket #34

    Namespace of attributes

  • Mikhail Kulinich Mikhail Kulinich created ticket #33

    simpleType validation does not report a warning

  • Dave Kuhlman Dave Kuhlman posted a comment on ticket #32

    One more question: What command line flags did you use when you ran generateDS.py (or generateds)? What were the commands that you ran for your test? Perhaps you could copy and paste them in a reply. In general, I'm groping for any information that would enable me to reproduce the error. Dave

  • Dave Kuhlman Dave Kuhlman posted a comment on ticket #32

    Pablo, I'm trying to reproduce the exception that you've reported. Here's what I've done: I copied people.xsd and people.xml from generateds/tests in the source code distribution. I generated a module with this: $ ./generateDS.py -o people.py people.xsd I ran that module against people.xml: $ python people.py people.xml The above ran successfully and produced output. There are also people.xsd and people.xml in the generateds/Demos/People subdirectory. In order to run a test with those, you need to...

  • Pablo Scarpati Pablo Scarpati created ticket #32

    Broken inheritance when generating code

  • Pablo Scarpati Pablo Scarpati posted a comment on discussion General Discussion

    Hello! I have been testing the people library, but when running python people.py people.xml I receive the following error: Traceback (most recent call last): File "people.py", line 4390, in <module> main() File "people.py", line 4383, in main parse(args[0]) File "people.py", line 4253, in parse rootObj.build(rootNode, gds_collector_=gds_collector) File "people.py", line 1196, in build self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) File "people.py", line 1203, in _buildChildren...

  • generateds generateds released /generateDS-2.40.13.tar.gz

  • Dave Kuhlman Dave Kuhlman committed [be695f]

    v. 2.40.13 Fix for default value and/or nillable

  • Dave Kuhlman Dave Kuhlman posted a comment on ticket #31

    Great, That patch, including your refinement, has now been uploaded as v. 2.40.12. Thanks again. Dave

  • Dave Kuhlman Dave Kuhlman posted a comment on ticket #29

    Great, That patch has now been uploaded as v. 2.40.12. Thanks again. Dave

  • generateds generateds released /generateDS-2.40.12.tar.gz

  • Dave Kuhlman Dave Kuhlman committed [791ee1]

    v. 2.40.12 Strip white space boolean values and backslash-n to &#10;

  • Gabriel Kleinoscheg Gabriel Kleinoscheg posted a comment on ticket #29

    Hey, yes, that looks good. Thank you for your effort! Regard, Gabriel

  • Pete Forman Pete Forman posted a comment on ticket #31

    That works but I did a small refinement to my fix. Your patch also includes the second iteration of fix for ticket #29. So here is what I am using for this ticket alone rather than a patch. def gds_parse_boolean(self, input_data, node=None, input_name=''): input_data = input_data.strip() if input_data in ('true', '1'): bval = True elif input_data in ('false', '0'): bval = False else: raise_parse_error(node, 'Requires boolean value') return bval

  • Dave Kuhlman Dave Kuhlman posted a comment on ticket #31

    Pete, Thanks for reporting this. Attached is a patch -- actually, it's just the change that you suggest above. If it looks good to you, let me know, and it will be in the next release. Dave

  • Pete Forman Pete Forman created ticket #31

    boolean validation with whitespace

  • Dave Kuhlman Dave Kuhlman posted a comment on ticket #29

    OK. So, attached is another patch. With this patch, generateDS.py produces the following line in the generated module: s1 = s1.replace('\n', '&#10;') I'm actually unsure about what it is supposed to do. So, I'll wait for you to tell me that it works and solves your problem before I upload another release. Thanks for your very helpful and explicit description of a solution. Hope I got it right this time. Dave

  • Gabriel Kleinoscheg Gabriel Kleinoscheg modified a comment on ticket #29

    Unfortunately, no. However, I do have a question: In the source of generateDS.py I find s1 = s1.replace(r'\\n', '&#10;'). In any other source file of your project, however, I find s1 = s1.replace(r'\n', '&#10;'). Why this difference? When I run generateDS on my schema the resulting Super.py contains s1 = s1.replace(r'\n', '&#10;') Here's what I found out: - s1 = s1.replace(r'\n', '&#10;') would work for a string like the following s1 = 'test\\ntest' - s1 = s1.replace(r'\n', '&#10;') would NOT work...

  • Gabriel Kleinoscheg Gabriel Kleinoscheg posted a comment on ticket #29

    Unfortunately, no. However, I do have a question: In the source of generateDS.py I find s1 = s1.replace(r'\\n', '&#10;'). In any other source file of your project, however, I find s1 = s1.replace(r'\n', '&#10;'). Why this difference? When I run generateDS on my schema the resulting Super.py contains s1 = s1.replace(r'\n', '&#10;') Here's what I found out: - s1 = s1.replace(r'\n', '&#10;') would work for a string like the following s1 = 'test\\ntest' -s1 = s1.replace(r'\n', ' ')would NOT work for...

  • Dave Kuhlman Dave Kuhlman posted a comment on ticket #29

    Concerning your question about what is the difference between the following two lines? s1 = s1.replace(r'\\n', '&#10;') s1 = s1.replace('\n', '&#10;') Try running the following: a = r'\\n' b = '\n' print(len(a)) print(len(b)) print(a[0]) print(a[1]) print(a[2]) print(ord(b)) Thanks for the link to the StackOverflow page. Yes, that is informative and is a good explanation. So, did that latest version (v. 2.40.11) fix things for you? Dave

  • Gabriel Kleinoscheg Gabriel Kleinoscheg posted a comment on ticket #29

    Dave, I just got aware of the fact that you added the following line: s1 = s1.replace(r'\\n', '&#10;') What would be the difference to the following line: s1 = s1.replace('\n', '&#10;') Taking the test here - only s2 contains the correct output (with &#10;): string = '''asdf\nasdf''' s1 = string.replace(r'\\n', '&#10;') print(s1) s2 = string.replace('\n', '&#10;') print(s2) Regards, Gabriel

  • Gabriel Kleinoscheg Gabriel Kleinoscheg posted a comment on ticket #29

    Dave, thank you for the quick response and implementation. I still owe you some explanation about this - the best I found is here https://stackoverflow.com/questions/514635/represent-space-and-tab-in-xml-tag I hope that helps. Thank you! Gabriel

  • Dave Kuhlman Dave Kuhlman posted a comment on ticket #29

    Gabriel, I've created a new release: v. 2.40.11. It has been uploaded to sourceforge.net and to pypi.org. Thanks for your help with this. Dave

  • generateds generateds released /generateDS-2.40.11.tar.gz

  • Dave Kuhlman Dave Kuhlman committed [db3d0f]

    v. 2.40.11 Added transform of backslash-n to &#10;

  • Dave Kuhlman Dave Kuhlman posted a comment on ticket #30

    David, Thanks for the report and the link to the schemas. I've looked into this a bit. I don't think I'm going to be able to fix it. It looks like fixes would be needed at multiple places in the code. There are several other places in the code where similar recursion-limit-exceeded occurs. And, I don't even know the correct way to fix any of those places. I can patch those to skip the recursion error, but then the module that we generate is incomplete. If you have a suggestion or a patch, please...

  • Dave Kuhlman Dave Kuhlman posted a comment on ticket #29

    Gabriel, Thanks for the note. Your suggestion to transformed "\n" to " " sounds good to me. Although, I actually have no idea what the correct policy should be on this. If you have a rational, I'd be interested. I added a line to generateDS.py that replaces "\n" with " ". Hope I got it right. Attached is a patch. Please let me know whether this is what you intended and whether it works for you. If it works, I'll create a new release. Thanks for help. Dave

  • David Zabala David Zabala created ticket #30

    Namespace Recursion

  • Gabriel Kleinoscheg Gabriel Kleinoscheg created ticket #29

    Convert \n to &#10;

  • generateds generateds released /generateDS-2.40.10.tar.gz

  • Dave Kuhlman Dave Kuhlman committed [bbe4c3]

    v. 2.40.10 Force conversion to string for anytypeobjs

  • generateds generateds released /generateDS-2.40.9.tar.gz

  • Dave Kuhlman Dave Kuhlman committed [e5a09b]

    v. 2.40.9 Fix to method gds_validate_simple_patterns

  • Dave Kuhlman Dave Kuhlman committed [e7a4b0]

    v. 2.40.9 Fix to method gds_validate_simple_patterns and update README

  • generateds generateds released /generateDS-2.40.8.tar.gz

  • Dave Kuhlman Dave Kuhlman committed [36795d]

    v. 2.40.8 Fix to generated __str__ method

  • generateds generateds released /generateDS-2.40.7.tar.gz

  • Dave Kuhlman Dave Kuhlman committed [915008]

    v. 2.40.7 Fixes for -p (class name prefix) command line option

  • Dave Kuhlman Dave Kuhlman posted a comment on ticket #28

    Ankur, Your fix looks good to me. I've applied that patch, did some testing, created a new version, and uploaded it to PyPI and SourceForge.net. Thanks for your help with this. Please let me know if/when there is another issue. Dave

  • generateds generateds released /generateDS-2.40.6.tar.gz

  • Dave Kuhlman Dave Kuhlman committed [615f95]

    v. 2.40.6 Fix for Python 2.7 and StringIO

  • Ankur  Sinha Ankur Sinha posted a comment on ticket #28

    Hi Dave, I think I figured out what was going on. In the generated nml.py file, in the __str__ method of GeneratedsSuper, we're initialising a new output variable as an object of the StringIO class. At the moment, we simply from io import StringIO, which while works for Python 3, isn't the right StringIO to use for Python 2. In Python 2, for strings, we must use StringIO.StringIO because there, io.StringIO is for unicode strings. So, I think the generateds.py code should be tweaked as per this diff:...

  • Ankur  Sinha Ankur Sinha posted a comment on ticket #28

    Hi Dave, I haven't been able to pin point the cause of the error yet but I did find a workaround that fixes the issue for us: https://github.com/NeuralEnsemble/libNeuroML/pull/110/commits/aa025c608a678697d14acaca1cf8d7ed0a0a7fd6 The error is caused when we use nml.py with other bits, like reading from HDF5 files, so I'm thinking it's caused by some code in our HDF5 related methods where we haven't been careful enough to take both Python 2 and 3 into account. So we'll just carry this tweak for the...

  • Ankur  Sinha Ankur Sinha posted a comment on ticket #28

    Hi Dave, Thanks for that. I'll go through the failing test and see if I can narrow it down. If you're not seeing the error, it could be something else in the library that's using nml.py perhaps. I'll report back once I have something. Thanks again, Ankur

  • Dave Kuhlman Dave Kuhlman posted a comment on ticket #28

    OK, I've found a number of examples (*.nml) here: https://github.com/NeuroML/NeuroML2/tree/master/examples. But, the ones I have tried so far do not cause an exception, either with Python 3.9.7 nor with Python 2.7.18. The ones I've tried are: NML2_AnalogSynapsesHH.nml NML2_FullNeuroML.nml NML2_PyNNCells.nml For example, it displays exported output when I run this: $ python nml.py NML2_FullNeuroML.nml By the way, I'm running nml.py with Python 2.7.18, but I generated nml.py with Python 3.9.7. Dav...

  • Dave Kuhlman Dave Kuhlman posted a comment on ticket #28

    Ankur, Thanks for your help with this. What I've done so far: Downloaded NeuroML_v2.2.xsd, helper_methods.py, and regenerate-nml.sh. Modified regenerate-nml.sh for my environment: path to generateDS.py, name of XML schema file. Ran regenerate-nml.sh -- generated nml.py. Build a virtual environment with Python 2.7.18, then installed lxml, and six required by generateDS. Next -- I need to run the new nml.py against an XML instance document so that it generates the reported exception. I looked in the...

  • Ankur  Sinha Ankur Sinha created ticket #28

    Python2.7: TypeError: unicode argument expected, got 'str'

  • Dave Kuhlman Dave Kuhlman modified ticket #26

    f'' strings break pre-3.6 Python releases

1 >