mpastell / Pweave

Pweave is a scientific report generator and a literate programming tool for Python. It can capture the results and plots from data analysis and works well with numpy, scipy and matplotlib.
http://mpastell.com/pweave
Other
435 stars 64 forks source link

[feature request] formula derivation and calculation #143

Open retsyo opened 5 years ago

retsyo commented 5 years ago

Is there any way to let Pweave capture formula, then do derivation for simplification, then apply real number to the symbol and calculate the finally result?

I have written a (simpilfied case)[https://github.com/retsyo/expand_expression], but it is not a universal solution

husnoo commented 5 years ago

Are you thinking of something like sympy?

E.g. https://docs.sympy.org/latest/tutorial/simplification.html

I've found if I put print("some_string") inside a function in a code block and use <% func() %>, it turns out okay. If I just return the string, it shows up with quotes around it (which was causing MathTeX to throw a hissy).