From bc86b759d11dd30f3cd8f97e5ab4447defd3556d Mon Sep 17 00:00:00 2001 From: jan Date: Sun, 7 Feb 2021 19:29:20 -0800 Subject: [PATCH] remove @profile markers --- adze/boundary.py | 9 --------- adze/moments.py | 6 ------ adze/split.py | 8 -------- adze/util.py | 13 ------------- adze/voxel.py | 8 -------- 5 files changed, 44 deletions(-) diff --git a/adze/boundary.py b/adze/boundary.py index cf3a346..2fd498d 100644 --- a/adze/boundary.py +++ b/adze/boundary.py @@ -5,13 +5,6 @@ from numpy.linalg import norm from . import poly_t, plane_t from .util import _get_maps, find_components, find_faces -try: - # Check if running with line_profiler - profile -except NameError: - def profile(f): - return f - def planes_from_boundary(vertices: numpy.ndarray, faces: List[numpy.ndarray] @@ -41,7 +34,6 @@ def planes_from_boundary(vertices: numpy.ndarray, return planes -@profile def build_polyhedron(vertices: numpy.ndarray, faces: numpy.ndarray) -> poly_t: ''' Generate a 3-verted-connected Schlegel diagram representation @@ -263,7 +255,6 @@ def build_polyhedron(vertices: numpy.ndarray, faces: numpy.ndarray) -> poly_t: return {'vertices': final_vertices, 'neighbors': neighbors} -@profile def boundary_from_poly(poly: poly_t) -> Dict: ''' Generate a boundary represeentation corresponding to the provided diff --git a/adze/moments.py b/adze/moments.py index d362d14..93b79d3 100644 --- a/adze/moments.py +++ b/adze/moments.py @@ -4,11 +4,6 @@ import numpy from . import poly_t, plane_t from .util import find_faces -try: - # Check if running with line_profiler - profile -except NameError: - def profile(f): def number_of_moments(order: int) -> int: ''' @@ -36,7 +31,6 @@ def get_volume(poly: poly_t) -> float: return get_moments(poly, 0)[0] -@profile def get_moments(poly: poly_t, order: int) -> numpy.ndarray: ''' Calculates the moments of a polyhedron, up to the specified polynomial order. diff --git a/adze/split.py b/adze/split.py index 1924dce..03b54c7 100644 --- a/adze/split.py +++ b/adze/split.py @@ -3,13 +3,6 @@ import numpy from . import poly_t, plane_t from .util import build_empty, _get_map -try: - # Check if running with line_profiler - profile -except NameError: - def profile(f): - return f - def clip(poly: poly_t, plane: plane_t) -> poly_t: ''' @@ -29,7 +22,6 @@ def clip(poly: poly_t, plane: plane_t) -> poly_t: return left_poly -@profile def split(poly, plane, same_only: bool = False): ''' Clip a polyhedron with a plane. diff --git a/adze/util.py b/adze/util.py index 4df2ad0..4942379 100644 --- a/adze/util.py +++ b/adze/util.py @@ -1,13 +1,6 @@ from typing import Dict, Tuple, List import numpy -try: - # Check if running with line_profiler - profile -except NameError: - def profile(f): - return f - plane_t = Tuple[numpy.ndarray, float] poly_t = Dict[str, numpy.ndarray] @@ -26,7 +19,6 @@ def build_empty() -> poly_t: } -@profile def find_components(neighbors: numpy.ndarray) -> numpy.ndarray: ''' Given an adjacency list, flood-fill to find and label connected components. @@ -57,7 +49,6 @@ def find_components(neighbors: numpy.ndarray) -> numpy.ndarray: return component - 1 -@profile def find_faces(neighbors: numpy.ndarray) -> List[numpy.ndarray]: ''' Traverse the Schlegel diagram to find chordless cycles @@ -140,7 +131,6 @@ def find_faces(neighbors: numpy.ndarray) -> List[numpy.ndarray]: return cleaned_faces(remove, k) -@profile def _get_map(a, b): ''' Returns m such that a[m] == b @@ -155,7 +145,6 @@ def _get_map(a, b): return sa[r] -@profile def _get_map_rows(a, b): ''' Row-wise _get_map @@ -166,7 +155,6 @@ def _get_map_rows(a, b): return _get_map(a1d, b1d) -@profile def _get_maps(a, b): ''' Returns m, n such that a[m] == b, b[n] == a @@ -184,7 +172,6 @@ def _get_maps(a, b): return m, n -@profile def _get_maps_rows(a, b): ''' Row-wise _get_maps diff --git a/adze/voxel.py b/adze/voxel.py index 67e8b90..cb775c9 100644 --- a/adze/voxel.py +++ b/adze/voxel.py @@ -6,15 +6,7 @@ from .split import split, clip from .moments import get_moments, number_of_moments from .shapes import planes_from_box -try: - # Check if running with line_profiler - profile -except NameError: - def profile(f): - return f - -@profile def voxelize(poly: poly_t, planes: List[numpy.ndarray], include_outside: bool = False,