Add more python variable tests
This commit is contained in:
@ -4,6 +4,11 @@ from __future__ import print_function
|
||||
def square(val):
|
||||
return val*val
|
||||
|
||||
def bool_to_val(txt):
|
||||
if txt.upper() in ["TRUE", "YES"]:
|
||||
return 1.0
|
||||
return 0.0
|
||||
|
||||
def printnum():
|
||||
print("2.25")
|
||||
|
||||
@ -11,8 +16,7 @@ def printtxt():
|
||||
print("sometext")
|
||||
|
||||
def getidxvar(lmpptr):
|
||||
from lammps import lammps, LMP_VAR_EQUAL
|
||||
from lammps import lammps
|
||||
lmp = lammps(ptr=lmpptr)
|
||||
|
||||
val = lmp.extract_variable("idx",None,LMP_VAR_EQUAL)
|
||||
val = lmp.extract_variable("idx")
|
||||
print(val)
|
||||
|
||||
Reference in New Issue
Block a user