Contibuting to sympy without changing any code

46 views
Skip to first unread message

brombo

unread,
Mar 14, 2023, 12:29:30 PM3/14/23
to sympy
I have two packages I wish to contribute to sympy that are purely additions.  No existing sympy code is changed. The packages are -

glatex.py: This is used to print in standard output or in LaTeX from either standalone python code (.py) or from Jupyter Notebook (.ipynb).  In notebook it allows annotating output so that the statement `gprint(r'\omega =',something)` will output an annotated line in the notebook.  Also included in the package are commands for generation Asymptote graphics code (this is not a Asymptote wrapper, you have to input Asymptote code as strings in your python code) and displaying it in the notebook (see attached).

piecewise.py: A class that defines piecewise functions on a numerical grid and allows symbolic manipulation of these functions including convolution.  It can also generate the Asymptote code of the piecewise functions for plotting purposes (see attached).

Attached is test_pwf.html which is the output of a Jupyter notebook that demonstrates both packages.  test_pwf.py is a python script that accomplishes the same task.

If these are of interest let my know of the easiest way to contribute them and provide documentation.
test_pwf.py
test_pwf.html

Aaron Meurer

unread,
Mar 15, 2023, 6:33:48 PM3/15/23
to sy...@googlegroups.com
These both sound like they could potentially be useful. I will say
that it's a lot easier to integrate something into SymPy if it
modifies what is existing than if it is something new. In this case, a
lot of what is here relates to things already in SymPy so my question
is how they can be integrated into those things.

I'm a little unclear what the full functionalities of gprint() are
without seeing the source code.

The piecewise function seems like a specialization of the more general
Piecewise. I wonder if one could just use Piecewise directly but with
some wrapper code to make it easier to handle the fact that it's known
to be piecewise on intervals. Convolution is something that could be
implemented in general in SymPy.

Have you implemented asymptote printers for general SymPy objects or
just the piecewise object?

Aaron Meurer
> --
> 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+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/88a17947-6794-4a66-a34d-7f668887b67an%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages