From 5eb422a668f66ef2b164f78008a8276dc5e6506a Mon Sep 17 00:00:00 2001 From: maybetree Date: Tue, 3 Sep 2024 12:35:32 +0200 Subject: [PATCH] Nuke numpy --- doc/pages/builtin-compos.md | 19 ++++++++++--------- doc/pages/coords-transforms.md | 3 +-- doc/pages/helpers.md | 10 +++++----- pyproject.toml | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/doc/pages/builtin-compos.md b/doc/pages/builtin-compos.md index 193a064..717af76 100644 --- a/doc/pages/builtin-compos.md +++ b/doc/pages/builtin-compos.md @@ -7,15 +7,16 @@ designs: ```python exec import raimad as rai -import numpy as np + +from math import radians RectLW = rai.RectLW(100, 50) circle = rai.Circle(radius=40) ansec = rai.AnSec( - theta1=np.deg2rad(45), - theta2=np.deg2rad(180), + theta1=radians(45), + theta2=radians(180), r1=50, r2=80, ) @@ -50,8 +51,8 @@ There are many different ways to define an `AnSec`: # angle one, and angle two ansec = rai.AnSec.from_auto( - theta1=np.deg2rad(45), - theta2=np.deg2rad(180), + theta1=radians(45), + theta2=radians(180), r1=50, r2=80, ) @@ -62,8 +63,8 @@ show(ansec) # Make it go the other way ansec = rai.AnSec.from_auto( - theta1=np.deg2rad(45), - theta2=np.deg2rad(180), + theta1=radians(45), + theta2=radians(180), r1=50, r2=80, ) @@ -76,8 +77,8 @@ show(ansec) for x in (10, 40, 60): ansec = rai.AnSec.from_auto( - theta1=np.deg2rad(0), - dtheta=np.deg2rad(x * 3), + theta1=radians(0), + dtheta=radians(x * 3), r1=50, dr=x, ) diff --git a/doc/pages/coords-transforms.md b/doc/pages/coords-transforms.md index fe50cb1..a8c9965 100644 --- a/doc/pages/coords-transforms.md +++ b/doc/pages/coords-transforms.md @@ -21,7 +21,6 @@ You can move, rotate, and scale any RAIMAD compo: ```python exec import raimad as rai -import numpy as np class IShapedFilter(rai.Compo): def _make(self, beam_length: float = 10.5): @@ -42,7 +41,7 @@ class TransformExample(rai.Compo): moved = filter.copy().move(50, 20) scaled = filter.copy().scale(5) - rotated = filter.copy().rotate(np.deg2rad(90)).scale(4) + rotated = filter.copy().rotate(rai.quartercircle).scale(4) self.subcompos.filter = filter self.subcompos.moved = moved diff --git a/doc/pages/helpers.md b/doc/pages/helpers.md index e29919f..8d5eb9b 100644 --- a/doc/pages/helpers.md +++ b/doc/pages/helpers.md @@ -8,12 +8,12 @@ but you can also use them for your own benefit. ```python exec import raimad as rai -import numpy as np +from math import degrees -print( rai.midpoint( np.array((-10, -10)), np.array((12, 12)) )) -print( rai.polar( np.deg2rad(90), 5 )) -print( np.rad2deg( - rai.angle_between( np.array((0, 10)), np.array((2, 2)) ) +print( rai.midpoint( (-10, -10), (12, 12) )) +print( rai.polar( rai.halfcircle, 5 )) +print( degrees( + rai.angle_between( (0, 10), (2, 2) ) )) ``` diff --git a/pyproject.toml b/pyproject.toml index 116890e..b50e5f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "raidoc" -version = "1.1.0.0" +version = "1.1.0.1" description = "Documentation for RAIMAD" authors = [ {name = "maybetree", email = "maybetree48@proton.me"}