connorferster / handcalcs

Python library for converting Python calculations into rendered latex.
Apache License 2.0
5.68k stars 435 forks source link

Impossible to reproduce example from "Basic Usage 2", using ```@handcalcs()``` generates a function that doesn't output anything #189

Open ragdollfun opened 1 year ago

ragdollfun commented 1 year ago

I'm trying to reproduce the example from "Basic Usage 2: As a decorator on your functions, @handcalc()", but the variable vals is empty in my case.

Using @handcalc(jupyter_display=True) does render the LaTeX formulas correctly, but the value of vals is None.

scote89 commented 1 year ago

Same here, image

connorferster commented 1 year ago

@ragdollfun and @scote89

It goes like this: image

Thanks for pointing out that the return statement is missing from the example. On a previous version of handcalcs, the locals() dictionary was returned without having to use the return statement. That is no longer the case.

I have just updated the example.

gusto475 commented 11 months ago

Hi Connor. Simple question. It is possible to add comments to functions with decorators? Thanks.

DonCammne commented 8 months ago

Yes, by using """comments""'.