Re: [sympy] Sympy and MathML... ideas?

2013-07-03 Thread peibol
Ok, I'll try tonight. El miércoles, 3 de julio de 2013 18:57:21 UTC+2, Ondřej Čertík escribió: > > Hi Pablo, > > sorry for my shortcut. :) PR = pull request, here is how it works: > > https://help.github.com/articles/using-pull-requests > > yes we use git and github. Start by: > > git clone ht

Re: [sympy] Sympy and MathML... ideas?

2013-07-03 Thread Ondřej Čertík
Hi Pablo, sorry for my shortcut. :) PR = pull request, here is how it works: https://help.github.com/articles/using-pull-requests yes we use git and github. Start by: git clone https://github.com/sympy/sympy and try to follow the help article. Please ask if you get stuck. Using git and github

Re: [sympy] Sympy and MathML... ideas?

2013-07-03 Thread peibol
Sure. Call me stupid, but what's a PR? I'll need some help with the procedure. Are you using GIT or what? El miércoles, 3 de julio de 2013 18:18:02 UTC+2, Ondřej Čertík escribió: > > Excellent. > > Pablo, can you please send a PR with this? We'll then improve it there > and I can help with se

Re: [sympy] Sympy and MathML... ideas?

2013-07-03 Thread Ondřej Čertík
Excellent. Pablo, can you please send a PR with this? We'll then improve it there and I can help with setting up the tests. Please ask if you get stuck. Ondrej On Wed, Jul 3, 2013 at 9:49 AM, Aaron Meurer wrote: > Yes, definitely. Eventually, I would like to have a nice framework to > make pars

Re: [sympy] Sympy and MathML... ideas?

2013-07-03 Thread Aaron Meurer
Yes, definitely. Eventually, I would like to have a nice framework to make parsing things like this easier and have a nicer, more extensible API, but for now, I think even simple parsers like this are better than nothing. Aaron Meurer On Wed, Jul 3, 2013 at 10:48 AM, Ondřej Čertík wrote: > Pablo

Re: [sympy] Sympy and MathML... ideas?

2013-07-03 Thread Ondřej Čertík
Pablo, On Wed, Jul 3, 2013 at 5:38 AM, peibol wrote: > It will be something like that. For the moment, I'm just implemented the > basics of presentation mathml. I will add features as I need them. > > After running it, sympify should be called. What do you think about it? > > def parseMML(mmlinpu

Re: [sympy] Sympy and MathML... ideas?

2013-07-03 Thread peibol
It will be something like that. For the moment, I'm just implemented the basics of presentation mathml. I will add features as I need them. After running it, sympify should be called. What do you think about it? def parseMML(mmlinput): from lxml import etree from StringIO import * from lxml impo

Re: [sympy] Sympy and MathML... ideas?

2013-07-02 Thread peibol
Thanks, I'll try to make my function the more generic I can. El martes, 2 de julio de 2013 21:01:00 UTC+2, Ondřej Čertík escribió: > > On Tue, Jul 2, 2013 at 12:32 PM, peibol > > wrote: > > I think xml2dict cannot accomplish it, since I get the same key for > multiple > > values... > > > >

Re: [sympy] Sympy and MathML... ideas?

2013-07-02 Thread Ondřej Čertík
On Tue, Jul 2, 2013 at 12:32 PM, peibol wrote: > I think xml2dict cannot accomplish it, since I get the same key for multiple > values... > > For example: mathml_prueba=''' 3 > 5''' > > I get the following dict: > {'mrow': {'mfrac': {'mrow': [{'mn': '3'}, {'mn': '5'}]}}} > Notice the merge

Re: [sympy] Sympy and MathML... ideas?

2013-07-02 Thread peibol
I think xml2dict cannot accomplish it, since I get the same key for multiple values... For example: mathml_prueba=''' 3 5''' I get the following dict: {'mrow': {'mfrac': {'mrow': [{'mn': '3'}, {'mn': '5'}]}}} Notice the merged 'mrow' key... Any suggestion for a xml lib to parse the ex

Re: [sympy] Sympy and MathML... ideas?

2013-07-02 Thread peibol
The mathdox box produces Presentation Mathml. Sympy produces Content Mathml in the printing module, but there is the c2p function in utils module that converts Content Mathml into Presentation Mathml. So I'm trying the xml2dict parsing with presentation mathml... I think that once I have the d

Re: [sympy] Sympy and MathML... ideas?

2013-07-02 Thread Aaron Meurer
Just to be clear, is this presentation mathml or content mathml? I believe the latter would be much easier to parse. Aaron Meurer On Tue, Jul 2, 2013 at 12:03 PM, Ondřej Čertík wrote: > On Tue, Jul 2, 2013 at 10:35 AM, Stefan Krastanov > wrote: >> I am sorry, I do not think there is an out-of-t

Re: [sympy] Sympy and MathML... ideas?

2013-07-02 Thread Ondřej Čertík
On Tue, Jul 2, 2013 at 10:35 AM, Stefan Krastanov wrote: > I am sorry, I do not think there is an out-of-the-box way to do this > currently. > > What I can suggest is to use the xml2dict python library to parse the > openmath xml and then write your own small routine for traversing the > dictiona

Re: [sympy] Sympy and MathML... ideas?

2013-07-02 Thread Stefan Krastanov
I am sorry, I do not think there is an out-of-the-box way to do this currently. What I can suggest is to use the xml2dict python library to parse the openmath xml and then write your own small routine for traversing the dictionary and transforming it into a sympy expression. If you do this I am s

Re: [sympy] Sympy and MathML... ideas?

2013-07-02 Thread peibol
Hehe, they don't write the expression in MathML, I'm not that kind of demon. They enter expressions in a textarea by means of http://mathdox.org/formulaeditor/, from which I can get the openmath or the (presentation) mathml .The web app is for K12 students, well 12-16 years old, so I think th

Re: [sympy] Sympy and MathML... ideas?

2013-07-02 Thread Stefan Krastanov
This is probably not very helpful, but why require the students to write their results in MathML? It is not a very natural way to write expression. On the other hand, if you use valid python expression it would probably be much easier. -- You received this message because you are subscribed to th

[sympy] Sympy and MathML... ideas?

2013-07-02 Thread peibol
Hi all: Is there no support for importing MathMLexpressions into Sympy yet? As the issue is still open, maybe someone knows a workaround for what I'm trying to do. My web application renders some mathematic