From 38480f69a6d487583c4d716547c65280cf52f126 Mon Sep 17 00:00:00 2001 From: tomvanmele Date: Wed, 24 Apr 2024 08:18:40 +0200 Subject: [PATCH 1/3] import the itertools functionality from itertools --- src/compas/datastructures/mesh/duality.py | 2 +- src/compas/datastructures/mesh/mesh.py | 2 +- src/compas/datastructures/mesh/subdivision.py | 2 +- src/compas/geometry/_core/predicates_3.py | 2 +- src/compas/geometry/interpolation_coons.py | 2 +- src/compas/geometry/offset.py | 2 +- src/compas/geometry/projection.py | 2 +- .../geometry/quadmesh_planarize_none.py | 2 +- src/compas/geometry/reflection.py | 2 +- src/compas/geometry/rotation.py | 2 +- src/compas/geometry/scale.py | 2 +- src/compas/geometry/shear.py | 2 +- src/compas/geometry/surfaces/nurbs.py | 2 +- src/compas/geometry/translation.py | 2 +- src/compas/geometry/trimesh_curvature.py | 2 +- src/compas/itertools.py | 4 +- src/compas_rhino/conduits/faces.py | 2 +- src/compas_rhino/conduits/labels.py | 2 +- src/compas_rhino/conduits/lines.py | 2 +- src/compas_rhino/conduits/points.py | 2 +- src/compas_rhino/geometry/surfaces/nurbs.py | 2 +- .../compas/{utilities => }/test_itertools.py | 6 +- tests/compas/utilities/test_async_.py | 112 ------------------ tests/compas/utilities/test_itertools_.py | 39 ------ 24 files changed, 25 insertions(+), 176 deletions(-) rename tests/compas/{utilities => }/test_itertools.py (94%) delete mode 100644 tests/compas/utilities/test_async_.py delete mode 100644 tests/compas/utilities/test_itertools_.py diff --git a/src/compas/datastructures/mesh/duality.py b/src/compas/datastructures/mesh/duality.py index 9c133a90cd2..985aebda0bc 100644 --- a/src/compas/datastructures/mesh/duality.py +++ b/src/compas/datastructures/mesh/duality.py @@ -4,7 +4,7 @@ from math import pi -from compas.utilities import flatten +from compas.itertools import flatten PI2 = 2.0 * pi diff --git a/src/compas/datastructures/mesh/mesh.py b/src/compas/datastructures/mesh/mesh.py index bb13df6c6f3..4074c7cef77 100644 --- a/src/compas/datastructures/mesh/mesh.py +++ b/src/compas/datastructures/mesh/mesh.py @@ -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 diff --git a/src/compas/datastructures/mesh/subdivision.py b/src/compas/datastructures/mesh/subdivision.py index 67dd54399b5..aede8aa49db 100644 --- a/src/compas/datastructures/mesh/subdivision.py +++ b/src/compas/datastructures/mesh/subdivision.py @@ -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): diff --git a/src/compas/geometry/_core/predicates_3.py b/src/compas/geometry/_core/predicates_3.py index eedb2d6ae84..7f0c244bc1f 100644 --- a/src/compas/geometry/_core/predicates_3.py +++ b/src/compas/geometry/_core/predicates_3.py @@ -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 # ============================================================================= # ============================================================================= diff --git a/src/compas/geometry/interpolation_coons.py b/src/compas/geometry/interpolation_coons.py index 537d1665155..3e69fab28f2 100644 --- a/src/compas/geometry/interpolation_coons.py +++ b/src/compas/geometry/interpolation_coons.py @@ -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): diff --git a/src/compas/geometry/offset.py b/src/compas/geometry/offset.py index bd8c5ba4fb0..244ba55ee46 100644 --- a/src/compas/geometry/offset.py +++ b/src/compas/geometry/offset.py @@ -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): diff --git a/src/compas/geometry/projection.py b/src/compas/geometry/projection.py index 36b68a5e6c4..041759c9cc2 100644 --- a/src/compas/geometry/projection.py +++ b/src/compas/geometry/projection.py @@ -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): diff --git a/src/compas/geometry/quadmesh_planarize_none.py b/src/compas/geometry/quadmesh_planarize_none.py index a1e9e893e47..92487087aa3 100644 --- a/src/compas/geometry/quadmesh_planarize_none.py +++ b/src/compas/geometry/quadmesh_planarize_none.py @@ -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): diff --git a/src/compas/geometry/reflection.py b/src/compas/geometry/reflection.py index 3ee71118547..c2f37d6a5ee 100644 --- a/src/compas/geometry/reflection.py +++ b/src/compas/geometry/reflection.py @@ -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): diff --git a/src/compas/geometry/rotation.py b/src/compas/geometry/rotation.py index 55f39937a82..fe47af1040c 100644 --- a/src/compas/geometry/rotation.py +++ b/src/compas/geometry/rotation.py @@ -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): diff --git a/src/compas/geometry/scale.py b/src/compas/geometry/scale.py index 2e65218ea59..7921056a278 100644 --- a/src/compas/geometry/scale.py +++ b/src/compas/geometry/scale.py @@ -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): diff --git a/src/compas/geometry/shear.py b/src/compas/geometry/shear.py index 29fb62e17a2..b6603085657 100644 --- a/src/compas/geometry/shear.py +++ b/src/compas/geometry/shear.py @@ -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): diff --git a/src/compas/geometry/surfaces/nurbs.py b/src/compas/geometry/surfaces/nurbs.py index 601d220c54a..1784e66a536 100644 --- a/src/compas/geometry/surfaces/nurbs.py +++ b/src/compas/geometry/surfaces/nurbs.py @@ -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 diff --git a/src/compas/geometry/translation.py b/src/compas/geometry/translation.py index 3830cbc7fbf..867fe6b1e02 100644 --- a/src/compas/geometry/translation.py +++ b/src/compas/geometry/translation.py @@ -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): diff --git a/src/compas/geometry/trimesh_curvature.py b/src/compas/geometry/trimesh_curvature.py index f5b2ed5b3cb..d3f5e7a077b 100644 --- a/src/compas/geometry/trimesh_curvature.py +++ b/src/compas/geometry/trimesh_curvature.py @@ -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") diff --git a/src/compas/itertools.py b/src/compas/itertools.py index 17464c4fb57..756764679b7 100644 --- a/src/compas/itertools.py +++ b/src/compas/itertools.py @@ -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)) @@ -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] diff --git a/src/compas_rhino/conduits/faces.py b/src/compas_rhino/conduits/faces.py index 8937a8bfe48..efe2f9b7dee 100644 --- a/src/compas_rhino/conduits/faces.py +++ b/src/compas_rhino/conduits/faces.py @@ -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 diff --git a/src/compas_rhino/conduits/labels.py b/src/compas_rhino/conduits/labels.py index 2a1b8e74a88..773e77541d0 100644 --- a/src/compas_rhino/conduits/labels.py +++ b/src/compas_rhino/conduits/labels.py @@ -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 diff --git a/src/compas_rhino/conduits/lines.py b/src/compas_rhino/conduits/lines.py index 7a9917324b0..9098ce39792 100644 --- a/src/compas_rhino/conduits/lines.py +++ b/src/compas_rhino/conduits/lines.py @@ -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 diff --git a/src/compas_rhino/conduits/points.py b/src/compas_rhino/conduits/points.py index 3aa2da97121..db75ef1fbb7 100644 --- a/src/compas_rhino/conduits/points.py +++ b/src/compas_rhino/conduits/points.py @@ -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 diff --git a/src/compas_rhino/geometry/surfaces/nurbs.py b/src/compas_rhino/geometry/surfaces/nurbs.py index 8a144f0cdaa..037263cff99 100644 --- a/src/compas_rhino/geometry/surfaces/nurbs.py +++ b/src/compas_rhino/geometry/surfaces/nurbs.py @@ -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 diff --git a/tests/compas/utilities/test_itertools.py b/tests/compas/test_itertools.py similarity index 94% rename from tests/compas/utilities/test_itertools.py rename to tests/compas/test_itertools.py index 30f7e422da3..844dac3a2ec 100644 --- a/tests/compas/utilities/test_itertools.py +++ b/tests/compas/test_itertools.py @@ -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 diff --git a/tests/compas/utilities/test_async_.py b/tests/compas/utilities/test_async_.py deleted file mode 100644 index d4abfebcba4..00000000000 --- a/tests/compas/utilities/test_async_.py +++ /dev/null @@ -1,112 +0,0 @@ -from threading import Thread - -from compas.utilities import await_callback - -import pytest - - -def test_void_return_callback(): - def async_fn(callback): - def runner(cb): - cb() - - Thread(target=runner, args=(callback,)).start() - - result = await_callback(async_fn) - assert result is None - - -def test_single_positional_arg_callback(): - def async_fn(callback): - def runner(cb): - cb("only_return_value") - - Thread(target=runner, args=(callback,)).start() - - result = await_callback(async_fn) - assert result == "only_return_value" - - -def test_many_positional_args_callback(): - def async_fn(callback): - def runner(cb): - cb(1, 2) - - Thread(target=runner, args=(callback,)).start() - - result = await_callback(async_fn) - assert result == ( - 1, - 2, - ) - - -def test_kwargs_callback(): - def async_fn(callback): - def runner(cb): - cb(name="Austin", last_name="Powers") - - Thread(target=runner, args=(callback,)).start() - - result = await_callback(async_fn) - assert result["name"] == "Austin" - assert result["last_name"] == "Powers" - - -def test_one_positional_arg_and_kwargs_callback(): - def async_fn(callback): - def runner(cb): - cb(1, retries=5) - - Thread(target=runner, args=(callback,)).start() - - result, kwargs = await_callback(async_fn) - assert result == 1 - assert kwargs["retries"] == 5 - - -def test_many_positional_args_and_kwargs_callback(): - def async_fn(callback): - def runner(cb): - cb(4, 2, 3, retries=5) - - Thread(target=runner, args=(callback,)).start() - - a, b, c, kw = await_callback(async_fn) - assert a == 4 - assert b == 2 - assert c == 3 - assert kw["retries"] == 5 - - -def test_async_fn_with_more_params(): - def async_fn(values, other_stuff, callback): - def runner(cb): - cb(200) - - Thread(target=runner, args=(callback,)).start() - - result = await_callback(async_fn, values=[1, 2, 3], other_stuff=None) - assert result == 200 - - -def test_captured_exception_in_thread(): - def async_fn(callback): - def runner(cb): - raise ValueError("exception") - - Thread(target=runner, args=(callback,)).start() - - with pytest.raises(ValueError): - await_callback(async_fn) - - -def test_errback(): - def async_fn(callback, errback): - def runner(cb, eb): - eb(ValueError("exception via errback")) - - Thread(target=runner, args=(callback, errback)).start() - - with pytest.raises(ValueError): - await_callback(async_fn, errback_name="errback") diff --git a/tests/compas/utilities/test_itertools_.py b/tests/compas/utilities/test_itertools_.py deleted file mode 100644 index b5026a0d8ac..00000000000 --- a/tests/compas/utilities/test_itertools_.py +++ /dev/null @@ -1,39 +0,0 @@ -import compas -import pytest - -from compas.datastructures import Mesh -from compas.utilities import iterable_like - - -# ============================================================================== -# iterable_like -# ============================================================================== - - -@pytest.mark.parametrize(("target", "base", "fillvalue"), [("hello", [0.5], 0.5)]) -def test_iterable_like_string_and_float(target, base, fillvalue): - a = list(iterable_like(target, base, fillvalue)) - assert a == [0.5, 0.5, 0.5, 0.5, 0.5] - - -@pytest.mark.parametrize( - ("target", "base", "fillvalue"), - [(["foo", "bar", "baz"], {"key_1": "a", "key_2": "b"}, "key_3")], -) -def test_iterable_like_list_and_dict(target, base, fillvalue): - a = list(iterable_like(target, base, fillvalue)) - assert sorted(a) == ["key_1", "key_2", "key_3"] - - -@pytest.mark.parametrize(("target", "base", "fillvalue"), [(range(2), ["a", "b"], 0)]) -def test_iterable_like_generator_and_list(target, base, fillvalue): - a = list(iterable_like(target, base, fillvalue)) - assert a == ["a", "b"] - - -@pytest.mark.parametrize(("mesh_a", "mesh_b"), [("faces.obj", "hypar.obj"), ("hypar.obj", "faces.obj")]) -def test_iterable_cap_generator(mesh_a, mesh_b): - ma = Mesh.from_obj(compas.get(mesh_a)) - mb = Mesh.from_obj(compas.get(mesh_b)) - a = list(iterable_like(ma.faces(), mb.faces())) - assert len(a) == len(list(ma.faces())) From 1f154c82e03b23ca59767171336dd54bfe65d39f Mon Sep 17 00:00:00 2001 From: tomvanmele Date: Wed, 24 Apr 2024 10:36:13 +0200 Subject: [PATCH 2/3] log --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 242ddf49bb8..a967fc1b524 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,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 From 75aaf2d2c34cba7d1e83d659eb0533edf256de74 Mon Sep 17 00:00:00 2001 From: tomvanmele Date: Wed, 24 Apr 2024 12:54:53 +0200 Subject: [PATCH 3/3] order of imports --- src/compas/datastructures/mesh/mesh.py | 2 +- src/compas/datastructures/mesh/subdivision.py | 2 +- src/compas/geometry/_core/predicates_3.py | 2 +- src/compas/geometry/offset.py | 2 +- src/compas/geometry/projection.py | 2 +- src/compas/geometry/reflection.py | 2 +- src/compas/geometry/rotation.py | 2 +- src/compas/geometry/scale.py | 2 +- src/compas/geometry/shear.py | 2 +- src/compas/geometry/surfaces/nurbs.py | 2 +- src/compas/geometry/translation.py | 2 +- src/compas/geometry/trimesh_curvature.py | 2 +- src/compas_rhino/conduits/faces.py | 2 +- src/compas_rhino/conduits/labels.py | 2 +- src/compas_rhino/conduits/lines.py | 2 +- src/compas_rhino/conduits/points.py | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/compas/datastructures/mesh/mesh.py b/src/compas/datastructures/mesh/mesh.py index 4074c7cef77..aa2641c817c 100644 --- a/src/compas/datastructures/mesh/mesh.py +++ b/src/compas/datastructures/mesh/mesh.py @@ -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.itertools import window from .duality import mesh_dual from .operations.collapse import mesh_collapse_edge diff --git a/src/compas/datastructures/mesh/subdivision.py b/src/compas/datastructures/mesh/subdivision.py index aede8aa49db..190545a2a00 100644 --- a/src/compas/datastructures/mesh/subdivision.py +++ b/src/compas/datastructures/mesh/subdivision.py @@ -8,8 +8,8 @@ from compas.geometry import centroid_points from compas.geometry import offset_polygon -from compas.itertools import pairwise from compas.itertools import iterable_like +from compas.itertools import pairwise def subd_factory(cls): diff --git a/src/compas/geometry/_core/predicates_3.py b/src/compas/geometry/_core/predicates_3.py index 7f0c244bc1f..374d5338bb7 100644 --- a/src/compas/geometry/_core/predicates_3.py +++ b/src/compas/geometry/_core/predicates_3.py @@ -13,8 +13,8 @@ from compas.geometry import length_vector from compas.geometry import normal_polygon from compas.geometry import subtract_vectors -from compas.tolerance import TOL from compas.itertools import window +from compas.tolerance import TOL # ============================================================================= # ============================================================================= diff --git a/src/compas/geometry/offset.py b/src/compas/geometry/offset.py index 244ba55ee46..2924dea68e6 100644 --- a/src/compas/geometry/offset.py +++ b/src/compas/geometry/offset.py @@ -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 pairwise from compas.itertools import iterable_like +from compas.itertools import pairwise def intersect_lines(l1, l2, tol): diff --git a/src/compas/geometry/projection.py b/src/compas/geometry/projection.py index 041759c9cc2..d6a095b6ddd 100644 --- a/src/compas/geometry/projection.py +++ b/src/compas/geometry/projection.py @@ -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.tolerance import TOL from compas.itertools import flatten +from compas.tolerance import TOL class Projection(Transformation): diff --git a/src/compas/geometry/reflection.py b/src/compas/geometry/reflection.py index c2f37d6a5ee..314ed8470bd 100644 --- a/src/compas/geometry/reflection.py +++ b/src/compas/geometry/reflection.py @@ -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.tolerance import TOL from compas.itertools import flatten +from compas.tolerance import TOL class Reflection(Transformation): diff --git a/src/compas/geometry/rotation.py b/src/compas/geometry/rotation.py index fe47af1040c..f9ecec4914a 100644 --- a/src/compas/geometry/rotation.py +++ b/src/compas/geometry/rotation.py @@ -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.tolerance import TOL from compas.itertools import flatten +from compas.tolerance import TOL class Rotation(Transformation): diff --git a/src/compas/geometry/scale.py b/src/compas/geometry/scale.py index 7921056a278..2ed8d7fdf8c 100644 --- a/src/compas/geometry/scale.py +++ b/src/compas/geometry/scale.py @@ -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.tolerance import TOL from compas.itertools import flatten +from compas.tolerance import TOL class Scale(Transformation): diff --git a/src/compas/geometry/shear.py b/src/compas/geometry/shear.py index b6603085657..7de59bdc469 100644 --- a/src/compas/geometry/shear.py +++ b/src/compas/geometry/shear.py @@ -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.tolerance import TOL from compas.itertools import flatten +from compas.tolerance import TOL class Shear(Transformation): diff --git a/src/compas/geometry/surfaces/nurbs.py b/src/compas/geometry/surfaces/nurbs.py index 1784e66a536..23f7d9a8f86 100644 --- a/src/compas/geometry/surfaces/nurbs.py +++ b/src/compas/geometry/surfaces/nurbs.py @@ -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.itertools import meshgrid from .surface import Surface diff --git a/src/compas/geometry/translation.py b/src/compas/geometry/translation.py index 867fe6b1e02..2b0d5a82009 100644 --- a/src/compas/geometry/translation.py +++ b/src/compas/geometry/translation.py @@ -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.tolerance import TOL from compas.itertools import flatten +from compas.tolerance import TOL class Translation(Transformation): diff --git a/src/compas/geometry/trimesh_curvature.py b/src/compas/geometry/trimesh_curvature.py index d3f5e7a077b..56a79ef3ef9 100644 --- a/src/compas/geometry/trimesh_curvature.py +++ b/src/compas/geometry/trimesh_curvature.py @@ -5,8 +5,8 @@ from math import pi from compas.geometry import angle_points -from compas.plugins import pluggable from compas.itertools import window +from compas.plugins import pluggable @pluggable(category="trimesh") diff --git a/src/compas_rhino/conduits/faces.py b/src/compas_rhino/conduits/faces.py index efe2f9b7dee..238981a3971 100644 --- a/src/compas_rhino/conduits/faces.py +++ b/src/compas_rhino/conduits/faces.py @@ -5,8 +5,8 @@ from Rhino.Geometry import Point3d from System.Drawing.Color import FromArgb -from compas.utilities import is_sequence_of_iterable from compas.itertools import iterable_like +from compas.utilities import is_sequence_of_iterable from .base import BaseConduit diff --git a/src/compas_rhino/conduits/labels.py b/src/compas_rhino/conduits/labels.py index 773e77541d0..116d2187336 100644 --- a/src/compas_rhino/conduits/labels.py +++ b/src/compas_rhino/conduits/labels.py @@ -5,8 +5,8 @@ from Rhino.Geometry import Point3d from System.Drawing.Color import FromArgb -from compas.utilities import is_sequence_of_iterable from compas.itertools import iterable_like +from compas.utilities import is_sequence_of_iterable from .base import BaseConduit diff --git a/src/compas_rhino/conduits/lines.py b/src/compas_rhino/conduits/lines.py index 9098ce39792..57aca6f366b 100644 --- a/src/compas_rhino/conduits/lines.py +++ b/src/compas_rhino/conduits/lines.py @@ -5,8 +5,8 @@ from Rhino.Geometry import Point3d from System.Drawing.Color import FromArgb -from compas.utilities import is_sequence_of_iterable from compas.itertools import iterable_like +from compas.utilities import is_sequence_of_iterable from .base import BaseConduit diff --git a/src/compas_rhino/conduits/points.py b/src/compas_rhino/conduits/points.py index db75ef1fbb7..383a19266a1 100644 --- a/src/compas_rhino/conduits/points.py +++ b/src/compas_rhino/conduits/points.py @@ -6,8 +6,8 @@ from Rhino.Geometry import Point3d from System.Drawing.Color import FromArgb -from compas.utilities import color_to_rgb from compas.itertools import iterable_like +from compas.utilities import color_to_rgb from compas.utilities.coercing import is_sequence_of_iterable from .base import BaseConduit