Skip to content

Commit

Permalink
Merge pull request #1335 from compas-dev/import-from-itertools
Browse files Browse the repository at this point in the history
Import from itertools
  • Loading branch information
tomvanmele authored Apr 24, 2024
2 parents 14a2eed + f302c1d commit 4aff080
Show file tree
Hide file tree
Showing 25 changed files with 26 additions and 176 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Changed order of imports according to `isort` and changed line length to `179`.
* Changed use of `compas.geometry.allclose` to `compas.tolerance.TOL.is_allclose`.
* Changed use of `compas.geometry.close` to `compas.tolerance.TOL.is_close`.
* Changed imports of itertools to `compas.itertools` instead of `compas.utilities`.

### Removed

Expand Down
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 @@ -53,11 +53,11 @@
from compas.geometry import vector_average
from compas.itertools import linspace
from compas.itertools import pairwise
from compas.itertools import window
from compas.tolerance import TOL
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 .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 @@ -8,8 +8,8 @@

from compas.geometry import centroid_points
from compas.geometry import offset_polygon
from compas.itertools import iterable_like
from compas.itertools import pairwise
from compas.utilities 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 @@ -13,8 +13,8 @@
from compas.geometry import length_vector
from compas.geometry import normal_polygon
from compas.geometry import subtract_vectors
from compas.itertools import window
from compas.tolerance import TOL
from compas.utilities 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 @@ -12,8 +12,8 @@
from compas.geometry import normalize_vector
from compas.geometry import scale_vector
from compas.geometry import subtract_vectors
from compas.itertools import iterable_like
from compas.itertools import pairwise
from compas.utilities 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 @@ -17,8 +17,8 @@
from compas.geometry import matrix_from_parallel_projection
from compas.geometry import matrix_from_perspective_entries
from compas.geometry import matrix_from_perspective_projection
from compas.itertools import flatten
from compas.tolerance import TOL
from compas.utilities 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 @@ -18,8 +18,8 @@
from compas.geometry import identity_matrix
from compas.geometry import matrix_from_perspective_entries
from compas.geometry import normalize_vector
from compas.itertools import flatten
from compas.tolerance import TOL
from compas.utilities 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 @@ -23,8 +23,8 @@
from compas.geometry import matrix_from_frame
from compas.geometry import matrix_from_quaternion
from compas.geometry import normalize_vector
from compas.itertools import flatten
from compas.tolerance import TOL
from compas.utilities 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 @@ -17,8 +17,8 @@
from compas.geometry import matrix_from_scale_factors
from compas.geometry import matrix_inverse
from compas.geometry import multiply_matrices
from compas.itertools import flatten
from compas.tolerance import TOL
from compas.utilities 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 @@ -15,8 +15,8 @@
from compas.geometry import decompose_matrix
from compas.geometry import matrix_from_shear
from compas.geometry import matrix_from_shear_entries
from compas.itertools import flatten
from compas.tolerance import TOL
from compas.utilities 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 @@ -4,9 +4,9 @@

from compas.geometry import Point
from compas.itertools import linspace
from compas.itertools import meshgrid
from compas.plugins import PluginNotInstalledError
from compas.plugins import pluggable
from compas.utilities 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 @@ -14,8 +14,8 @@
from compas.geometry import Transformation
from compas.geometry import matrix_from_translation
from compas.geometry import translation_from_matrix
from compas.itertools import flatten
from compas.tolerance import TOL
from compas.utilities 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 @@ -5,8 +5,8 @@
from math import pi

from compas.geometry import angle_points
from compas.itertools import window
from compas.plugins import pluggable
from compas.utilities 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 @@ -5,8 +5,8 @@
from Rhino.Geometry import Point3d
from System.Drawing.Color import FromArgb

from compas.itertools import iterable_like
from compas.utilities import is_sequence_of_iterable
from compas.utilities 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 @@ -5,8 +5,8 @@
from Rhino.Geometry import Point3d
from System.Drawing.Color import FromArgb

from compas.itertools import iterable_like
from compas.utilities import is_sequence_of_iterable
from compas.utilities 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 @@ -5,8 +5,8 @@
from Rhino.Geometry import Point3d
from System.Drawing.Color import FromArgb

from compas.itertools import iterable_like
from compas.utilities import is_sequence_of_iterable
from compas.utilities 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 @@ -6,8 +6,8 @@
from Rhino.Geometry import Point3d
from System.Drawing.Color import FromArgb

from compas.itertools import iterable_like
from compas.utilities import color_to_rgb
from compas.utilities 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 4aff080

Please sign in to comment.