Skip to content

Releases: connorferster/handcalcs

v1.9.0

27 Jun 22:07
Compare
Choose a tag to compare

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

16 Jun 05:59
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.7.1...v.1.8.0

v1.7.1

12 Jun 06:26
Compare
Choose a tag to compare

What's Changed

Full Changelog: v.1.7.0...v1.7.1

v1.7.0

10 Jun 20:41
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.6.0...v.1.7.0

v1.6.0

04 Jul 04:47
ae132f6
Compare
Choose a tag to compare

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

image

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

02 Jun 05:23
Compare
Choose a tag to compare

Patches an error in the previous release where the pyproject.toml file was improperly configured and prevented a successful install.

handcalcs v1.5.0

21 May 15:23
Compare
Choose a tag to compare

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:

  • #103 - Fix: Round non-iterable objects with len method
  • #105 - Fix: Copy exporter attribute instead of modifying parent class
  • #108 - Fix: Round sympy expressions and nested elements
  • #119 - Fix: Rendering issues in VS Code

handcalcs v1.4.0

04 Jun 05:22
Compare
Choose a tag to compare

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

06 Dec 06:28
Compare
Choose a tag to compare

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

14 Oct 05:41
Compare
Choose a tag to compare

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!