sonolus.py 0.3.2__py3-none-any.whl → 0.3.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of sonolus.py might be problematic. Click here for more details.
- sonolus/backend/finalize.py +16 -4
- sonolus/backend/visitor.py +25 -9
- sonolus/script/archetype.py +40 -22
- sonolus/script/array.py +8 -5
- sonolus/script/array_like.py +44 -19
- sonolus/script/containers.py +24 -4
- sonolus/script/debug.py +4 -4
- sonolus/script/engine.py +2 -2
- sonolus/script/instruction.py +1 -1
- sonolus/script/internal/builtin_impls.py +10 -5
- sonolus/script/internal/context.py +5 -1
- sonolus/script/internal/math_impls.py +17 -0
- sonolus/script/internal/native.py +3 -3
- sonolus/script/internal/range.py +30 -7
- sonolus/script/internal/tuple_impl.py +3 -1
- sonolus/script/internal/value.py +1 -1
- sonolus/script/interval.py +61 -3
- sonolus/script/num.py +13 -13
- sonolus/script/pointer.py +1 -1
- sonolus/script/quad.py +39 -3
- sonolus/script/record.py +7 -0
- sonolus/script/runtime.py +28 -0
- sonolus/script/stream.py +25 -16
- sonolus/script/transform.py +4 -4
- sonolus/script/vec.py +19 -7
- {sonolus_py-0.3.2.dist-info → sonolus_py-0.3.4.dist-info}/METADATA +1 -1
- {sonolus_py-0.3.2.dist-info → sonolus_py-0.3.4.dist-info}/RECORD +30 -30
- {sonolus_py-0.3.2.dist-info → sonolus_py-0.3.4.dist-info}/WHEEL +0 -0
- {sonolus_py-0.3.2.dist-info → sonolus_py-0.3.4.dist-info}/entry_points.txt +0 -0
- {sonolus_py-0.3.2.dist-info → sonolus_py-0.3.4.dist-info}/licenses/LICENSE +0 -0
sonolus/script/vec.py
CHANGED
|
@@ -73,8 +73,20 @@ class Vec2(Record):
|
|
|
73
73
|
"""
|
|
74
74
|
return cls(x=1, y=0)
|
|
75
75
|
|
|
76
|
+
@classmethod
|
|
77
|
+
def unit(cls, angle: float) -> Self:
|
|
78
|
+
"""Return a unit vector (magnitude 1) at a given angle in radians.
|
|
79
|
+
|
|
80
|
+
Args:
|
|
81
|
+
angle: The angle in radians.
|
|
82
|
+
|
|
83
|
+
Returns:
|
|
84
|
+
A new unit vector at the specified angle.
|
|
85
|
+
"""
|
|
86
|
+
return Vec2(x=cos(angle), y=sin(angle))
|
|
87
|
+
|
|
76
88
|
@property
|
|
77
|
-
def magnitude(self) ->
|
|
89
|
+
def magnitude(self) -> float:
|
|
78
90
|
"""Calculate the magnitude (length) of the vector.
|
|
79
91
|
|
|
80
92
|
Returns:
|
|
@@ -83,7 +95,7 @@ class Vec2(Record):
|
|
|
83
95
|
return (self.x**2 + self.y**2) ** 0.5
|
|
84
96
|
|
|
85
97
|
@property
|
|
86
|
-
def angle(self) ->
|
|
98
|
+
def angle(self) -> float:
|
|
87
99
|
"""Calculate the angle of the vector in radians from the positive x-axis.
|
|
88
100
|
|
|
89
101
|
Returns:
|
|
@@ -91,7 +103,7 @@ class Vec2(Record):
|
|
|
91
103
|
"""
|
|
92
104
|
return atan2(self.y, self.x)
|
|
93
105
|
|
|
94
|
-
def dot(self, other: Self) ->
|
|
106
|
+
def dot(self, other: Self) -> float:
|
|
95
107
|
"""Calculate the dot product of this vector with another vector.
|
|
96
108
|
|
|
97
109
|
Args:
|
|
@@ -102,11 +114,11 @@ class Vec2(Record):
|
|
|
102
114
|
"""
|
|
103
115
|
return self.x * other.x + self.y * other.y
|
|
104
116
|
|
|
105
|
-
def rotate(self, angle:
|
|
117
|
+
def rotate(self, angle: float) -> Self:
|
|
106
118
|
"""Rotate the vector by a given angle in radians and return a new vector.
|
|
107
119
|
|
|
108
120
|
Args:
|
|
109
|
-
angle: The angle to rotate the vector by, in radians.
|
|
121
|
+
angle: The angle to rotate the vector by, in radians. Positive angles rotate counterclockwise.
|
|
110
122
|
|
|
111
123
|
Returns:
|
|
112
124
|
A new vector rotated by the given angle.
|
|
@@ -116,11 +128,11 @@ class Vec2(Record):
|
|
|
116
128
|
y=self.x * sin(angle) + self.y * cos(angle),
|
|
117
129
|
)
|
|
118
130
|
|
|
119
|
-
def rotate_about(self, angle:
|
|
131
|
+
def rotate_about(self, angle: float, pivot: Self) -> Self:
|
|
120
132
|
"""Rotate the vector about a pivot by a given angle in radians and return a new vector.
|
|
121
133
|
|
|
122
134
|
Args:
|
|
123
|
-
angle: The angle to rotate the vector by, in radians.
|
|
135
|
+
angle: The angle to rotate the vector by, in radians. Positive angles rotate counterclockwise.
|
|
124
136
|
pivot: The pivot point to rotate about.
|
|
125
137
|
|
|
126
138
|
Returns:
|
|
@@ -3,7 +3,7 @@ sonolus/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
3
3
|
sonolus/backend/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
sonolus/backend/blocks.py,sha256=3peyb9eYBy0s53xNVJ1KmK4IgoyVkkwG-lqDQ_VZTHc,18531
|
|
5
5
|
sonolus/backend/excepthook.py,sha256=pqI9gtPBh0mlTgMNqul8bEVO1ARzKb8pNE9EN_CyDpk,994
|
|
6
|
-
sonolus/backend/finalize.py,sha256=
|
|
6
|
+
sonolus/backend/finalize.py,sha256=Ab3Z-TdHhQXQ2KAMfQlDy2VYm4rjPpOZxbFonwQ-8Ic,4614
|
|
7
7
|
sonolus/backend/interpret.py,sha256=B0jqlLmEGoyO2mxpcvwRwV17Tq_gOE9wLNt26Q5QOfs,14306
|
|
8
8
|
sonolus/backend/ir.py,sha256=TCDLMvlX2S8emFDQwFVeD2OUC4fnhbrMObgYtoa_7PQ,2845
|
|
9
9
|
sonolus/backend/mode.py,sha256=NkcPZJm8dn83LX35uP24MtQOCnfRDFZ280dHeEEfauE,613
|
|
@@ -11,7 +11,7 @@ sonolus/backend/node.py,sha256=eEzPP14jzWJp2xrZCAaPlNtokxdoqg0bSM7xQiwx1j8,1254
|
|
|
11
11
|
sonolus/backend/ops.py,sha256=7DERBPU6z9Bz3i6UxyLdFTXYcCpvRZVNWw4ZQ-Djwnk,10510
|
|
12
12
|
sonolus/backend/place.py,sha256=jABvLNNE-2pklTcb9WnyfHK8c-tYxn0ObsoLp5LYd5I,4703
|
|
13
13
|
sonolus/backend/utils.py,sha256=BuJHI-qTVn-vYlQkSr4fSDPpgckkiO2RJmwlDXY_KzM,1818
|
|
14
|
-
sonolus/backend/visitor.py,sha256=
|
|
14
|
+
sonolus/backend/visitor.py,sha256=zANjR9PkUnWS5XnvA65OnYUSe54hNcad_nb1TFFTVMY,50213
|
|
15
15
|
sonolus/backend/optimize/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
16
|
sonolus/backend/optimize/allocate.py,sha256=-cpnCQ7S6wH3y-hCUGb2KT5TMuREifhsMXMI0-YtNjY,7380
|
|
17
17
|
sonolus/backend/optimize/constant_evaluation.py,sha256=ozYB__haE2A_L2NBh2H3IT__Z65FBBtbjh6BJfQRC_A,15988
|
|
@@ -34,59 +34,59 @@ sonolus/build/level.py,sha256=AjvK4725nqDcg7oGn5kWocBdG-AcirXpku74T7c2epA,673
|
|
|
34
34
|
sonolus/build/node.py,sha256=gnX71RYDUOK_gYMpinQi-bLWO4csqcfiG5gFmhxzSec,1330
|
|
35
35
|
sonolus/build/project.py,sha256=DhNqgHnm73qKUOhrg1JPlWEL0Vg7VxcGUbNokpMWzVE,6315
|
|
36
36
|
sonolus/script/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
37
|
-
sonolus/script/archetype.py,sha256=
|
|
38
|
-
sonolus/script/array.py,sha256=
|
|
39
|
-
sonolus/script/array_like.py,sha256=
|
|
37
|
+
sonolus/script/archetype.py,sha256=pQ_-J85Skf0tLT0YMoc36TUbJgc8t2HGBAzend_qmoI,41425
|
|
38
|
+
sonolus/script/array.py,sha256=8mC2LXEbYgsblkNcSi8elkAjODBYB29iN4A4-Lsfifo,11970
|
|
39
|
+
sonolus/script/array_like.py,sha256=MVFqTH2iKVpwUntMP8sxRICa9tYb9atyDs_6v0FwpNw,9402
|
|
40
40
|
sonolus/script/bucket.py,sha256=YFSyKS4ZngxerBlKwFBSCRAVewgQdwZ1-NqfPKcPZxI,7519
|
|
41
|
-
sonolus/script/containers.py,sha256
|
|
42
|
-
sonolus/script/debug.py,sha256=
|
|
41
|
+
sonolus/script/containers.py,sha256=-6QooG0vIXF3fmP97Lxada7Jklm6sXQFwkevGzVNo7s,18403
|
|
42
|
+
sonolus/script/debug.py,sha256=gyOXpduQwKhUrNZDoD_tODp3h6zIQ0yfZk7tKvVQ9x4,5136
|
|
43
43
|
sonolus/script/easing.py,sha256=7zaDKIfM_whUpb4FBz1DAF4NNG2vk_nDjl8kL2Y90aU,11396
|
|
44
44
|
sonolus/script/effect.py,sha256=V9bJvMzs1O4C1PjTOKgsAXov-l4AnDb2h38-DzmeWpI,5838
|
|
45
|
-
sonolus/script/engine.py,sha256=
|
|
45
|
+
sonolus/script/engine.py,sha256=etI9dJsQ7V9YZICVNZg54WqpLijPxG8eTPHiV-_EiG8,10687
|
|
46
46
|
sonolus/script/globals.py,sha256=gUvSbxXW1ZOsyQF6qb5iMRnW-eRrg07rWOK1PAYRwsE,9741
|
|
47
|
-
sonolus/script/instruction.py,sha256=
|
|
48
|
-
sonolus/script/interval.py,sha256=
|
|
47
|
+
sonolus/script/instruction.py,sha256=GKaYu6GwBLtbgj1nJilD6O2ebRRdmwHZvhYeVHbHcUc,6721
|
|
48
|
+
sonolus/script/interval.py,sha256=IhJZOuhivZZS-9nX_40ksIUPYICpTcHkekxCyo-WllE,11203
|
|
49
49
|
sonolus/script/iterator.py,sha256=wH6IM3ozLuMtCJZzhahIN3o2ykwUzDftU7ylbWo2UF8,4575
|
|
50
50
|
sonolus/script/level.py,sha256=wR23xk-NOcW_JMRb3R12sqIXCLSZL-7cM3y7IpMF1J0,6333
|
|
51
51
|
sonolus/script/metadata.py,sha256=ttRK27eojHf3So50KQJ-8yj3udZoN1bli5iD-knaeLw,753
|
|
52
|
-
sonolus/script/num.py,sha256=
|
|
52
|
+
sonolus/script/num.py,sha256=GplnvW11ZyC-bXLdk_RsRnupc__3-xNeduSpxijwNM8,15382
|
|
53
53
|
sonolus/script/options.py,sha256=OqvIPgdHbj03Ffzn857R_SrSJVUstrGy8o7Em6vv0y4,9419
|
|
54
54
|
sonolus/script/particle.py,sha256=oeVQF01xOeW2BEn04ZK1ZOP2HGvQzxBJCpITFjy9woQ,8353
|
|
55
|
-
sonolus/script/pointer.py,sha256=
|
|
55
|
+
sonolus/script/pointer.py,sha256=FoOfyD93r0G5d_2BaKfeOT9SqkOP3hq6sqtOs_Rb0c8,1511
|
|
56
56
|
sonolus/script/printing.py,sha256=mNYu9QWiacBBGZrnePZQMVwbbguoelUps9GiOK_aVRU,2096
|
|
57
57
|
sonolus/script/project.py,sha256=jLndgGJHdkqFYe-lDl_IzTjQ4gOSuy80en8WoSWXnB8,3340
|
|
58
|
-
sonolus/script/quad.py,sha256=
|
|
59
|
-
sonolus/script/record.py,sha256=
|
|
60
|
-
sonolus/script/runtime.py,sha256=
|
|
58
|
+
sonolus/script/quad.py,sha256=wt0siM3SWPyQ2JEUP6sy_jVArZ62tLZjT-0ZOWPIcLw,11185
|
|
59
|
+
sonolus/script/record.py,sha256=1NeLkg-gufOwcUY9-B4zr8JzgzxINfUB5j9CYLrpMig,12513
|
|
60
|
+
sonolus/script/runtime.py,sha256=XaS3op1BewSQchIffbJoz8WWw-prqk1PqBx2hdI3AMY,32971
|
|
61
61
|
sonolus/script/sprite.py,sha256=CMcRAZ2hejXnaBmY2_n1_rj6hGOgPP5zEW-BpyaEVOY,16256
|
|
62
|
-
sonolus/script/stream.py,sha256=
|
|
62
|
+
sonolus/script/stream.py,sha256=G7oBMVvnDFIpivGNjKixB1OYVwDOkSZbQmc_UvNgg30,24242
|
|
63
63
|
sonolus/script/text.py,sha256=wxujIgKYcCfl2AD2_Im8g3vh0lDEHYwTSRZg9wsBPEU,13402
|
|
64
64
|
sonolus/script/timing.py,sha256=ZR0ypV2PIoDCMHHGOMfCeezStCsBQdzomdqaz5VKex0,2981
|
|
65
|
-
sonolus/script/transform.py,sha256=
|
|
65
|
+
sonolus/script/transform.py,sha256=BKAokYC1EmyPcdlwapd5P1fA90LwVfJYrkDNDc4NHJ0,20904
|
|
66
66
|
sonolus/script/ui.py,sha256=DYPGWIjHj1IFPxW1zaEuIUQx0b32FJPXtiwCvrtJ6oo,7528
|
|
67
67
|
sonolus/script/values.py,sha256=woSW3we5OZZ1IaO3Qr0OAs_yuIpAzGw_IjwELKQHzv4,1469
|
|
68
|
-
sonolus/script/vec.py,sha256=
|
|
68
|
+
sonolus/script/vec.py,sha256=lFwMADvBYnNHkh7ejjNPRBKrFrfb1rgaVCVsx6x4Juw,7416
|
|
69
69
|
sonolus/script/internal/__init__.py,sha256=T6rzLoiOUaiSQtaHMZ88SNO-ijSjSSv33TKtUwu-Ms8,136
|
|
70
|
-
sonolus/script/internal/builtin_impls.py,sha256=
|
|
70
|
+
sonolus/script/internal/builtin_impls.py,sha256=VDeBpnLwu6v_r53qiXjgA1NF1aaBm9GTxP1XoWGkSLM,8569
|
|
71
71
|
sonolus/script/internal/callbacks.py,sha256=vWzJG8uiJoEtsNnbeZPqOHogCwoLpz2D1MnHY2wVV8s,2801
|
|
72
72
|
sonolus/script/internal/constant.py,sha256=k4kIBoy-c74UbfUR7GKzyTT6syhE-lSRJfw0nGuc8ZY,3904
|
|
73
|
-
sonolus/script/internal/context.py,sha256=
|
|
73
|
+
sonolus/script/internal/context.py,sha256=aJUXAsL9KlO7i5jVvuWsbHkNi8o_YevtoWyzaUdIYp4,15561
|
|
74
74
|
sonolus/script/internal/descriptor.py,sha256=XRFey-EjiAm_--KsNl-8N0Mi_iyQwlPh68gDp0pKf3E,392
|
|
75
75
|
sonolus/script/internal/dict_impl.py,sha256=alu_wKGSk1kZajNf64qbe7t71shEzD4N5xNIATH8Swo,1885
|
|
76
76
|
sonolus/script/internal/error.py,sha256=ZNnsvQVQAnFKzcvsm6-sste2lo-tP5pPI8sD7XlAZWc,490
|
|
77
77
|
sonolus/script/internal/generic.py,sha256=F0-cCiRNGTaUJvYlpmkiOsU3Xge_XjoBpBwBhH_qS_s,7577
|
|
78
78
|
sonolus/script/internal/impl.py,sha256=0uIZ9UtZYqKbsvp2XKo-aVIzkiA8MRbiPIOt0OMmxVo,3018
|
|
79
79
|
sonolus/script/internal/introspection.py,sha256=SL2zaYjid0kkcj6ZbFLIwhgh7WKZBaAHhlbSJGr6PWs,974
|
|
80
|
-
sonolus/script/internal/math_impls.py,sha256=
|
|
81
|
-
sonolus/script/internal/native.py,sha256=
|
|
80
|
+
sonolus/script/internal/math_impls.py,sha256=nHSLgA7Tcx7jY1p07mYBCeSRmVx713bwdNayCIcaXSE,2652
|
|
81
|
+
sonolus/script/internal/native.py,sha256=rbQIpzE1Zec6IoCiQVC3kW9dJbEZmaIjDkVzrBeXQfk,1596
|
|
82
82
|
sonolus/script/internal/random.py,sha256=6Ku5edRcDUh7rtqEEYCJz0BQavw69RALsVHS25z50pI,1695
|
|
83
|
-
sonolus/script/internal/range.py,sha256=
|
|
83
|
+
sonolus/script/internal/range.py,sha256=OMYsGUB43K7jwX1sbIPnJBDk9j0gL1XPr81QUVok-C4,3370
|
|
84
84
|
sonolus/script/internal/simulation_context.py,sha256=jUgNxCOEc_b99w1yFyVz0nVb6rgkEsyuCBvcYxq34Vk,4819
|
|
85
85
|
sonolus/script/internal/transient.py,sha256=d6iYhM9f6DPUX5nkYQGm-x0b9XEfZUmB4AtUNnyhixo,1636
|
|
86
|
-
sonolus/script/internal/tuple_impl.py,sha256=
|
|
87
|
-
sonolus/script/internal/value.py,sha256=
|
|
88
|
-
sonolus_py-0.3.
|
|
89
|
-
sonolus_py-0.3.
|
|
90
|
-
sonolus_py-0.3.
|
|
91
|
-
sonolus_py-0.3.
|
|
92
|
-
sonolus_py-0.3.
|
|
86
|
+
sonolus/script/internal/tuple_impl.py,sha256=DPNdmmRmupU8Ah4_XKq6-PdT336l4nt15_uCJKQGkkk,3587
|
|
87
|
+
sonolus/script/internal/value.py,sha256=bfooiA5cMlZOCKqqchnUGNdJJc6-ec2jHoLsDZjbU_g,5379
|
|
88
|
+
sonolus_py-0.3.4.dist-info/METADATA,sha256=B9QIp4ebnYp4YO5F7TXa3bP-MHKoJJQ3cMMlgrA0JF4,302
|
|
89
|
+
sonolus_py-0.3.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
90
|
+
sonolus_py-0.3.4.dist-info/entry_points.txt,sha256=oTYspY_b7SA8TptEMTDxh4-Aj-ZVPnYC9f1lqH6s9G4,54
|
|
91
|
+
sonolus_py-0.3.4.dist-info/licenses/LICENSE,sha256=JEKpqVhQYfEc7zg3Mj462sKbKYmO1K7WmvX1qvg9IJk,1067
|
|
92
|
+
sonolus_py-0.3.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|