Releases: connorferster/handcalcs
v1.9.0
This is primarily a house-keeping release to prepare for handcalcs v2.0.
Changes
- Removes the nbconvert "no input" exporters from the package. These are now available as an optional install on handcalcs via
pip install "handcalcs[exporters]"
.- This capability is useful to handcalcs but is not required for handcalcs to function.
- Having
nbconvert
as a dependency add a LOT of unnecessary dependencies to handcalcs, which is intended to be a fairly light-weight package.
- Exporters are now maintained at https://github.com/connorferster/nb-hideinputs
v1.8.0
What's Changed
- Add var* versions of Greek letters by @Ricyteach in #196
- HandcalcsCallRecorder by @connorferster in #210
New Contributors
- @Ricyteach made their first contribution in #196
Full Changelog: v1.7.1...v.1.8.0
v1.7.1
What's Changed
- fix: custom symbols not numerically substituting by @connorferster in #207
Full Changelog: v.1.7.0...v1.7.1
v1.7.0
What's Changed
- Fix precision = 0 being ignored by
%%render
by @icaroscherma in #141 - handcalc decorator was not wrapping functions properly by @connorferster in #155
- Removed math env break by @connorferster in #159
- Features/custom symbols by @connorferster in #204
- Fixes/update for python312 by @connorferster in #197
New Contributors
- @icaroscherma made their first contribution in #141
Full Changelog: v1.6.0...v.1.7.0
v1.6.0
handcalcs v1.6.0
This is a major new release for handcalcs and introduces the global configuration feature. This allows users to have control over several options of how handcalcs works. The configuration options, with their default values, are as follow:
decimal_separator = "."
latex_block_start = "\\["
latex_block_end = "\\]"
math_environment_start = "aligned"
math_environment_end = "aligned"
line_break = "\\\\[10pt]"
use_scientific_notation = False
display_precision = 3
underscore_subscripts = True
greek_exclusions = []
param_columns = 3
preferred_string_formatter = "L"
Config API
import handcalcs.render
handcalcs.set_option("display_precision", 4)
handcalcs.set_option("param_columns", 5)
handcalcs.set_option("line_break", "\\\\[20pt]")
handcalcs.set_option("greek_exclusions", ["psi"]) # etc...
These changes now affect all cells rendered in the current session. If you want to permanently update the config.json
file with these changes (so handcalcs will always load up with these options), you can then call handcalcs.save_config()
and the changes will be saved.
The auto-complete in the handcalcs.set_option()
function demonstrates which options are available and what values they take.
Scientific notation
Previously, handcalcs had a sketchy "guess" at determining if a value should be rendered in scientific notation to make it more readable. This behaviour has now been removed and requires the user to explicitly set whether scientific notation should be used. This can be set as a global option with handcalcs.set_option('use_scientific_notation', True)
and it can also be toggled at the cell level with the new sci_not
cell override command. If the global configuration is set to True
, the toggle will turn scientific notation OFF in that cell. If the global configuration is set to False
, the toggle will turn scientific notation ON in that cell.
%%render sci_not 5
a = 32.902939
b = 0.0923
NBConvert Exporters
Previously, there was a problem with the "noinput" exporters that come bundled with handcalcs. The "noinput" exporters would turn off inputs for both the regular exporters and the handcalcs exporters. This has been fixed. If you use Jupyter with different kernels, the controlling kernel for the exporters seems to be the "base" environment (if you use conda) so be sure to install v1.6.0
into your base environment to have access to the udpated exporters (which have a slightly new name, e.g. "HTML_NoInput" instead of "HTML_noinput", etc._)
Bug Fixes
This release also fixes several bugs. Some of these are from the new global config feature but others were independent bugs.
Fixes:
- #125 (Double ## comments not working in 'long' setting)
- #121 (How to not use engineering notation)
- #114 (Commented line with comment at the end)
- #113 (Pint and siunitx)
- #111 (Broken output when using forallpeople)
- #101 #97 (Provide options for subscripts; optionally disable subscripting)
- #90 ("psi" renders as a greek character)
Coming soon
- More tests for these new features (I am in a bit of a rush right now; lots on my plate)
- Official documentation
v.1.5.2
Patches an error in the previous release where the pyproject.toml file was improperly configured and prevented a successful install.
handcalcs v1.5.0
This update is to include changes added via PR that were (regrettably) not previously published to PyPI.
Big "Thank you!" to @daradib and @omouraenko for these:
handcalcs v1.4.0
This release has been long awaited!
The biggest news: handcalcs has FINALLY been updated to run on nbconvert v.6.0.0 and Jupyter Lab v3.0. Thanks to the contributions of @JimZwartveld, there are new exporters available from the Jupyter File -> Export as... menu to export HTML, Latex, and PDF with input cells hidden.
Additionally, there is the ability to add text now in-between lines of math by using a ##
(double pound sign) comment as per a request by @TheEngineer on #82. To summarize:
# comment
on a new line will remain a Python comment and will not be rendered## comment
on a new line will now display text in Latex# comment
at the end of a calculation will render the comment in Latex in parentheses as usual
Next item on the handcalcs list, a proper documentation site on ReadtheDocs...
Numeric lines + bug fixes
Handcalcs v1.2.0
- Feature:
NumericCalcLine
: this is a new line type within handcalcs that recognizes when a calculation does not contain any variables, just numbers, and bypasses the substitution step since the "symbolic" step is just the numbers of the calculation. In other words, it avoids having a redundant substitution when you are not using variables. - Bug fix: Decorator would not recognized doc strings properly when they were coded onto a single line. This lead handcalcs to treat the entire function source as being within the doc string and nothing would be rendered. Thank you @michaellisitsa for your contribution and fixing this bug.
- Bug fix: Nested
log
and other functions, under certain circumstances, would render incorrectly because the nested functions were not recognized.
handcalcs bug fixes
Thank you to @michaellisitsa who for posting issues for handcalcs recently. This release fixes the following:
- Additional spaces around commas when used as decimal separators has now been removed
- A bug involving white space underneath
%%render params
causing the alignment to be affected has been fixed (#52) - Inconsistencies with some parentheses around deeply nested calculations that start with function names have been fixed (#49)
- Parentheses fully enclosing a calculation was not creating a "parameter line" (no substitution); this is now fixed (#51)
- A bug involving complex numbers being inappropriately rendered in scientific notation
Additionally, if anyone is using handcalcs in school or in their daily life, I have created issue #50 as a place people can showcase their rendered notebooks. I love seeing handcalcs being used so if you have something you would like to show off, please submit!