This is the first major release of handcalcs
. Many new features have been added based feedback from users on Github and on /r/python. Thank you to everyone who has been using handcalcs
. An extra big Thank You for everyone who has contributed by comments, issues, and PRs to help make it better.
New Features
- Breaking change: No more "comment tags", they are now called "override tags" and work as line arguments with the
%%render
magic, e.g.%%render params
or%%render long
, etc. When using the decorator interface,override
is one of the arguments in the decorator, i.e.@handcalc(override = "params")
- Display decimal precision can now be altered at the cell level, similar to an override tag, e.g.
%%render 6
will display all floats up to six decimal places. This can work with an override tag, i.e.%%render long 8
. If a float has only three digits, such as1.275
only1.275
will be displayed, not1.275000
, for example. - Sympy integration is now included.
Sympy
withhandcalcs
is intended to be used separately but together. For example, you want to solve a polynomial equation inSympy
and then want to substitute values. Solve the polynomial inSympy
first, then when you would normally use.subs()
, instead usehandcalcs
to calculate and render. See the updated README.md on Github for a demonstration. - An entirely new parser means those extra brackets that were previously needed around fractions, e.g.
(b**2)/(sqrt(a + b))
are now unnecessary. Use brackets as you normally would, i.e.b**2/sqrt(a+b
. - Complex numbers are now supported (due to new parser)
- Scientific notation is now supported (due to new parser)
- Comparison operators in expressions now render properly
- Extraneous parentheses that would show up in fractions in certain contexts no longer happen.
- Function calls now only use parentheses when there is an expression or more than one argument being passed to the function
- Variable names that are longer than one character (not including subscripts) are now rendered as upright and not italic
- And more!
Feel free to raise additional issues for features you do not see yet (there are two not fully implemented yet: ceil
and floor
symbols and automatically switching to scientific notation for small physics constants (however you can now change the decimal precision as a short term fix)).
Thank you for all of the support everyone!