Skip to content

Commit

Permalink
Finally ready for v.1.0.0 release. Docs updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
connorferster committed Sep 19, 2020
1 parent fc5f773 commit c811fa5
Show file tree
Hide file tree
Showing 33 changed files with 584 additions and 297 deletions.
File renamed without changes.
File renamed without changes
156 changes: 85 additions & 71 deletions README.md

Large diffs are not rendered by default.

Binary file added docs/images/Screenshot 2020-09-18 222151.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/basic_demo1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/comments.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/conditionals.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/decorator.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/decorator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/display_var.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/forallpeople.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/greek.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/greeks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/integration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/no_subs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/prime.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/quadratic_formula_basic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/quadratic_formula_long.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/quadratic_formula_params.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/quadratic_formula_precision.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/quadratic_formula_short.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/quadratic_formula_symbolic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/subscripts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/sympy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/tex.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion handcalcs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "0.8.1" #
__version__ = "1.0.0" #
from handcalcs.decorator import handcalc
from handcalcs.install_templates import install_html, install_latex
__all__ = ["handcalc"]
Expand Down
13 changes: 10 additions & 3 deletions handcalcs/decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@
import innerscope
from handcalcs.handcalcs import LatexRenderer

def handcalc(override: str = "", left: str = "", right: str = "", jupyter_display: bool = False):

def handcalc(
override: str = "", precision: int = 3, left: str = "", right: str = "", jupyter_display: bool = False
):
# @wraps(func)
def handcalc_decorator(func):
# use innerscope to get the values of locals within the function
scoped_func = innerscope.scoped_function(func)

def wrapper(*args, **kwargs):
line_args = {"override": "", "precision": 3}
line_args = {"override": override, "precision": precision}
func_source = inspect.getsource(func)
cell_source = _func_source_to_cell(func_source)
scope = scoped_func(*args, **kwargs)
Expand All @@ -23,12 +26,16 @@ def wrapper(*args, **kwargs):
try:
from IPython.display import Latex, display
except ModuleNotFoundError:
ModuleNotFoundError("jupyter_display option requires IPython.display to be installed.")
ModuleNotFoundError(
"jupyter_display option requires IPython.display to be installed."
)
display(Latex(latex_code))
return calculated_results
latex_code = latex_code.replace("\\[", "").replace("\\]", "")
return (left + latex_code + right, calculated_results)

return wrapper

return handcalc_decorator


Expand Down
Loading

0 comments on commit c811fa5

Please sign in to comment.