Commit 24a9c4f8 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit Committed by Kitware Robot
Browse files

Merge topic 'catalyst-duplicate-pipelines'

9ab27719

 Support importing same script as different pipelines.
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Cory Quammen's avatarCory Quammen <cory.quammen@kitware.com>
Merge-request: !5157
parents e6aef39f 9ab27719
Pipeline #245055 failed with stages
in 196 minutes and 5 seconds
......@@ -94,6 +94,18 @@ if (NOT PARAVIEW_SERIAL_TESTS_USE_MPIEXEC)
PREFIX "Catalyst::WaveletMiniApp"
ARGS "$<TARGET_FILE:ParaView::pvbatch>" --dr --sym -- -m paraview.demos.wavelet_miniapp -t 20 --size 21 -s
TEST_SCRIPTS ${simple_scripts})
# Add test to test for adding the same pipeline script twice.
paraview_add_test(
PREFIX "Catalyst::WaveletMiniApp"
ARGS "$<TARGET_FILE:ParaView::pvbatch>" --dr --sym -- -m paraview.demos.wavelet_miniapp -t 2 --size 21
--script-version 2
-s "${CMAKE_CURRENT_SOURCE_DIR}/repeated_pipeline.py"
-s
TEST_SCRIPTS "repeated_pipeline.py" )
set_tests_properties("Catalyst::WaveletMiniApp.repeated_pipeline"
PROPERTIES
PASS_REGULAR_EXPRESSION "Importing 'repeated_pipeline' for 2-th time!")
endif()
paraview_add_test_mpi(
......@@ -101,6 +113,18 @@ paraview_add_test_mpi(
ARGS "$<TARGET_FILE:ParaView::pvbatch>" --dr --sym -- -m paraview.demos.wavelet_miniapp -t 20 --size 21 -s
TEST_SCRIPTS ${simple_scripts})
# Add test to test for adding the same pipeline script twice.
paraview_add_test_mpi(
PREFIX "Catalyst::MPI::WaveletMiniApp"
ARGS "$<TARGET_FILE:ParaView::pvbatch>" --dr --sym -- -m paraview.demos.wavelet_miniapp -t 2 --size 21
--script-version 2
-s "${CMAKE_CURRENT_SOURCE_DIR}/repeated_pipeline.py"
-s
TEST_SCRIPTS "repeated_pipeline.py" )
set_tests_properties("Catalyst::WaveletMiniApp.repeated_pipeline"
PROPERTIES
PASS_REGULAR_EXPRESSION "Importing 'repeated_pipeline' for 2-th time!")
foreach (tname IN LISTS scripts)
if (NOT PARAVIEW_SERIAL_TESTS_USE_MPIEXEC)
set_tests_properties("Catalyst::WaveletMiniApp.${tname}"
......
import paraview
from paraview import print_info
if hasattr(paraview, "repeated_pipeline_count"):
paraview.repeated_pipeline_count += 1
else:
setattr(paraview, "repeated_pipeline_count", 1)
# If you change the txt here, don't forget to update the CMakeLists.txt
# for `PASS_REGULAR_EXPRESSION`.
print_info("%s: Importing 'repeated_pipeline' for %d-th time!" % (__name__, paraview.repeated_pipeline_count))
......@@ -14,12 +14,14 @@ class MetaPathFinder(importlib.abc.MetaPathFinder):
if modulename is None:
modulename = os.path.splitext(os.path.basename(filename))[0]
if modulename in self._registered_files:
raise RuntimeError(\
"Duplicate module name detected! '%s' is already used" % module)
self._registered_files[modulename] = filename
return modulename
unique_modulename = modulename
uniqifier = 1
while unique_modulename in self._registered_files:
unique_modulename = "%s%d" % (modulename, uniqifier)
uniqifier += 1
self._registered_files[unique_modulename] = filename
return unique_modulename
def find_spec(self, fullname, path, target=None):
......
......@@ -22,7 +22,6 @@ def register_module(path):
# seamlessly.
importers.install_pathfinder()
modulename = None
if vtkPSystemTools.FileIsDirectory(path):
return RegisterPackageFromDir(path)
elif path.lower().endswith(".zip"):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment