Permalink
Browse files

python 3 for os x

  • Loading branch information...
tcaduser committed Jun 25, 2018
1 parent 305bc85 commit 696d5204f42f595c6003e35d4a51b693d4f6982b
Showing with 515 additions and 60 deletions.
  1. +1 −0 .travis.yml
  2. +2 −0 CMakeLists.txt
  3. +1 −1 examples/arrhenius.py
  4. +1 −1 examples/deftest.py
  5. +1 −1 examples/modellist1.py
  6. +21 −21 examples/models1.py
  7. +1 −1 examples/ordered.py
  8. +3 −3 examples/parsetest.py
  9. +1 −1 examples/remove1.py
  10. +1 −1 examples/subexpression1.py
  11. +1 −1 examples/table.py
  12. +3 −3 examples/undefined1.py
  13. +2 −2 examples/utf8.py
  14. 0 goldenresults/unix/{arrhenius_py.out → arrhenius_py2.out}
  15. +33 −0 goldenresults/unix/arrhenius_py3.out
  16. 0 goldenresults/unix/{deftest_py.out → deftest_py2.out}
  17. +35 −0 goldenresults/unix/deftest_py3.out
  18. 0 goldenresults/unix/{modellist1_py.out → modellist1_py2.out}
  19. +2 −0 goldenresults/unix/modellist1_py3.out
  20. 0 goldenresults/unix/{models1_py.out → models1_py2.out}
  21. +26 −0 goldenresults/unix/models1_py3.out
  22. 0 goldenresults/unix/{ordered_py.out → ordered_py2.out}
  23. +2 −0 goldenresults/unix/ordered_py3.out
  24. 0 goldenresults/unix/{parsetest_py.out → parsetest_py2.out}
  25. +237 −0 goldenresults/unix/parsetest_py3.out
  26. 0 goldenresults/unix/{remove1_py.out → remove1_py2.out}
  27. +1 −0 goldenresults/unix/remove1_py3.out
  28. 0 goldenresults/unix/{subexpression1_py.out → subexpression1_py2.out}
  29. +3 −0 goldenresults/unix/subexpression1_py3.out
  30. 0 goldenresults/unix/{table_py.out → table_py2.out}
  31. +7 −0 goldenresults/unix/table_py3.out
  32. 0 goldenresults/unix/{undefined1_py.out → undefined1_py2.out}
  33. +3 −0 goldenresults/unix/undefined1_py3.out
  34. 0 goldenresults/unix/{utf8_py.out → utf8_py2.out}
  35. +2 −0 goldenresults/unix/utf8_py3.out
  36. +9 −0 lib/symdiff/__init__.py
  37. +18 −0 scripts/setup_osx_anaconda.sh
  38. +1 −3 src/CMakeLists.txt
  39. +3 −0 src/engine/CMakeLists.txt
  40. +26 −12 src/pycomp/CMakeLists.txt
  41. +56 −3 src/pycomp/PythonSymdiffCommands.cc
  42. +5 −5 src/tclcomp/CMakeLists.txt
  43. +7 −1 testing/CMakeLists.txt
@@ -16,6 +16,7 @@ before_install:
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
(curl -O https://repo.continuum.io/miniconda/Miniconda2-latest-MacOSX-x86_64.sh &&
bash Miniconda2-latest-MacOSX-x86_64.sh -b -p $HOME/anaconda
${HOME}/anaconda/bin/conda create -y --name python3 python=3
);
fi

@@ -1,6 +1,8 @@
PROJECT (SYMDIFF)

OPTION(TCLMAIN "Build with TCL Interpreter" ON)
#Python 2 version is always build
OPTION(PYTHON3 "Build Python 3 Interpreter" OFF)

set (CMAKE_CXX_STANDARD 11)

@@ -20,5 +20,5 @@
mylist = ordered_list('omega_dot_H', 'omega_dot_H__T', 'omega_dot_H__H', 'omega_dot_H__HCN', 'omega_dot_H__AR', 'omega_dot_H__CN')
for i in mylist:
mv = symdiff("model_value(%s);" % i)
print "%s, %s" % (i, mv)
print("%s, %s" % (i, mv))

@@ -45,4 +45,4 @@
]

for i in commands:
print symdiff(i)
print(symdiff(i))
@@ -6,4 +6,4 @@
symdiff('declare_model(y)')
l = model_list();
for i in l:
print('%s' % i)
print(('%s' % i))
@@ -2,40 +2,40 @@
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/

print symdiff('declare_model(x)')
print symdiff('define_model(y, a*x)')
print symdiff('diff(y, x)')
print symdiff('clear_model(x)')
print ordered_list('y')
print symdiff('declare_model(x)')
print ordered_list('y')
print symdiff('define_model(x,y)')
print(symdiff('declare_model(x)'))
print(symdiff('define_model(y, a*x)'))
print(symdiff('diff(y, x)'))
print(symdiff('clear_model(x)'))
print(ordered_list('y'))
print(symdiff('declare_model(x)'))
print(ordered_list('y'))
print(symdiff('define_model(x,y)'))
# catch cycles
try:
print ordered_list('y')
print(ordered_list('y'))
except SymdiffError as x:
print x
print(x)

for i in model_list():
print i + ' ' + symdiff('model_value(%s)' % i)
print(i + ' ' + symdiff('model_value(%s)' % i))
symdiff('clear_model(%s)' % i)

print
print symdiff('declare_model(x)')
print symdiff('define_model(y,x^2)')
print symdiff('diff(y,x)')
print symdiff('clear_model(y)')
print symdiff('model_value(y__x)')
print symdiff('diff(model_value(y__x),z)')
print("")
print(symdiff('declare_model(x)'))
print(symdiff('define_model(y,x^2)'))
print(symdiff('diff(y,x)'))
print(symdiff('clear_model(y)'))
print(symdiff('model_value(y__x)'))
print(symdiff('diff(model_value(y__x),z)'))

for i in model_list():
print i + ' ' + symdiff('model_value(%s)' % i)
print(i + ' ' + symdiff('model_value(%s)' % i))

print
print("")
symdiff('clear_model(x)')
symdiff('clear_model(x__z)')

for i in model_list():
print i + ' ' + symdiff('model_value(%s)' % i)
print(i + ' ' + symdiff('model_value(%s)' % i))
symdiff('clear_model(%s)' % i)

@@ -6,4 +6,4 @@
symdiff('define_model(d, b * c)')
mylist = ordered_list('d');
for i in mylist:
print('%s' % i)
print(('%s' % i))
@@ -3,13 +3,13 @@
# http://creativecommons.org/publicdomain/zero/1.0/

def maptest(arg):
print
print arg;
print("")
print(arg);
try:
out = symdiff(arg)
except SymdiffError as x:
out = x
print out
print(out)

maptest("a*x")
maptest("simplify(a*a)")
@@ -5,4 +5,4 @@
symdiff('define_model(x, 0)')
symdiff('define_model(y, x + z)')
remove_zeros()
print('%s' % symdiff('model_value(y)'))
print(('%s' % symdiff('model_value(y)')))
@@ -7,4 +7,4 @@
subexpression()
l = model_list()
for i in l:
print("%s, %s" % (i, symdiff('model_value(%s)' % i)))
print(("%s, %s" % (i, symdiff('model_value(%s)' % i))))
@@ -4,4 +4,4 @@

symdiff('declare_model(x)')
for i, v in enumerate(symdiff_table('a*x + b*c')):
print '%s %s' % (i, v)
print('%s %s' % (i, v))
@@ -5,6 +5,6 @@
symdiff('declare_model(y)')
symdiff('define_model(x, 3 * y + z)')
symdiff('diff(x, z)')
print('%s' % symdiff('model_value(x)'))
print('%s' % symdiff('model_value(x__z)'))
print('%s' % symdiff('model_value(y__z)'))
print(('%s' % symdiff('model_value(x)')))
print(('%s' % symdiff('model_value(x__z)')))
print(('%s' % symdiff('model_value(y__z)')))
@@ -4,7 +4,7 @@
# http://creativecommons.org/publicdomain/zero/1.0/

alpha = 'α'
print alpha
print(alpha)
x = symdiff('%s' % alpha);
x = symdiff('diff(%s^2, %s)' % (alpha, alpha));
print x
print(x)
@@ -0,0 +1,33 @@
unique3, pow(T,(-1))
unique12, (Ea * unique3)
unique11, exp((-unique12))
arrhenius, (Cf * pow(T,Etar) * unique11)
fprod, UNDEFINED
unique4, pow(A2,(-1))
unique2, (-unique3 + unique4)
unique5, pow(R,(-1))
unique1, (A1 * unique2 * unique5)
unique0, exp(unique1)
KC1, (A3 * R * T * unique0)
unique8, pow(KC1,(-1))
kb_model, (arrhenius * unique8)
rprod, (AR * CN * H)
unique10, (vr_H - vf_H)
omega_dot_H, ((-(kb_model * rprod) + (arrhenius * fprod)) * unique10)
arrhenius__T, ((Cf * Ea * pow(T,(-2 + Etar)) * unique11) + (Cf * Etar * pow(T,(-1 + Etar)) * unique11))
fprod__T, UNDEFINED
KC1__T, ((A1 * A3 * unique0 * unique3) + (A3 * R * unique0))
unique9, pow(KC1,(-2))
kb_model__T, (-(KC1__T * arrhenius * unique9) + (arrhenius__T * unique8))
omega_dot_H__T, ((-(kb_model__T * rprod) + (arrhenius * fprod__T) + (arrhenius__T * fprod)) * unique10)
fprod__H, UNDEFINED
rprod__H, (AR * CN)
omega_dot_H__H, ((-(kb_model * rprod__H) + (arrhenius * fprod__H)) * unique10)
fprod__HCN, UNDEFINED
omega_dot_H__HCN, (arrhenius * fprod__HCN * unique10)
fprod__AR, UNDEFINED
rprod__AR, (CN * H)
omega_dot_H__AR, ((-(kb_model * rprod__AR) + (arrhenius * fprod__AR)) * unique10)
fprod__CN, UNDEFINED
rprod__CN, (AR * H)
omega_dot_H__CN, ((-(kb_model * rprod__CN) + (arrhenius * fprod__CN)) * unique10)
@@ -0,0 +1,35 @@
f(x, y)
pow(y,2)
((2 * x * y) + (3 * pow(y,2)))
pow(x,2)
((2 * x * y) + (3 * pow(x,2)))
cos(x)
sin(x)
cos(x)
cos(x)
0
(2 * x * cos(pow(x,2)))
(2 * y * cos(pow(y,2)))
0
f(x, y)
pow(y,2)
((2 * x * y) + (3 * pow(y,2)))
pow(x,2)
((2 * x * y) + (3 * pow(x,2)))
0
g(x, y, z)
f(x, y, z)
(0 + 0 + g(y, z, x))
(0 + 0 + 0)
(0 + 0 + g(b, c, a))
(0 + 0 + 1)
(0 + 0 + 0)
0
(a + b)
((a + b) * (a + b))
((2 * a * b) + pow(a,2) + pow(b,2))
((2 * a * b) + pow(a,2) + pow(b,2))
(1 + (2 * a * b) + pow(a,2) + pow(b,2))
(1 - (1 + (2 * a * b) + pow(a,2) + pow(b,2)) + (2 * a * b) + pow(a,2) + pow(b,2))
(1 - (1 + (2 * a * b) + pow(a,2) + pow(b,2)) + (2 * a * b) + pow(a,2) + pow(b,2))
0
@@ -0,0 +1,2 @@
x
y
@@ -0,0 +1,26 @@
x
y
y__x
0
('y',)
x
('x', 'y')
x
While calling symdiff interpreter
y is being processed in terms of itself

x y
y (a * x)
y__x a

x
y
y__x
0
(2 * x)
(2 * x__z)
x UNDEFINED
x__z UNDEFINED
y__x (2 * x)

y__x (2 * x)
@@ -0,0 +1,2 @@
b
d
Oops, something went wrong.

0 comments on commit 696d520

Please sign in to comment.