calculix / CalculiX-Examples

CalculiX examples by Prof. Martin Kraska from Brandenburg University of Applied Sciences. Excellent starting point to master parametric modelling with CGX and CCX.
MIT License
299 stars 92 forks source link

issue with param.py and floor() function #55

Closed ljuillen closed 3 years ago

ljuillen commented 3 years ago

Hello my par.floortest.txt file is:

<a= 1.3 >

<floor(a)>

<b= floor(a)>

b =

and when I run : python param.py par.floortest.txt I got the following error message:

Using file: par.floortest.txt Source: par.floortest.txt Target: floortest.txt a= 1.3 (1.3) *** ERROR **** Line 2 in par.floortest.txt

<floor(a)>

'NoneType' object is not callable

it looks like if the floor function is not usable....

oldninja commented 3 years ago

I just tested the code you show. Here is my output:

CalculiX-Examples/Scripts$ python param.py par.floortest.txt
Using file: par.floortest.txt
Source: par.floortest.txt
Target: floortest.txt
a= 1.3   (1.3)
b= floor(a)  (1.0)

Which python version are you using?

ljuillen commented 3 years ago

Hello thanks for your message I use Python3 I bypassed the issue by adding lines like safe_dict['sqrt'] = sqrt safe_dict['floor'] = floor safe_dict['ceil'] = ceil but I don't know if it is a good solution...