Hi. I can't really tell much about your application from what you wrote, so I hope my responses are relevant.
On Apr 14, 2011, at 12:33 AM, Shyam wrote: > Dear All, > I am involved in developing SymPy based application. Is this a mobile application or a desktop application? > > Python being a very powerful tool by itself, I am leveraging on its > simplicity for creating user interfaces for SymPy. The context of > current layout is to design some thing like a calculator with buttons. > Please feel free to give me your views in designing the keypad layout. > If you know any other layout like this kindly let me know. The only one that I know of is in this Android app that someone made for SymPy: https://market.android.com/details?id=com.funmath.mathscript. > > Objectives:: > To create an user interface for people in all levels > By default, it should be like a calculator > Two modes possible: > **Calculator mode: (the input box can be edited only with buttons, > just like a calc.) > **CAG Mode: (more like a command prompt, along with buttons to insert > predefined texts and provides hints) > > With that in mind, I have categorized the keypad as a nested class. > For now, the class (schematically) looks like this > ================================= > Class:: Function: > Members:: > * Name (ex: 'integrate') > * Function (ex: 'integrate') > * Syntax (ex: '(,)' ) > * Variable Hint (ex: ['function', 'variable']) > * Example (ex: 'var('x'); integrate(sin(x),x)' ) > * arguments [] > * Children Functions[] (if child present, clicking the function will > open another window of functions) > > * Button properties (size, position etc.) > > Member Methods:: > IsValid( ) :: Check the arguments recursively if they are valid > (returns true or false) > evalfunc() :: Evaluate the function (throws exception if not valid) > AddChild(Function e):: add the function to the children functions > making this instance a KeyPad. > ================================= I can't say much about good object oriented design. > > The layout will have many categorized Pads (like algebra, calculus > etc.) with relevant functions in them. The default pad will resemble > an ordinary calculator. This is a good idea. SymPy has a ton of functions, and most users will only care about a small subset of them. Another idea, which would be much more difficult to implement, is to make the keyboard "smart". So that it "learns" what functions you use and puts them up front, and also has some contextual intelligence (for example, the second argument of functions like integrate and diff should be a defined Symbol, and if you have a . after something, it means you are going to call a method). Also, some kind of "tab completion" would be helpful (like IPython has). This is unrelated to the keyboard, but you might consider at least making it an option to pass everything as a string through sympify(), so that the user doesn't have to worry about symbol instantiation (especially if it is a mobile application). This will also make it handle fractions (like 1/2) correctly. Aaron Meurer > > Thanks in advance for your views. > > Regards, > Shyam > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/sympy?hl=en. > -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
