Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/calc refactor #840

Merged
merged 4 commits into from
Aug 30, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions common/lib/calc/calc/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""
Ideally, we wouldn't need to pull in all the calc symbols here,
but courses were using 'import calc', so we need this for
backwards compatibility
"""
from calc import *
26 changes: 13 additions & 13 deletions common/lib/calc/calc.py → common/lib/calc/calc/calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import numbers
import numpy
import scipy.constants
import calcfunctions
import functions

from pyparsing import (
Word, Literal, CaselessLiteral, ZeroOrMore, MatchFirst, Optional, Forward,
Expand All @@ -20,9 +20,9 @@
'sin': numpy.sin,
'cos': numpy.cos,
'tan': numpy.tan,
'sec': calcfunctions.sec,
'csc': calcfunctions.csc,
'cot': calcfunctions.cot,
'sec': functions.sec,
'csc': functions.csc,
'cot': functions.cot,
'sqrt': numpy.sqrt,
'log10': numpy.log10,
'log2': numpy.log2,
Expand All @@ -31,24 +31,24 @@
'arccos': numpy.arccos,
'arcsin': numpy.arcsin,
'arctan': numpy.arctan,
'arcsec': calcfunctions.arcsec,
'arccsc': calcfunctions.arccsc,
'arccot': calcfunctions.arccot,
'arcsec': functions.arcsec,
'arccsc': functions.arccsc,
'arccot': functions.arccot,
'abs': numpy.abs,
'fact': math.factorial,
'factorial': math.factorial,
'sinh': numpy.sinh,
'cosh': numpy.cosh,
'tanh': numpy.tanh,
'sech': calcfunctions.sech,
'csch': calcfunctions.csch,
'coth': calcfunctions.coth,
'sech': functions.sech,
'csch': functions.csch,
'coth': functions.coth,
'arcsinh': numpy.arcsinh,
'arccosh': numpy.arccosh,
'arctanh': numpy.arctanh,
'arcsech': calcfunctions.arcsech,
'arccsch': calcfunctions.arccsch,
'arccoth': calcfunctions.arccoth
'arcsech': functions.arcsech,
'arccsch': functions.arccsch,
'arccoth': functions.arccoth
}
DEFAULT_VARIABLES = {
'i': numpy.complex(0, 1),
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""

import unittest
import preview
from calc import preview
import pyparsing


Expand Down
4 changes: 2 additions & 2 deletions common/lib/calc/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

setup(
name="calc",
version="0.1.1",
py_modules=["calc"],
version="0.2",
packages=["calc"],
install_requires=[
"pyparsing==1.5.6",
"numpy",
Expand Down
2 changes: 1 addition & 1 deletion common/lib/capa/capa/inputtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

from .registry import TagRegistry
from chem import chemcalc
from preview import latex_preview
from calc.preview import latex_preview
import xqueue_interface
from datetime import datetime

Expand Down