Skip to content

Commit fa13f3d

Browse files
committed
chore: bump version
- Add documentation to README.md for call recorder
1 parent d484e6d commit fa13f3d

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

README.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,23 @@ Returns a tuple consisting of `(latex_code: str, locals: dict)`, where `locals`
121121
* `override` is a str representing one of the acceptable override tags (see below)
122122
* `precision` is an int to alter the of decimal precision displayed
123123
* `left` and `right` are strings that can precede and follow the encoded Latex string, such as `\\[` and `\\]` or `$` and `$`
124-
* `jupyter_display`, when True, will return only the `locals` dictionary and instead will display the encoded Latex string rendering with `display(Latex(latex_code))` from `IPython.display`. Will return an error if not used within
124+
* `jupyter_display`, when True, will return only the `locals` dictionary and instead will display the encoded Latex string rendering with `display(Latex(latex_code))` from `IPython.display`. Will return an error if not used within
125+
* `record`, when True, will activate the `HandcalcsCallRecorder` to allow the function to "recall" previous outputs (see below) **New in v1.8.0**
125126

126127
In your decorated function, everything between `def my_calc(...)` and a return statement (if any) is now like the code in a Jupyter cell, except it's a standard Python function.
127128

128129
Used in this way, you can use `@handcalc()` to dynamically generate Latex code for display in Jupyter and non-Jupypter Python environments (e.g. streamlit).
129130

130131
![Parameters](docs/images/decorator.png)
131132

133+
### HandcalcsCallRecorder (New in v1.8.0)
134+
135+
The `HandcalcsCallRecorder` is a new kind of function wrapper that is available from the `@handcalc` decorator. To activate it, select `record=True` as one of the arguments in the decorator function.
136+
137+
The intended use case is during iterations. In engineering, it is common to compute a whole bunch of values in a table or DataFrame. The table itself contains the results of the computations but the table does not necessarily reveal the computation steps. The `HandcalcsCallRecorder` allows you to display the calculation for one of the calculation iterations that have been processed by your decorated function, as shown in the example below:
138+
139+
![HandcalcsCallRecorder](docs/images/call_recorder.gif)
140+
132141
---
133142

134143
## Global config options (New in v1.6.0)

docs/images/call_recorder.gif

16.1 MB
Loading

handcalcs/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"""
1515
Render arithmetic calucations in Jupyter as though they were written by hand.
1616
"""
17-
__version__ = "1.7.1" #
17+
__version__ = "1.8.0" #
1818
from .decorator import handcalc
1919
from .global_config import set_option, save_config
2020

0 commit comments

Comments
 (0)