Skip to content

Commit

Permalink
import the itertools functionality from itertools
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvanmele committed Apr 24, 2024
1 parent 8b5c4cc commit 6972960
Show file tree
Hide file tree
Showing 24 changed files with 25 additions and 176 deletions.
2 changes: 1 addition & 1 deletion src/compas/datastructures/mesh/duality.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from math import pi

from compas.utilities import flatten
from compas.itertools import flatten

PI2 = 2.0 * pi

Expand Down
2 changes: 1 addition & 1 deletion src/compas/datastructures/mesh/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
from compas.topology import breadth_first_traverse
from compas.topology import connected_components
from compas.topology import unify_cycles
from compas.utilities import window
from compas.itertools import window

from .duality import mesh_dual
from .operations.collapse import mesh_collapse_edge
Expand Down
2 changes: 1 addition & 1 deletion src/compas/datastructures/mesh/subdivision.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from compas.geometry import centroid_points
from compas.geometry import offset_polygon
from compas.itertools import pairwise
from compas.utilities import iterable_like
from compas.itertools import iterable_like


def subd_factory(cls):
Expand Down
2 changes: 1 addition & 1 deletion src/compas/geometry/_core/predicates_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from compas.geometry import normal_polygon
from compas.geometry import subtract_vectors
from compas.tolerance import TOL
from compas.utilities import window
from compas.itertools import window

# =============================================================================
# =============================================================================
Expand Down
2 changes: 1 addition & 1 deletion src/compas/geometry/interpolation_coons.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from compas.geometry import scale_vector
from compas.geometry import subtract_vectors
from compas.geometry import sum_vectors
from compas.utilities import normalize_values
from compas.itertools import normalize_values


def discrete_coons_patch(ab, bc, dc, ad):
Expand Down
2 changes: 1 addition & 1 deletion src/compas/geometry/offset.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from compas.geometry import scale_vector
from compas.geometry import subtract_vectors
from compas.itertools import pairwise
from compas.utilities import iterable_like
from compas.itertools import iterable_like


def intersect_lines(l1, l2, tol):
Expand Down
2 changes: 1 addition & 1 deletion src/compas/geometry/projection.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from compas.geometry import matrix_from_perspective_entries
from compas.geometry import matrix_from_perspective_projection
from compas.tolerance import TOL
from compas.utilities import flatten
from compas.itertools import flatten


class Projection(Transformation):
Expand Down
2 changes: 1 addition & 1 deletion src/compas/geometry/quadmesh_planarize_none.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from compas.geometry import midpoint_point_point
from compas.geometry import project_points_plane
from compas.itertools import pairwise
from compas.utilities import window
from compas.itertools import window


def mesh_flatness(mesh, maxdev=1.0):
Expand Down
2 changes: 1 addition & 1 deletion src/compas/geometry/reflection.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from compas.geometry import matrix_from_perspective_entries
from compas.geometry import normalize_vector
from compas.tolerance import TOL
from compas.utilities import flatten
from compas.itertools import flatten


class Reflection(Transformation):
Expand Down
2 changes: 1 addition & 1 deletion src/compas/geometry/rotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from compas.geometry import matrix_from_quaternion
from compas.geometry import normalize_vector
from compas.tolerance import TOL
from compas.utilities import flatten
from compas.itertools import flatten


class Rotation(Transformation):
Expand Down
2 changes: 1 addition & 1 deletion src/compas/geometry/scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from compas.geometry import matrix_inverse
from compas.geometry import multiply_matrices
from compas.tolerance import TOL
from compas.utilities import flatten
from compas.itertools import flatten


class Scale(Transformation):
Expand Down
2 changes: 1 addition & 1 deletion src/compas/geometry/shear.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from compas.geometry import matrix_from_shear
from compas.geometry import matrix_from_shear_entries
from compas.tolerance import TOL
from compas.utilities import flatten
from compas.itertools import flatten


class Shear(Transformation):
Expand Down
2 changes: 1 addition & 1 deletion src/compas/geometry/surfaces/nurbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from compas.itertools import linspace
from compas.plugins import PluginNotInstalledError
from compas.plugins import pluggable
from compas.utilities import meshgrid
from compas.itertools import meshgrid

from .surface import Surface

Expand Down
2 changes: 1 addition & 1 deletion src/compas/geometry/translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from compas.geometry import matrix_from_translation
from compas.geometry import translation_from_matrix
from compas.tolerance import TOL
from compas.utilities import flatten
from compas.itertools import flatten


class Translation(Transformation):
Expand Down
2 changes: 1 addition & 1 deletion src/compas/geometry/trimesh_curvature.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from compas.geometry import angle_points
from compas.plugins import pluggable
from compas.utilities import window
from compas.itertools import window


@pluggable(category="trimesh")
Expand Down
4 changes: 2 additions & 2 deletions src/compas/itertools.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def meshgrid(x, y, indexing="xy"):
Examples
--------
>>> from compas.utilities import linspace, meshgrid
>>> from compas.itertools import linspace, meshgrid
>>> x = list(linspace(0, 1, 3))
>>> y = list(linspace(0, 1, 2))
Expand Down Expand Up @@ -181,7 +181,7 @@ def linspace(start, stop, num=50):
Examples
--------
>>> from compas.utilities import linspace
>>> from compas.itertools import linspace
>>> list(linspace(0, 1, 3))
[0.0, 0.5, 1.0]
Expand Down
2 changes: 1 addition & 1 deletion src/compas_rhino/conduits/faces.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from System.Drawing.Color import FromArgb

from compas.utilities import is_sequence_of_iterable
from compas.utilities import iterable_like
from compas.itertools import iterable_like

from .base import BaseConduit

Expand Down
2 changes: 1 addition & 1 deletion src/compas_rhino/conduits/labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from System.Drawing.Color import FromArgb

from compas.utilities import is_sequence_of_iterable
from compas.utilities import iterable_like
from compas.itertools import iterable_like

from .base import BaseConduit

Expand Down
2 changes: 1 addition & 1 deletion src/compas_rhino/conduits/lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from System.Drawing.Color import FromArgb

from compas.utilities import is_sequence_of_iterable
from compas.utilities import iterable_like
from compas.itertools import iterable_like

from .base import BaseConduit

Expand Down
2 changes: 1 addition & 1 deletion src/compas_rhino/conduits/points.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from System.Drawing.Color import FromArgb

from compas.utilities import color_to_rgb
from compas.utilities import iterable_like
from compas.itertools import iterable_like
from compas.utilities.coercing import is_sequence_of_iterable

from .base import BaseConduit
Expand Down
2 changes: 1 addition & 1 deletion src/compas_rhino/geometry/surfaces/nurbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from compas.geometry import NurbsSurface
from compas.geometry import Point
from compas.geometry import knots_and_mults_to_knotvector
from compas.utilities import flatten
from compas.itertools import flatten
from compas_rhino.conversions import point_to_compas
from compas_rhino.conversions import point_to_rhino

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import pytest

from compas.datastructures import Mesh
from compas.utilities import iterable_like
from compas.utilities import reshape
from compas.utilities import flatten
from compas.itertools import iterable_like
from compas.itertools import reshape
from compas.itertools import flatten
from compas.tolerance import TOL


Expand Down
112 changes: 0 additions & 112 deletions tests/compas/utilities/test_async_.py

This file was deleted.

39 changes: 0 additions & 39 deletions tests/compas/utilities/test_itertools_.py

This file was deleted.

0 comments on commit 6972960

Please sign in to comment.