diff --git a/geos-posp/src/PVplugins/PVAttributeMapping.py b/geos-posp/src/PVplugins/PVAttributeMapping.py index d8234423a..f1901de1d 100644 --- a/geos-posp/src/PVplugins/PVAttributeMapping.py +++ b/geos-posp/src/PVplugins/PVAttributeMapping.py @@ -12,6 +12,8 @@ if parent_dir_path not in sys.path: sys.path.append(parent_dir_path) +import PVplugins #required to update sys path + from paraview.util.vtkAlgorithm import ( # type: ignore[import-not-found] VTKPythonAlgorithmBase, smdomain, diff --git a/geos-posp/src/PVplugins/PVCreateConstantAttributePerRegion.py b/geos-posp/src/PVplugins/PVCreateConstantAttributePerRegion.py index bb8fbbdf0..ff8f55202 100644 --- a/geos-posp/src/PVplugins/PVCreateConstantAttributePerRegion.py +++ b/geos-posp/src/PVplugins/PVCreateConstantAttributePerRegion.py @@ -15,6 +15,8 @@ if parent_dir_path not in sys.path: sys.path.append(parent_dir_path) +import PVplugins #required to update sys path + import vtkmodules.util.numpy_support as vnp from paraview.util.vtkAlgorithm import ( # type: ignore[import-not-found] VTKPythonAlgorithmBase, diff --git a/geos-posp/src/PVplugins/PVExtractMergeBlocksVolume.py b/geos-posp/src/PVplugins/PVExtractMergeBlocksVolume.py index 5423bbe90..8b5ac5421 100644 --- a/geos-posp/src/PVplugins/PVExtractMergeBlocksVolume.py +++ b/geos-posp/src/PVplugins/PVExtractMergeBlocksVolume.py @@ -16,6 +16,8 @@ if parent_dir_path not in sys.path: sys.path.append(parent_dir_path) +import PVplugins #required to update sys path + from paraview.util.vtkAlgorithm import ( # type: ignore[import-not-found] VTKPythonAlgorithmBase, smdomain, diff --git a/geos-posp/src/PVplugins/PVExtractMergeBlocksVolumeSurface.py b/geos-posp/src/PVplugins/PVExtractMergeBlocksVolumeSurface.py index 62d35ea48..77f9d0052 100644 --- a/geos-posp/src/PVplugins/PVExtractMergeBlocksVolumeSurface.py +++ b/geos-posp/src/PVplugins/PVExtractMergeBlocksVolumeSurface.py @@ -16,6 +16,8 @@ if parent_dir_path not in sys.path: sys.path.append(parent_dir_path) +import PVplugins #required to update sys path + from paraview.util.vtkAlgorithm import ( # type: ignore[import-not-found] VTKPythonAlgorithmBase, smdomain, diff --git a/geos-posp/src/PVplugins/PVExtractMergeBlocksVolumeSurfaceWell.py b/geos-posp/src/PVplugins/PVExtractMergeBlocksVolumeSurfaceWell.py index 4ab7010ab..20fce2f13 100644 --- a/geos-posp/src/PVplugins/PVExtractMergeBlocksVolumeSurfaceWell.py +++ b/geos-posp/src/PVplugins/PVExtractMergeBlocksVolumeSurfaceWell.py @@ -16,6 +16,8 @@ if parent_dir_path not in sys.path: sys.path.append(parent_dir_path) +import PVplugins #required to update sys path + from paraview.util.vtkAlgorithm import ( # type: ignore[import-not-found] VTKPythonAlgorithmBase, smdomain, diff --git a/geos-posp/src/PVplugins/PVExtractMergeBlocksVolumeWell.py b/geos-posp/src/PVplugins/PVExtractMergeBlocksVolumeWell.py index 2c1c5652c..cc6860f81 100644 --- a/geos-posp/src/PVplugins/PVExtractMergeBlocksVolumeWell.py +++ b/geos-posp/src/PVplugins/PVExtractMergeBlocksVolumeWell.py @@ -23,6 +23,8 @@ if parent_dir_path not in sys.path: sys.path.append(parent_dir_path) +import PVplugins #required to update sys path + from geos_posp.filters.GeosBlockExtractor import GeosBlockExtractor from geos_posp.filters.GeosBlockMerge import GeosBlockMerge from geos_posp.processing.vtkUtils import ( diff --git a/geos-posp/src/PVplugins/PVGeomechanicsAnalysis.py b/geos-posp/src/PVplugins/PVGeomechanicsAnalysis.py index 25b6f9d5c..c6e90add0 100644 --- a/geos-posp/src/PVplugins/PVGeomechanicsAnalysis.py +++ b/geos-posp/src/PVplugins/PVGeomechanicsAnalysis.py @@ -23,6 +23,8 @@ if parent_dir_path not in sys.path: sys.path.append(parent_dir_path) +import PVplugins #required to update sys path + from geos.utils.Logger import Logger, getLogger from geos.utils.PhysicalConstants import ( DEFAULT_FRICTION_ANGLE_DEG, diff --git a/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolume.py b/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolume.py index 92c0142a7..6cb49c94b 100644 --- a/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolume.py +++ b/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolume.py @@ -17,6 +17,8 @@ if parent_dir_path not in sys.path: sys.path.append(parent_dir_path) +import PVplugins #required to update sys path + from paraview.util.vtkAlgorithm import ( # type: ignore[import-not-found] VTKPythonAlgorithmBase, smdomain, diff --git a/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolumeSurface.py b/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolumeSurface.py index d498d7673..a5451efb5 100644 --- a/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolumeSurface.py +++ b/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolumeSurface.py @@ -17,6 +17,7 @@ if parent_dir_path not in sys.path: sys.path.append(parent_dir_path) +import PVplugins #required to update sys path from paraview.util.vtkAlgorithm import ( # type: ignore[import-not-found] VTKPythonAlgorithmBase, diff --git a/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolumeSurfaceWell.py b/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolumeSurfaceWell.py index bbfdd053c..a5f798b2f 100644 --- a/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolumeSurfaceWell.py +++ b/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolumeSurfaceWell.py @@ -17,6 +17,7 @@ if parent_dir_path not in sys.path: sys.path.append(parent_dir_path) +import PVplugins #required to update sys path from paraview.util.vtkAlgorithm import ( # type: ignore[import-not-found] VTKPythonAlgorithmBase, diff --git a/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolumeWell.py b/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolumeWell.py index f2c015411..29ac5e487 100644 --- a/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolumeWell.py +++ b/geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolumeWell.py @@ -17,6 +17,8 @@ if parent_dir_path not in sys.path: sys.path.append(parent_dir_path) +import PVplugins #required to update sys path + from paraview.util.vtkAlgorithm import ( # type: ignore[import-not-found] VTKPythonAlgorithmBase, smdomain, diff --git a/geos-posp/src/PVplugins/PVGeosLogReader.py b/geos-posp/src/PVplugins/PVGeosLogReader.py index a5dd35dd0..7a5b65d22 100644 --- a/geos-posp/src/PVplugins/PVGeosLogReader.py +++ b/geos-posp/src/PVplugins/PVGeosLogReader.py @@ -17,6 +17,8 @@ if parent_dir_path not in sys.path: sys.path.append(parent_dir_path) +import PVplugins #required to update sys path + import vtkmodules.util.numpy_support as vnp from paraview.util.vtkAlgorithm import ( # type: ignore[import-not-found] VTKPythonAlgorithmBase, diff --git a/geos-posp/src/PVplugins/PVMergeBlocksEnhanced.py b/geos-posp/src/PVplugins/PVMergeBlocksEnhanced.py index 4b8a7c869..7c7c155db 100644 --- a/geos-posp/src/PVplugins/PVMergeBlocksEnhanced.py +++ b/geos-posp/src/PVplugins/PVMergeBlocksEnhanced.py @@ -12,6 +12,8 @@ if parent_dir_path not in sys.path: sys.path.append(parent_dir_path) +import PVplugins #required to update sys path + from paraview.util.vtkAlgorithm import ( # type: ignore[import-not-found] VTKPythonAlgorithmBase, smdomain, diff --git a/geos-posp/src/PVplugins/PVMohrCirclePlot.py b/geos-posp/src/PVplugins/PVMohrCirclePlot.py index 583777c90..c464e9518 100644 --- a/geos-posp/src/PVplugins/PVMohrCirclePlot.py +++ b/geos-posp/src/PVplugins/PVMohrCirclePlot.py @@ -32,6 +32,8 @@ if parent_dir_path not in sys.path: sys.path.append(parent_dir_path) +import PVplugins #required to update sys path + import geos_posp.visu.mohrCircles.functionsMohrCircle as mcf import geos_posp.visu.PVUtils.paraviewTreatments as pvt from geos_posp.processing.MohrCircle import MohrCircle diff --git a/geos-posp/src/PVplugins/PVPythonViewConfigurator.py b/geos-posp/src/PVplugins/PVPythonViewConfigurator.py index 9d63e7077..e8c850cea 100644 --- a/geos-posp/src/PVplugins/PVPythonViewConfigurator.py +++ b/geos-posp/src/PVplugins/PVPythonViewConfigurator.py @@ -14,6 +14,8 @@ if parent_dir_path not in sys.path: sys.path.append(parent_dir_path) +import PVplugins #required to update sys path + from paraview.simple import ( # type: ignore[import-not-found] GetActiveSource, GetActiveView, diff --git a/geos-posp/src/PVplugins/PVSurfaceGeomechanics.py b/geos-posp/src/PVplugins/PVSurfaceGeomechanics.py index 2ff1b4f5f..cc91a2094 100644 --- a/geos-posp/src/PVplugins/PVSurfaceGeomechanics.py +++ b/geos-posp/src/PVplugins/PVSurfaceGeomechanics.py @@ -13,6 +13,8 @@ if parent_dir_path not in sys.path: sys.path.append(parent_dir_path) +import PVplugins #required to update sys path + from paraview.util.vtkAlgorithm import ( # type: ignore[import-not-found] VTKPythonAlgorithmBase, smdomain, diff --git a/geos-posp/src/PVplugins/PVTransferAttributesVolumeSurface.py b/geos-posp/src/PVplugins/PVTransferAttributesVolumeSurface.py index 2bc6e1ca1..26af9867c 100644 --- a/geos-posp/src/PVplugins/PVTransferAttributesVolumeSurface.py +++ b/geos-posp/src/PVplugins/PVTransferAttributesVolumeSurface.py @@ -12,6 +12,8 @@ if parent_dir_path not in sys.path: sys.path.append(parent_dir_path) +import PVplugins #required to update sys path + from paraview.simple import ( # type: ignore[import-not-found] FindSource, GetActiveSource, diff --git a/geos-posp/src/PVplugins/__init__.py b/geos-posp/src/PVplugins/__init__.py index e69de29bb..1fface1c7 100644 --- a/geos-posp/src/PVplugins/__init__.py +++ b/geos-posp/src/PVplugins/__init__.py @@ -0,0 +1,14 @@ +import os +import sys + + +# Add other packages path to sys path +dir_path = os.path.dirname(os.path.realpath(__file__)) +python_root = '../../..' + +python_modules = ( 'geos-posp', 'geos-utils', 'geos-geomechanics' ) + +for m in python_modules: + m_path = os.path.abspath( os.path.join( dir_path, python_root, m, 'src' ) ) + if m_path not in sys.path: + sys.path.insert( 0, m_path)