I wrote a Quaternion class which provides basic quaternion operations (please see the attachment).
I have never made an open source contribution before so I am sorry if any of these questions are stupid.
Here are my queries :
1) What module of sympy should I put this file in?
2) Is my code good enough to be added to sympy? If not, what changes should I make?
3) printing issue :
In my code I used 2 classes for printing (CustomStrPrinter and CustomLatexPrinter) and set the default to CustomStrPrinter.
The issue is that if I set the default to CustomLatexPrinter it works fine for IPython shell commands but when I call the print function on expressions
it prints the latex form of the expression.
I want shell commands to use the CustomLatexPrinter (if latex is available) and print statements to use the CustomStrPrinter.
I guess I am confused about this whole printing thing.
In short, I want the printing to work in the way it works for sympy matrices (gives a fancy latex matrix in IPython shell commands but gives a normal string when print is used).
4) I made some functions in the code called diff, integrate, exp and ln and they can be called on a Quaternion object q as
q.integrate()
q.exp()
q.ln()
but I also want them to work when sympy.integrate(q), sympy.exp(q), sympy.ln(q) are used. How should I accomplish this?
Thanks for any help!
Nikhil