""" Something I would like to know more about is what adding a new feature would look like on the technical side. """ Adding a new feature like a new card could be done entirely in python. The Pyodide coderunner handles the input expression provided by javascript and returns the cards in the form of a JS Map (equivalent to a Python dict). The javascipt loops over all the items in the Map, and evaluates any card if needed. Currently, it is hard-coded in Javascript which cards have to be evaluated. We can update the python logic to include a Boolean value in the dict whether the card needs any evaluation. Eg: Currently, when JS recieves a card like this, >>> s.eval('x**2')[2] {'card': 'roots', 'var': 'x', 'title': 'Roots', 'input': 'solve(x**2 -1 , x)', 'pre_output': 'x', 'parameters': []} It then sends the following code to run in Python >>> s.eval_card('roots', 'x**2-x', 'x', {}) {'value': '[0, 1]', 'output': '<ul>\n<li><script type="math/tex; mode=display">0</script></li>\n<li><script type="math/tex; mode=display">1</script></li>\n</ul>'} Here, the required html is provided to the JS and it is inserted into the proper div for the card. The JS here follows the same routine for all cards. Hence, adding a new card should be possible to do entirely in python.
""" Particularly how the pyodide will work and any challenges there. """ Pyodide runs on a browser on a service worker, and their documentation have provided a basic API to run Python code in JS. In my source code, there is a "main" function which deals with the Pyodide API and returns the result. It can evaluate mathematical expressions in different flavours by changing the type parameter in the "main" function. like for running a pure python command, we can set type = "input" for generating cards using SymPyGamma object, we can set type = "eval" and for evaluating a card we can set type = "eval-card" [image: de.png] The major challenge about using Pyodide is transferring Python objects to Javascript. Pyodide usually converts the basic types very well, like Python dicts to JS Maps. I have not experimented much and have currently stuck with strings to share information between JS and Python. If some change to the UI is to be implemented, it will most probably have to be done in JS. Thankfully, Vue enables us to create components which can be reused. like the same component can be used for the search bar and the context menu (see https://github.com/sympy/sympy_gamma/issues/188 ) and the expression recieved from each can be executed differently using the type parameter in main function. In my opinion, we can certainly bring in new contributors for Gamma if we have some guides on how to navigate the code. Learning how to interface with Python codebase was much more work for me than to implement it using JS. Thats why, I have given Phase 2 of GSoC to majorly create documentation for new contributors. I will update my proposal with some tasks to make it easier to implement features using Python. Nevertheless, I totally understand if SymPy Gamma is discontinued in the future. I enjoyed working on this project. On Tuesday, April 19, 2022 at 8:22:16 AM UTC+5:30 Aman Sharma wrote: > Thank you Qijia for your reply. SymPy Beta is surely a great project . > SymPy Beta was a proof of concept to me, and motivated me to spend time > learning Web Development and Pyodide. > SymPy Gamma brings the power of SymPy to users without learning the > correct Python syntax or the SymPy API. I would like to see it grow and > getting used by students like me in the future utilising the capabilities > of complete SymPy library without a coding background. (I have been talking > about SymPy Gamma to my friends and they have already become daily users : ) > > If we go ahead and decide to continue SymPy Gamma, I completely agree with > Aaron here > """ > Something I would like to know more about is what adding a new feature > would look like on the technical side. How hard would it be for > someone not familiar with the code? Just how much of that will require > writing Javascript vs. writing something in Python? > """ > Adding a feature should be done majority in Python. I will elaborate on > this in a few hours. > > Aman > > > On Tuesday, April 19, 2022 at 6:58:27 AM UTC+5:30 Qijia Liu wrote: > >> Hi all, >> >> Thanks for mentioning SymPy Beta. >> If I understand correctly, SymPy Gamma's goal is to make SymPy >> end-user-friendly in a Wolfram|Alpha way, and some of the users (like Aman) >> may contribute back to SymPy. >> If I'm allowed to be as ambitious as I choose, SymPy Beta's goal is to be >> an open source alternative to Wolfram|Alpha, as close as possible. >> That is to say, although currently more than 90% of its kernel is powered >> by SymPy, in the future it may involve functionalities from other >> libraries, like NumPy and SciPy, or even outside Python ecosystem. At that >> time, it should be renamed, and maintained by a different group of people >> rather than only SymPy community. >> So, do you need a pure-SymPy web service, or equivalently continue SymPy >> Gamma? Likely. That's why Aman's GSoC makes sense. And I'd be glad to >> borrow code and ideas from it. >> SymPy will never be hurt by my forking. I'm not a selfish guy who only >> cares his own project. Instead I upstream every possible improvements. >> #23379, >> #23349, #23239 are examples. If you find any AGPLed code should belong >> to SymPy, please let me know. >> For SymPy Gamma, I do want its users to use SymPy Beta instead, because >> it is modern and (at least currently) better maintained, has more >> functionalities, bug fixes and less confusing behavior. And it doesn't add >> a cent to my bill :-) >> But as the license granted, you may fork SymPy Beta back at any time you >> want. >> Sorry for being off topic. If you have more questions or thoughts, please >> discuss at https://github.com/sympy/sympy_gamma/issues/186 or >> https://github.com/eagleoflqj/sympy_beta >> >> Best, >> Qijia >> > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/2c677500-c6f5-4a82-a68c-9f291035dabcn%40googlegroups.com.