diff --git a/Applications/Python/ogs/__init__.py b/Applications/Python/ogs/__init__.py index 2aca7ae9d52b39a60ed90f3d84e9e1b443e23789..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 --- a/Applications/Python/ogs/__init__.py +++ b/Applications/Python/ogs/__init__.py @@ -1,80 +0,0 @@ -import os -import platform -import subprocess -import sys - -binaries_list = [ - "addDataToRaster", - "AddElementQuality", - "AddFaultToVoxelGrid", - "AddLayer", - "appendLinesAlongPolyline", - "AssignRasterDataToMesh", - "checkMesh", - "ComputeNodeAreasFromSurfaceMesh", - "computeSurfaceNodeIDsInPolygonalRegion", - "constructMeshesFromGeometry", - "convertGEO", - "convertToLinearMesh", - "convertVtkDataArrayToVtkDataArray", - "CreateBoundaryConditionsAlongPolylines", - "createIntermediateRasters", - "createLayeredMeshFromRasters", - "createMeshElemPropertiesFromASCRaster", - "createNeumannBc", - "createQuadraticMesh", - "createRaster", - "editMaterialID", - "ExtractBoundary", - "ExtractMaterials", - "ExtractSurface", - "generateGeometry", - "generateMatPropsFromMatID", - "generateStructuredMesh", - "geometryToGmshGeo", - "GMSH2OGS", - "GocadSGridReader", - "GocadTSurfaceReader", - "identifySubdomains", - "IntegrateBoreholesIntoMesh", - "Layers2Grid", - "MapGeometryToMeshSurface", - "Mesh2Raster", - "MoveGeometry", - "MoveMesh", - "moveMeshNodes", - "mpmetis", - "NodeReordering", - "ogs", - "OGS2VTK", - "partmesh", - "PVD2XDMF", - "queryMesh", - "Raster2Mesh", - "RemoveGhostData", - "removeMeshElements", - "ResetPropertiesInPolygonalRegion", - "reviseMesh", - "scaleProperty", - "swapNodeCoordinateAxes", - "TecPlotTools", - "tetgen", - "TIN2VTK", - "VTK2OGS", - "VTK2TIN", - "vtkdiff", - "Vtu2Grid", -] - -if "PEP517_BUILD_BACKEND" not in os.environ: - if platform.system() == "Windows": - os.add_dll_directory(os.path.join(os.path.dirname(__file__), "bin")) - - OGS_BIN_DIR = os.path.join(os.path.join(os.path.dirname(__file__), "bin")) - - def _program(name, args): - return subprocess.call([os.path.join(OGS_BIN_DIR, name)] + args) - - FUNC_TEMPLATE = """def {0}(): raise SystemExit(_program("{0}", sys.argv[1:]))""" - for f in binaries_list: - exec(FUNC_TEMPLATE.format(f)) diff --git a/Applications/Python/ogs/_internal/__init__.py b/Applications/Python/ogs/_internal/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Applications/Python/ogs/_internal/provide_ogs_cli_tools_via_wheel.py b/Applications/Python/ogs/_internal/provide_ogs_cli_tools_via_wheel.py new file mode 100644 index 0000000000000000000000000000000000000000..2aca7ae9d52b39a60ed90f3d84e9e1b443e23789 --- /dev/null +++ b/Applications/Python/ogs/_internal/provide_ogs_cli_tools_via_wheel.py @@ -0,0 +1,80 @@ +import os +import platform +import subprocess +import sys + +binaries_list = [ + "addDataToRaster", + "AddElementQuality", + "AddFaultToVoxelGrid", + "AddLayer", + "appendLinesAlongPolyline", + "AssignRasterDataToMesh", + "checkMesh", + "ComputeNodeAreasFromSurfaceMesh", + "computeSurfaceNodeIDsInPolygonalRegion", + "constructMeshesFromGeometry", + "convertGEO", + "convertToLinearMesh", + "convertVtkDataArrayToVtkDataArray", + "CreateBoundaryConditionsAlongPolylines", + "createIntermediateRasters", + "createLayeredMeshFromRasters", + "createMeshElemPropertiesFromASCRaster", + "createNeumannBc", + "createQuadraticMesh", + "createRaster", + "editMaterialID", + "ExtractBoundary", + "ExtractMaterials", + "ExtractSurface", + "generateGeometry", + "generateMatPropsFromMatID", + "generateStructuredMesh", + "geometryToGmshGeo", + "GMSH2OGS", + "GocadSGridReader", + "GocadTSurfaceReader", + "identifySubdomains", + "IntegrateBoreholesIntoMesh", + "Layers2Grid", + "MapGeometryToMeshSurface", + "Mesh2Raster", + "MoveGeometry", + "MoveMesh", + "moveMeshNodes", + "mpmetis", + "NodeReordering", + "ogs", + "OGS2VTK", + "partmesh", + "PVD2XDMF", + "queryMesh", + "Raster2Mesh", + "RemoveGhostData", + "removeMeshElements", + "ResetPropertiesInPolygonalRegion", + "reviseMesh", + "scaleProperty", + "swapNodeCoordinateAxes", + "TecPlotTools", + "tetgen", + "TIN2VTK", + "VTK2OGS", + "VTK2TIN", + "vtkdiff", + "Vtu2Grid", +] + +if "PEP517_BUILD_BACKEND" not in os.environ: + if platform.system() == "Windows": + os.add_dll_directory(os.path.join(os.path.dirname(__file__), "bin")) + + OGS_BIN_DIR = os.path.join(os.path.join(os.path.dirname(__file__), "bin")) + + def _program(name, args): + return subprocess.call([os.path.join(OGS_BIN_DIR, name)] + args) + + FUNC_TEMPLATE = """def {0}(): raise SystemExit(_program("{0}", sys.argv[1:]))""" + for f in binaries_list: + exec(FUNC_TEMPLATE.format(f))