Skip to content

Commit

Permalink
Various fixes for 0.9.3 release (#1290)
Browse files Browse the repository at this point in the history
* updates to visit session to ascent camera script

* dont force int for conn

* sess conv updates and tests

* upgrade from dep imp usage

* plural

* spelling
  • Loading branch information
cyrush authored May 11, 2024
1 parent 73258c5 commit 8f4d893
Show file tree
Hide file tree
Showing 9 changed files with 13,287 additions and 133 deletions.
3 changes: 0 additions & 3 deletions src/libs/ascent/runtimes/ascent_vtkh_data_adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2213,7 +2213,6 @@ VTKHDataAdapter::VTKmTopologyToBlueprint(conduit::Node &output,
std::string conduit_name = GetBlueprintCellName(shape_id);
output["topologies/"+topo_name+"/elements/shape"] = conduit_name;

static_assert(sizeof(vtkm::Id) == sizeof(int), "blueprint expects connectivity to be ints");
auto conn = cells.GetConnectivityArray(vtkm::TopologyElementTagCell(),
vtkm::TopologyElementTagPoint());

Expand All @@ -2239,8 +2238,6 @@ VTKHDataAdapter::VTKmTopologyToBlueprint(conduit::Node &output,
std::string conduit_name = GetBlueprintCellName(shape_id);
output["topologies/"+topo_name+"/elements/shape"] = conduit_name;

static_assert(sizeof(vtkm::Id) == sizeof(int), "blueprint expects connectivity to be ints");

auto conn = cells.GetConnectivityArray(vtkm::TopologyElementTagCell(),
vtkm::TopologyElementTagPoint());

Expand Down
4 changes: 2 additions & 2 deletions src/libs/flow/filters/flow_python_script_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ PyObject* execute_python(PyObject *py_input,
filter_setup_src_oss.str("");
filter_setup_src_oss << "def flow_setup_module(name):\n"
<< " import sys\n"
<< " import imp\n"
<< " import types\n"
<< " if name in sys.modules.keys():\n"
<< " return sys.modules[name]\n"
<< " mymod = imp.new_module(name)\n"
<< " mymod = types.ModuleType(name)\n"
<< " sys.modules[name] = mymod\n"
<< " return mymod\n"
<< "\n"
Expand Down
4 changes: 4 additions & 0 deletions src/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ add_subdirectory("ascent")
# add ascent performance tests
add_subdirectory("perf")

# add utils tests
add_subdirectory("utilities")


if(PYTHON_FOUND)
# if we have python:
# add custom command that generates a html img comparison report for our tests
Expand Down
19 changes: 19 additions & 0 deletions src/tests/utilities/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
###############################################################################
# Copyright (c) Lawrence Livermore National Security, LLC and other Ascent
# Project developers. See top-level LICENSE AND COPYRIGHT files for dates and
# other details. No copyright assignment is required to contribute to Ascent.
###############################################################################


####################################
# Add Util Tests
####################################

if(PYTHON_FOUND AND ENABLE_PYTHON)
message(STATUS "Adding ascent utility tests")
add_python_test(t_python_visit_session_converters)
else()
message(STATUS "Python disabled: Skipping ascent python utility tests")
endif()


56 changes: 56 additions & 0 deletions src/tests/utilities/t_python_visit_session_converters.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
###############################################################################
# Copyright (c) Lawrence Livermore National Security, LLC and other Ascent
# Project developers. See top-level LICENSE AND COPYRIGHT files for dates and
# other details. No copyright assignment is required to contribute to Ascent.
###############################################################################


"""
file: t_python_visit_session_converts.py
description: Driver to test python session converters
"""

import sys
import unittest
import os
import subprocess

from os.path import join as pjoin


def test_src_dir():
for path in sys.path:
if os.path.isfile(pjoin(path,"tin-visit-cam.session")):
return path

def utils_src_dir():
res = os.path.abspath(pjoin(test_src_dir(),"..","..","utilities"))
print(res)
return res

class Test_Session_Converters(unittest.TestCase):

def test_extract_camera(self):
test_script = pjoin(utils_src_dir(),"visit_session_converters","session_to_camera.py")
test_sess = pjoin(test_src_dir(),"tin-visit-cam.session")
print(test_script)
print(test_sess)
cmd = " ".join([sys.executable,test_script,test_sess])
print(cmd)
subprocess.check_call(cmd,shell=True)

def test_extract_opac(self):
test_script = pjoin(utils_src_dir(),"visit_session_converters","session_to_opacity.py")
test_sess = pjoin(test_src_dir(),"tin-visit-opac.session")
print(test_script)
print(test_sess)
cmd = " ".join([sys.executable,test_script,test_sess])
print(cmd)
subprocess.check_call(cmd,shell=True)


if __name__ == '__main__':
unittest.main()


Loading

0 comments on commit 8f4d893

Please sign in to comment.