pydy / pydy-tutorial-human-standing

PyDy tutorial materials for MASB 2014, PYCON 2014, and SciPy 2014/2015.
http://pydy.org
159 stars 70 forks source link

Fix all bugs in SymPy printing so notebooks render nicely. #23

Closed moorepants closed 10 years ago

gilbertgede commented 10 years ago

Do you have a list of SymPy issues that correspond to this?

moorepants commented 10 years ago

right now it is basically this:

https://github.com/sympy/sympy/issues/2769

This PR helps:

https://github.com/sympy/sympy/pull/2772

This may be related:

https://github.com/sympy/sympy/pull/2752

And I think this is fixed, but maybe not closed. Not sure, I forget:

https://github.com/sympy/sympy/issues/2727

astrojuanlu commented 10 years ago

PR sympy/sympy#2752 is merged already, so maybe we can give it a try again against current master.

moorepants commented 10 years ago

I think that dynamicsymbols('omega1') rendered correctly when printed alone before #2752, and now it doesn't.

moorepants commented 10 years ago

I think I've got it fixed now:

https://github.com/sympy/sympy/pull/2772

If that passes and gets merged, we can close this. I believe everything renders correctly now.

Icing on the cake would to have a flag in init_printing to specify the mechanic's printing.

gilbertgede commented 10 years ago

Great. Do you have a handle on how much effort would be involved in setting up a flag for mechanics?

moorepants commented 10 years ago

Not sure. I haven't ever looked closely at what the printing overrides do in mechanics.

moorepants commented 10 years ago

You may just need some if statements in the init_printing code to use mprint instead of whatever is normally used.

moorepants commented 10 years ago

init_printing basically calls latex() which calls the LatexPrinter. You could probably have a flag and then use mlatex instead. I'll try it.

moorepants commented 10 years ago

I got it working. Pretty simple. I'll push a PR.

moorepants commented 10 years ago

Here is the branch that has the flag for mechanics printing:

https://github.com/sympy/sympy/pull/2833

It needs some work and probably some tests. We need to make the pretty printer work too.

Results: http://nbviewer.ipython.org/urls/raw2.github.com/PythonDynamics/pydy-tutorial-pycon-2014/f8ace3d1ef2ae61d518ece0f51e32fc32874e980/notebooks/base.ipynb?create=1

moorepants commented 10 years ago

Windows rendering in the notebook seems to be working, see https://github.com/sympy/sympy/issues/2848

moorepants commented 10 years ago

I've got this 98% taken care of in these two PRs:

https://github.com/sympy/sympy/pull/2772

https://github.com/sympy/sympy/pull/2894

Can I get some review help on them, so we can get them merged ASAP?

@gilbertgede @Juanlu001 @srjoglekar246

moorepants commented 10 years ago

Down to this one: https://github.com/sympy/sympy/pull/2894

@pydy Any help fixing these test failure is appreciated.

moorepants commented 10 years ago

Last one is ine: https://github.com/sympy/sympy/pull/2894