SymPy in 10 minutes

241 views
Skip to first unread message

Nicolas Guarin

unread,
Jun 30, 2020, 5:11:14 PM6/30/20
to sympy
I adapted Maxima's tutorial "Maxima in 10 minutes" to SymPy for one of my courses. I would like to know if you consider useful to share it somewhere. This is an nbviewer link:

https://nbviewer.jupyter.org/github/nicoguaro/AdvancedMath/blob/master/notebooks/sympy/sympy_in_10_minutes.ipynb

Best,
Nicolás

Jonathan Gutow

unread,
Jun 30, 2020, 7:11:26 PM6/30/20
to sy...@googlegroups.com

I found this useful as a quick overview of some of the capabilities. I think this and similar demonstrations of capabilities should be added to the SymPy docs introduction in an "Further examples of uses and capabilities" section.

Some related comments:

  1. Add SageMath (https://sagemath.org) as one of the example CASes (note it includes SymPy as well as Maxima and lots of other stuff).
  2. I think this tutorial is mostly useful for mathematically more sophisticated viewers who also have some concept of programming and want a quick overview. I and many of my colleagues in chemistry have found that although our students are required to take mathematics through multivariable calculus our average student needs at least a couple of hours of tutorial work to even begin to make good use of tools such as SymPy or SageMath. I expect this is less of a problem as you move into physics, engineering and math.

Regards,

Jonathan

-- 
Dr. Jonathan Gutow
Chemistry Department
UW Oshkosh
web: https://uwosh.edu/facstaff/gutow
e-mail: gu...@uwosh.edu
Ph: 920-424-1326

Nicolas Guarin

unread,
Jun 30, 2020, 7:55:44 PM6/30/20
to sympy
 I should have mentioned that the course where I use this tutorial is Advanced Mathematics for Engineers. You mention two important points that could be added if the tutorial is useful for the community.

Best,
Nicolás

Oscar Benjamin

unread,
Jul 1, 2020, 5:23:02 AM7/1/20
to sympy
Hi Nicolás,

This looks nice. Maybe it should go in the example notebooks:
https://github.com/sympy/sympy/tree/master/examples/notebooks

I don't know if those are hosted on the website rather than just github.

Oscar
> --
> 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/6a311d80-b7f6-4f70-a601-091e7b3a3aa5o%40googlegroups.com.

Aaron Meurer

unread,
Jul 2, 2020, 3:14:29 PM7/2/20
to sympy
We also have https://github.com/sympy/sympy-notebooks, which has never
really been used, but it would be nice to set it up as an example repo
with notebooks, a binder link, and so on. Having it in a separate repo
also means we can have notebooks that have the outputs included
without having to worry about taking up a bunch of space in the main
repo.

Aaron Meurer
> To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAHVvXxT808Gp0yWFrmZwPgneETJC%2BSo57aAi1x2cc4SpEiR6-Q%40mail.gmail.com.

Aaron Meurer

unread,
Jul 2, 2020, 3:55:52 PM7/2/20
to sympy
There's also https://github.com/sympy/quantum_notebooks. Those should
perhaps be moved to the sympy-notebooks repo so that we have
everything in one place.

We might also consider moving the example notebooks in the sympy repo
over to sympy-notebooks. That would let us include the outputs as I
described, and to have them in a more standard place. We can also set
up CI on that repo so that the outputs are tested. I had thought that
the example notebooks were included with the release tarball, but
apparently they are not, so there is not a big issue with moving them,
I think.

If anyone wants to take on the work of improving the sympy-notebooks
repo or adding notebooks to it, please do so.

Aaron Meurer

Nicolas Guarin

unread,
Apr 6, 2021, 5:02:03 PM4/6/21
to sympy
> If anyone wants to take on the work of improving the sympy-notebooks
repo or adding notebooks to it, please do so.

I started this with the notebook that I mentioned before. I also created a CSS
style file.



Right now the updated version is in my fork, but I could make a PR and start adding the other
notebooks mentioned in the thread.

Nicolás

S.Y. Lee

unread,
Apr 8, 2021, 3:10:43 AM4/8/21
to sympy
I don't think that we can utilize sympy-notebooks repository properly unless we figure out how to test out the notebook outputs, integrate with sympy releases, matching version compatibility, and link with documentations.
Setting up this workflow is important, and once this workflow is set, I think that we should have a place to allow many people to collaborate tutorials.

Jason Moore

unread,
Apr 8, 2021, 3:20:52 AM4/8/21
to sympy
Using one of the jupyter<->sphinx tools is really nice for this. I've been moving the pydy examples to work with jupyter-sphinx and you get these results: https://pydy.readthedocs.io/en/latest/examples/carvallo-whipple.html (people can look at the rst source, download a notebook, or a py file and the notebook renders with the powers of jupyter).

Ideally we add some tooling to sympy's docs so that notebooks can be included.

Jason

Aaron Meurer

unread,
Apr 8, 2021, 4:27:41 AM4/8/21
to sympy
One of the benefits of having sympy-notebooks as a separate repository
is that we don't necessarily need to worry about those things. I would
be in favor of just merging things into sympy-notebooks as long as
they look OK. We don't need to apply the same standards as the main
repo, or at least that shouldn't block things being merged presently..

Aaron Meurer
> To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/514d6e1d-e270-4dff-979b-b1e6effc4296n%40googlegroups.com.

Jason Moore

unread,
Apr 8, 2021, 4:52:59 AM4/8/21
to sympy
Some CI to ensure the notebooks run is rather important, otherwise we'll end up with a bunch of broken notebooks over time.

That's what happened with the pydy/examples folder. Lots of stuff was dumped in there over the years, but no CI to double check it actually runs. Setting up at least CI in the sympy-notebooks repo would make it a relevant, sustained, and useful resource.

Jason

Nicolas Guarin

unread,
Apr 15, 2021, 1:27:42 PM4/15/21
to sympy
So, the main idea is to keep it in the main repo or migrate it to the notebooks' one?

I think that we the bare minimum is to test that the notebooks run without errors within CI.

Aaron Meurer

unread,
Apr 15, 2021, 2:07:19 PM4/15/21
to sympy
I think notebooks in general should be in a separate repo. This will
make it easier to include many notebooks, and to include them with
outputs included, without having to worry about them increasing the
size of the main repo.

Aaron Meurer
> To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/c497fc2b-9a7c-4569-8ed7-d3bc63807e20n%40googlegroups.com.

S.Y. Lee

unread,
May 5, 2021, 4:25:34 AM5/5/21
to sympy
I have attempted attempt to submit pull requests at sympy_notebooks repository at least to move stuff outside of sympy main repo,
but one of the concerns I have is whether the notebook files can store some personal information (Like the creation datetime, user account, some local PC folder structure),
or whether the notebooks made in Windows having CRLF is a problem for other operating systems.
I'm not sure if these problems are really a matter or not, but I would need more clear investigation for the structure of jupyter notebooks
such that we can normalize some of the sensitive or unnecessary data stored in the notebook.

Aaron Meurer

unread,
May 5, 2021, 4:53:19 AM5/5/21
to sympy
Jupyter notebooks are just JSON files so you can examine what metadata
is stored in them by opening them in your text editor. I'm guessing
neither of these things is a concern since a lot of people use
notebooks and I have never heard anyone complain about either issue.

Aaron Meurer
> To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/31118ed7-f234-4c3f-98ed-3efb52282ae0n%40googlegroups.com.

Nicolas Guarin

unread,
May 9, 2021, 2:29:50 PM5/9/21
to sympy
Dear all,

I have submitted a Pull Request with the notebook and some restructuring of the repo.

Regarding the discussion on keeping notebooks up to date what about using something similar to NumPy Tutorials (https://numpy.org/numpy-tutorials/content/tutorial-style-guide.html)? They suggest to pair notebooks with  MyST-NB.
Reply all
Reply to author
Forward
0 new messages