Skip to content
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

mesh_doctor installation via pip #18

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@

import logging

from parsing import CheckHelper
from parsing.cli_parsing import parse_and_set_verbosity
import register

from mesh_doctor.parsing import CheckHelper
from mesh_doctor.parsing.cli_parsing import parse_and_set_verbosity
from mesh_doctor import register as register

def main():
logging.basicConfig( format='[%(asctime)s][%(levelname)s] %(message)s' )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def init_parser() -> argparse.ArgumentParser:
Increase verbosity (-{__VERBOSITY_FLAG}, -{__VERBOSITY_FLAG * 2}) to get full information.
"""
formatter = lambda prog: argparse.RawTextHelpFormatter( prog, max_help_position=8 )
parser = argparse.ArgumentParser( description='Inspects meshes for GEOSX.',
parser = argparse.ArgumentParser( description='Inspects meshes for GEOS.',
epilog=textwrap.dedent( epilog_msg ),
formatter_class=formatter )
# Nothing will be done with this verbosity/quiet input.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
List,
)

from checks.collocated_nodes import Options, Result
from ..checks.collocated_nodes import Options, Result

from . import COLLOCATES_NODES

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

from checks.element_volumes import Options, Result
from ..checks.element_volumes import Options, Result

from . import ELEMENT_VOLUMES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
VTK_WEDGE,
)

from checks.fix_elements_orderings import Options, Result
from ..checks.fix_elements_orderings import Options, Result

from . import vtk_output_parsing, FIX_ELEMENTS_ORDERINGS

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

from checks.generate_cube import Options, Result, FieldInfo
from ..checks.generate_cube import Options, Result, FieldInfo

from . import vtk_output_parsing, generate_global_ids_parsing, GENERATE_CUBE
from .generate_global_ids_parsing import GlobalIdsInfo
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

from checks.generate_fractures import Options, Result, FracturePolicy
from ..checks.generate_fractures import Options, Result, FracturePolicy

from . import vtk_output_parsing, GENERATE_FRACTURES

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from dataclasses import dataclass
import logging

from checks.generate_global_ids import Options, Result
from ..checks.generate_global_ids import Options, Result

from . import vtk_output_parsing, GENERATE_GLOBAL_IDS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
List,
)

from checks.non_conformal import Options, Result
from ..checks.non_conformal import Options, Result

from . import NON_CONFORMAL

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy

from checks.self_intersecting_elements import Options, Result
from ..checks.self_intersecting_elements import Options, Result

from . import SELF_INTERSECTING_ELEMENTS

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
import multiprocessing

from checks.supported_elements import Options, Result
from ..checks.supported_elements import Options, Result

from . import SUPPORTED_ELEMENTS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import logging
import textwrap

from checks.vtk_utils import VtkOutput
from ..checks.vtk_utils import VtkOutput

__OUTPUT_FILE = "output"
__OUTPUT_BINARY_MODE = "data-mode"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
import logging
from typing import Dict, Callable, Any, Tuple

import parsing
from parsing import CheckHelper, cli_parsing
import mesh_doctor.parsing as parsing
from .parsing import CheckHelper, cli_parsing

__HELPERS: Dict[ str, Callable[ [ None ], CheckHelper ] ] = dict()
__CHECKS: Dict[ str, Callable[ [ None ], Any ] ] = dict()


def __load_module_check( module_name: str, check_fct="check" ):
module = importlib.import_module( "checks." + module_name )
module = importlib.import_module( "mesh_doctor.checks." + module_name )
return getattr( module, check_fct )


def __load_module_check_helper( module_name: str, parsing_fct_suffix="_parsing" ):
module = importlib.import_module( "parsing." + module_name + parsing_fct_suffix )
module = importlib.import_module( "mesh_doctor.parsing." + module_name + parsing_fct_suffix )
return CheckHelper( fill_subparser=module.fill_subparser,
convert=module.convert,
display_results=module.display_results )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

import pytest

from checks.vtk_utils import (
from ..checks.vtk_utils import (
VtkOutput, )

from checks.generate_fractures import (
from ..checks.generate_fractures import (
FracturePolicy,
Options,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
vtkUnstructuredGrid,
)

from checks.collocated_nodes import Options, __check
from ..checks.collocated_nodes import Options, __check


def get_points() -> Iterator[ Tuple[ vtkPoints, int ] ]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
vtkUnstructuredGrid,
)

from checks.element_volumes import Options, __check
from ..checks.element_volumes import Options, __check


def test_simple_tet():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from checks.generate_cube import __build, Options, FieldInfo
from ..checks.generate_cube import __build, Options, FieldInfo


def test_generate_cube():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
from vtkmodules.util.numpy_support import (
numpy_to_vtk, )

from checks.vtk_utils import (
from ..checks.vtk_utils import (
to_vtk_id_list, )

from checks.check_fractures import format_collocated_nodes
from checks.generate_cube import build_rectilinear_blocks_mesh, XYZ
from checks.generate_fractures import __split_mesh_on_fracture, Options, FracturePolicy
from ..checks.check_fractures import format_collocated_nodes
from ..checks.generate_cube import build_rectilinear_blocks_mesh, XYZ
from ..checks.generate_fractures import __split_mesh_on_fracture, Options, FracturePolicy


@dataclass( frozen=True )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
vtkVertex,
)

from checks.generate_global_ids import __build_global_ids
from ..checks.generate_global_ids import __build_global_ids


def test_generate_global_ids():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy

from checks.non_conformal import Options, __check
from checks.generate_cube import (
from ..checks.non_conformal import Options, __check
from ..checks.generate_cube import (
build_rectilinear_blocks_mesh,
XYZ,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

import numpy

from checks.reorient_mesh import reorient_mesh
from checks.vtk_polyhedron import FaceStream
from checks.vtk_utils import (
from ..checks.reorient_mesh import reorient_mesh
from ..checks.vtk_polyhedron import FaceStream
from ..checks.vtk_utils import (
to_vtk_id_list,
vtk_iter,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
vtkUnstructuredGrid,
)

from checks.self_intersecting_elements import Options, __check
from ..checks.self_intersecting_elements import Options, __check


def test_jumbled_hex():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
vtkUnstructuredGrid,
)

from checks.supported_elements import Options, check, __check
from checks.vtk_polyhedron import parse_face_stream, build_face_to_face_connectivity_through_edges, FaceStream
from checks.vtk_utils import (
from ..checks.supported_elements import Options, check, __check
from ..checks.vtk_polyhedron import parse_face_stream, build_face_to_face_connectivity_through_edges, FaceStream
from ..checks.vtk_utils import (
to_vtk_id_list, )


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from numpy.linalg import norm
import pytest

from checks.triangle_distance import distance_between_two_segments, distance_between_two_triangles
from ..checks.triangle_distance import distance_between_two_segments, distance_between_two_triangles


@dataclass( frozen=True )
Expand Down
4 changes: 0 additions & 4 deletions geosx_mesh_doctor/requirements.txt

This file was deleted.

24 changes: 24 additions & 0 deletions geosx_mesh_doctor/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[metadata]
name = mesh_doctor
version = 0.1.0
description = Mesh doctor
author = Gazzolab
author_email = [email protected]
license = LGPL-2.1

[options]
packages =
mesh_doctor
mesh_doctor.checks
mesh_doctor.parsing
mesh_doctor.tests
install_requires =
vtk >= 9.1
networkx >= 2.4
tqdm
numpy
python_requires = >=3.7

[options.entry_points]
console_scripts =
mesh_doctor = mesh_doctor.main:main
3 changes: 0 additions & 3 deletions geosx_mesh_doctor/setup.py

This file was deleted.

Loading