visit-dav / visit

VisIt - Visualization and Data Analysis for Mesh-based Scientific Data
https://visit.llnl.gov
BSD 3-Clause "New" or "Revised" License
444 stars 117 forks source link

EvalCubicSpline cannot be imported from visit #19945

Closed SiqiLiOcean closed 1 month ago

SiqiLiOcean commented 1 month ago

Describe the bug

I use VisIt to create some animations of my model data. I wrote some python functions to make the work easier. I found that most of the visit CLI commands can be imported. For example: from visit import View3DAttributes

However, the interpolation functions are not. When I tried to imported 'EvalCubicSpline' or 'EvalLinear', the error shows that they are not in visit module.

Does anyone know how to solve it? Thanks.

markcmiller86 commented 1 month ago

Look like that function is in visit_utils...

[scratlantis:visit/34rc/build] miller86% ./bin/visit -cli -nowin
Running: cli -dv -nowin
Running: viewer -dv -nowin -noint -host 127.0.0.1 -port 5600
>>> help("cubic")
>>> 'EvalCubicSpline' in dir()
True
>>> help(EvalCubicSpline)

>>> dir(visit_utils)
['ConvertPy2to3', 'EvalCubic', 'EvalCubicSpline', 'EvalLinear', 'EvalQuadratic', 'Flatten', 'GetAutoPy2to3', 
'IsPySideViewerEnabled', 'PropertyTree', 'SetAutoPy2to3', 'Window', 'WindowManager', 'WriteScript', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'apropos', 'builtin', 
'common', 'convert2to3', 'encoding', 'engine', 'evalfuncs', 'exprs', 'flatten', 'help', 'host_profile', 'moab', 'property_tree',
 'python_help', 'python_query', 'qannote', 'qplot', 'query', 're', 'slurm', 'socket', 'status', 'sys', 'ult', 'visit', 'visit_help', 
'windows', 'writescript']
>>> from visit_utils import EvalCubicSpline as ECS