Skip to content

Commit

Permalink
Remove util.curves (obsolete)
Browse files Browse the repository at this point in the history
  • Loading branch information
FranzBangar committed Oct 27, 2023
1 parent aebcb5a commit 408d481
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 70 deletions.
6 changes: 3 additions & 3 deletions src/classy_blocks/construct/curves/analytic.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ def parts(self):
raise NotImplementedError("Transforming analytic curves is currently not supported")


# class CircleCurve(AnalyticCurve):
# TODO!

# class LineCurve(AnalyticCurve):
# def __init__(self, point_1:PointType, point_2:PointType):

# class CircleCurve(AnalyticCurve):
# TODO!
32 changes: 0 additions & 32 deletions src/classy_blocks/util/curves.py

This file was deleted.

35 changes: 0 additions & 35 deletions tests/test_util/test_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import numpy as np

from classy_blocks.util import curves as c
from classy_blocks.util import functions as f


Expand Down Expand Up @@ -120,40 +119,6 @@ def test_to_cartesian_asserts(self):
with self.assertRaises(ValueError):
f.to_cartesian(p, axis="a")

def test_dilute_indexes(self):
"""generate equally-spaced indexes"""
self.assert_np_equal(c.dilute_indexes(11, 6), np.array([0, 2, 4, 6, 8, 10]))

def test_dilute_points(self):
"""return equally-spaced elements of an array"""
points = np.array([2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22])
diluted_points = c.dilute_points(points, 6)

self.assert_np_equal(diluted_points, np.array([2, 6, 10, 14, 18, 22]))

def test_curve_length(self):
"""length of a curve given by a list of points"""
curve = np.array(
[
f.vector(0, 0, 0),
f.vector(1, 0, 0),
f.vector(1, 1, 0),
f.vector(1, 2, 0),
f.vector(0, 2, 0),
]
)

self.assertAlmostEqual(c.curve_length(curve), 4)

def test_to_cartesian_curve(self):
"""f.to_cartesian() for a list of points"""
# polar points
points = [f.vector(1, 0, 0), f.vector(1, np.pi / 2, 1), f.vector(2, 0, 1)]

self.assert_np_almost_equal(
c.to_cartesian(points), np.array([f.vector(1, 0, 0), f.vector(0, 1, 1), f.vector(2, 0, 1)])
)

def test_arc_length_3point_half(self):
a = f.vector(0, 0, 0)
b = f.vector(1, 1, 0)
Expand Down

0 comments on commit 408d481

Please sign in to comment.