Skip to content

Add module path to sys path for PVplugins #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions geos-posp/src/PVplugins/PVAttributeMapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions geos-posp/src/PVplugins/PVCreateConstantAttributePerRegion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions geos-posp/src/PVplugins/PVExtractMergeBlocksVolume.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions geos-posp/src/PVplugins/PVExtractMergeBlocksVolumeSurface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions geos-posp/src/PVplugins/PVExtractMergeBlocksVolumeWell.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 2 additions & 0 deletions geos-posp/src/PVplugins/PVGeomechanicsAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolume.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions geos-posp/src/PVplugins/PVGeomechanicsWorkflowVolumeWell.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions geos-posp/src/PVplugins/PVGeosLogReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions geos-posp/src/PVplugins/PVMergeBlocksEnhanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions geos-posp/src/PVplugins/PVMohrCirclePlot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions geos-posp/src/PVplugins/PVPythonViewConfigurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions geos-posp/src/PVplugins/PVSurfaceGeomechanics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions geos-posp/src/PVplugins/PVTransferAttributesVolumeSurface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 14 additions & 0 deletions geos-posp/src/PVplugins/__init__.py
Original file line number Diff line number Diff line change
@@ -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)