-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversion of Printing to Python 3 #38
Comments
So glad to see you again! How is everything going? GAlgebra is a great piece of work and we are honored to do something about keeping it on. And due to your time constraint and our enthusiasm in GA, we are happy to implement any features you want as long as you specify them and we're up to the task in the sense of Mathematical sophistication.
It's overloaded for enhanced printing (to my knowledge) and I verified the 4 ways of printing that you designed. First, printing plain texts. (I don't have an example at hand, will provide later) Secondly, if called
Thirdly,
Finally, if called |
I took dop.ipynb from your ipython example and changed the line in cell 3 from "f" to "print(f)" and saved the executed and checkpoint ipynb file in dop.zip. There were no errors generated and "print(f)" produced no output. I used jupyterlab and was running python 3 as indicated by jupyterlab. Do you have any ideas as to what is happening? |
In looking at your code in printer for redirect and restore in GAlatexprinter I did not see the builtin print function redefined to overload it. I also have worked on a python 3 version of galgebra. Shown below is the critical code in the GALatexPrinter class for overloading the print function. Any comments would be appreciated.
|
I consider this to be the expected behavior of your design. Calling I've just made a complete example for 4 ways to print in GAlgebra: https://nbviewer.jupyter.org/github/utensil/julia-playground/blob/master/py/printing-galgebra.ipynb and hopes it clarify the confusions. |
I modified both printer.py and dop.ipynb in your python 3 distribution both are in |
Oh, that's what you mean by overloading the print function. I'm currently out for vocation, but I'll evaluate and merge this ASAP. Sent with GitHawk |
Co-authored-by: Alan Bromborsky <[email protected]>
No rush. My objective was to make printing seem as much as possible like python 3 printing. Also, overloading the print function allows notebook printing to be the same as in normal (.py) python files. In addition you can use multiple print function calls in a single notebook cell and print multiple objects in a notebook output cell. |
This would be tracked in #39 . |
Thank you for picking up the torch with regard to galgebra. I just did not have enough time to work on it as required. I have a question about your conversion to python 3. I am trying to use your version and it looks like the python 3 print function is not overloaded. That is if A is a multivector or other object in galgebra the statement "print(A)" does not work. Is this correct?
The text was updated successfully, but these errors were encountered: