Skip to content

Releases: connorferster/handcalcs

Version 1.1.0 - Several new features (and some fixes)!

05 Oct 04:38
Compare
Choose a tag to compare

I am excited to release this version of handcalcs today especially...because it's my birthday :) I am excited because there are lots of new features that I think you will enjoy using and I am eager to tell you about them:

Features

  • Localization: Use the %decimal_separator line magic to change the decimal separator character from . to any character you like (except _), e.g. %decimal_separator , to change the decimal separator to ,. This will affect every cell in the notebook until it is changed. To change the decimal separator with the decorator interface, use @handcalc(dec_sep = ","). Thank you @BTWS2 for this suggestion.
  • Complex numbers: They now render in handcalcs.
  • Additional function rendering: ceil, floor, and log functions are now swapped out for their proper notation (instead of as generic functions). Thank you @jm4rc05 for this suggestion.
  • Auto scientific notation: When working with floats that are small enough to get "cut-off" by the decimal precision setting when they are rendered out, they will automatically be rendered as scientific notation to the decimal precision specified to prevent loss of significant figures. Thank you @jlopez1979 for this suggestion.
  • Render global namespace vars with decorator: Previously, if you called a global variable from within a function decorated with @handcalc(), it would not render because it was not defined in the function local namespace. Now, they render with no problem. Thank you @michaellisitsa for bringing the issue up and @eriknw for providing the fix with innerscope (so excellent).
  • Render sympy symbols: Previously you could only render out expressions and equations. Now you can render out just your sympy symbols by using %%render sympy symbolic. Thank you to @BTWS2 for pushing me on this.
  • Use other override tags with sympy override tag: The sympy tag is special and does not need to be mutually exclusive from the other overrides. Now you can use sympy symbolic, sympy long, etc.

Fixes

  • Doc string in decorated function: No longer causes errors. Thank you @KingSiz3 for reporting this error.
  • Conditional expressions with override tags: Works smoothly now. Thank you @michaellisitsa for reporting this error.

I am excited to present v1.1.0 of handcalcs. Enjoy!

Get the new release from the repo or on pypi: pip install handcalcs -U

Version 1.0.0! Many new changes!

19 Sep 06:46
Compare
Choose a tag to compare

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 as 1.275 only 1.275 will be displayed, not 1.275000, for example.
  • Sympy integration is now included. Sympy with handcalcs is intended to be used separately but together. For example, you want to solve a polynomial equation in Sympy and then want to substitute values. Solve the polynomial in Sympy first, then when you would normally use .subs(), instead use handcalcs 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!