amulet-core 2.0a5__cp312-cp312-win_amd64.whl → 2.0a7__cp312-cp312-win_amd64.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 amulet-core might be problematic. Click here for more details.

Files changed (232) hide show
  1. amulet/__init__.cp312-win_amd64.pyd +0 -0
  2. amulet/__init__.py.cpp +43 -0
  3. amulet/__init__.pyi +0 -2
  4. amulet/_init.py +0 -2
  5. amulet/_version.py +3 -3
  6. amulet/biome.py.cpp +122 -0
  7. amulet/biome.pyi +0 -2
  8. amulet/block.py.cpp +377 -0
  9. amulet/block.pyi +0 -2
  10. amulet/block_entity.py.cpp +115 -0
  11. amulet/block_entity.pyi +0 -2
  12. amulet/chunk.py.cpp +80 -0
  13. amulet/chunk.pyi +0 -2
  14. amulet/chunk_components/biome_3d_component.cpp +5 -0
  15. amulet/chunk_components/biome_3d_component.hpp +79 -0
  16. amulet/chunk_components/block_component.cpp +41 -0
  17. amulet/chunk_components/block_component.hpp +88 -0
  18. amulet/chunk_components/block_entity_component.cpp +5 -0
  19. amulet/chunk_components/block_entity_component.hpp +147 -0
  20. amulet/chunk_components/section_array_map.cpp +129 -0
  21. amulet/chunk_components/section_array_map.hpp +147 -0
  22. amulet/chunk_components.pyi +20 -18
  23. amulet/collections/eq.py.hpp +37 -0
  24. amulet/collections/hash.py.hpp +27 -0
  25. amulet/collections/holder.py.hpp +37 -0
  26. amulet/collections/iterator.py.hpp +80 -0
  27. amulet/collections/mapping.py.hpp +199 -0
  28. amulet/collections/mutable_mapping.py.hpp +226 -0
  29. amulet/collections/sequence.py.hpp +163 -0
  30. amulet/collections.pyi +8 -5
  31. amulet/entity.py +22 -20
  32. amulet/game/translate/_functions/_code_functions/_text.py +2 -2
  33. amulet/game/translate/_functions/abc.py +10 -3
  34. amulet/img/__init__.py +10 -0
  35. amulet/img/missing_no.png +0 -0
  36. amulet/img/missing_pack.png +0 -0
  37. amulet/img/missing_world.png +0 -0
  38. amulet/io/binary_reader.hpp +45 -0
  39. amulet/io/binary_writer.hpp +30 -0
  40. amulet/level/__init__.pyi +2 -6
  41. amulet/level/abc/_level/_creatable_level.py +1 -2
  42. amulet/level/abc/_level/_level.py +1 -5
  43. amulet/level/java/__init__.pyi +0 -5
  44. amulet/level/java/_raw/__init__.pyi +0 -4
  45. amulet/level/java/_raw/java_chunk_decode.cpp +531 -0
  46. amulet/level/java/_raw/java_chunk_decode.hpp +23 -0
  47. amulet/level/java/_raw/java_chunk_encode.cpp +25 -0
  48. amulet/level/java/_raw/java_chunk_encode.hpp +23 -0
  49. amulet/level/java/chunk_components/data_version_component.cpp +32 -0
  50. amulet/level/java/chunk_components/data_version_component.hpp +31 -0
  51. amulet/level/java/chunk_components/java_raw_chunk_component.cpp +56 -0
  52. amulet/level/java/chunk_components/java_raw_chunk_component.hpp +45 -0
  53. amulet/level/java/java_chunk.cpp +170 -0
  54. amulet/level/java/java_chunk.hpp +141 -0
  55. amulet/level/java/long_array.hpp +175 -0
  56. amulet/level/java/long_array.pyi +2 -1
  57. amulet/mesh/block/__init__.py +1 -0
  58. amulet/mesh/block/block_mesh.py +369 -0
  59. amulet/mesh/block/cube.py +149 -0
  60. amulet/mesh/block/missing_block.py +20 -0
  61. amulet/mesh/util.py +17 -0
  62. amulet/palette/biome_palette.hpp +85 -0
  63. amulet/palette/block_palette.cpp +32 -0
  64. amulet/palette/block_palette.hpp +93 -0
  65. amulet/player.py +4 -6
  66. amulet/pybind11/collections.hpp +118 -0
  67. amulet/pybind11/numpy.hpp +26 -0
  68. amulet/pybind11/py_module.hpp +34 -0
  69. amulet/pybind11/type_hints.hpp +51 -0
  70. amulet/pybind11/types.hpp +25 -0
  71. amulet/pybind11/typing.hpp +7 -0
  72. amulet/resource_pack/__init__.py +62 -0
  73. amulet/resource_pack/abc/__init__.py +2 -0
  74. amulet/resource_pack/abc/resource_pack.py +38 -0
  75. amulet/resource_pack/abc/resource_pack_manager.py +87 -0
  76. amulet/resource_pack/bedrock/__init__.py +2 -0
  77. amulet/resource_pack/bedrock/bedrock_vanilla_fix/pack_icon.png +0 -0
  78. amulet/resource_pack/bedrock/bedrock_vanilla_fix/textures/blocks/grass_carried.png +0 -0
  79. amulet/resource_pack/bedrock/bedrock_vanilla_fix/textures/blocks/grass_side_carried.png +0 -0
  80. amulet/resource_pack/bedrock/bedrock_vanilla_fix/textures/blocks/water.png +0 -0
  81. amulet/resource_pack/bedrock/blockshapes/__init__.py +31 -0
  82. amulet/resource_pack/bedrock/blockshapes/air.py +35 -0
  83. amulet/resource_pack/bedrock/blockshapes/base_blockshape.py +29 -0
  84. amulet/resource_pack/bedrock/blockshapes/bubble_column.py +29 -0
  85. amulet/resource_pack/bedrock/blockshapes/cake.py +46 -0
  86. amulet/resource_pack/bedrock/blockshapes/chest.py +54 -0
  87. amulet/resource_pack/bedrock/blockshapes/comparator.py +51 -0
  88. amulet/resource_pack/bedrock/blockshapes/cross_texture.py +186 -0
  89. amulet/resource_pack/bedrock/blockshapes/cross_texture0.py +17 -0
  90. amulet/resource_pack/bedrock/blockshapes/cross_texture_green.py +16 -0
  91. amulet/resource_pack/bedrock/blockshapes/cube.py +38 -0
  92. amulet/resource_pack/bedrock/blockshapes/default.py +14 -0
  93. amulet/resource_pack/bedrock/blockshapes/door.py +38 -0
  94. amulet/resource_pack/bedrock/blockshapes/door1.py +14 -0
  95. amulet/resource_pack/bedrock/blockshapes/door2.py +14 -0
  96. amulet/resource_pack/bedrock/blockshapes/door3.py +14 -0
  97. amulet/resource_pack/bedrock/blockshapes/door4.py +14 -0
  98. amulet/resource_pack/bedrock/blockshapes/door5.py +14 -0
  99. amulet/resource_pack/bedrock/blockshapes/door6.py +14 -0
  100. amulet/resource_pack/bedrock/blockshapes/double_plant.py +40 -0
  101. amulet/resource_pack/bedrock/blockshapes/enchanting_table.py +22 -0
  102. amulet/resource_pack/bedrock/blockshapes/farmland.py +22 -0
  103. amulet/resource_pack/bedrock/blockshapes/fence.py +22 -0
  104. amulet/resource_pack/bedrock/blockshapes/flat.py +55 -0
  105. amulet/resource_pack/bedrock/blockshapes/flat_wall.py +55 -0
  106. amulet/resource_pack/bedrock/blockshapes/furnace.py +44 -0
  107. amulet/resource_pack/bedrock/blockshapes/furnace_lit.py +14 -0
  108. amulet/resource_pack/bedrock/blockshapes/green_cube.py +39 -0
  109. amulet/resource_pack/bedrock/blockshapes/ladder.py +36 -0
  110. amulet/resource_pack/bedrock/blockshapes/lilypad.py +14 -0
  111. amulet/resource_pack/bedrock/blockshapes/partial_block.py +57 -0
  112. amulet/resource_pack/bedrock/blockshapes/piston.py +44 -0
  113. amulet/resource_pack/bedrock/blockshapes/piston_arm.py +72 -0
  114. amulet/resource_pack/bedrock/blockshapes/portal_frame.py +22 -0
  115. amulet/resource_pack/bedrock/blockshapes/pressure_plate.py +29 -0
  116. amulet/resource_pack/bedrock/blockshapes/pumpkin.py +36 -0
  117. amulet/resource_pack/bedrock/blockshapes/pumpkin_carved.py +14 -0
  118. amulet/resource_pack/bedrock/blockshapes/pumpkin_lit.py +14 -0
  119. amulet/resource_pack/bedrock/blockshapes/red_dust.py +14 -0
  120. amulet/resource_pack/bedrock/blockshapes/repeater.py +53 -0
  121. amulet/resource_pack/bedrock/blockshapes/slab.py +33 -0
  122. amulet/resource_pack/bedrock/blockshapes/slab_double.py +15 -0
  123. amulet/resource_pack/bedrock/blockshapes/tree.py +41 -0
  124. amulet/resource_pack/bedrock/blockshapes/turtle_egg.py +15 -0
  125. amulet/resource_pack/bedrock/blockshapes/vine.py +52 -0
  126. amulet/resource_pack/bedrock/blockshapes/wall.py +22 -0
  127. amulet/resource_pack/bedrock/blockshapes/water.py +38 -0
  128. amulet/resource_pack/bedrock/download_resources.py +147 -0
  129. amulet/resource_pack/bedrock/resource_pack.py +40 -0
  130. amulet/resource_pack/bedrock/resource_pack_manager.py +361 -0
  131. amulet/resource_pack/bedrock/sort_blockshapes.py +15 -0
  132. amulet/resource_pack/java/__init__.py +2 -0
  133. amulet/resource_pack/java/download_resources.py +212 -0
  134. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_black.png +0 -0
  135. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_blue.png +0 -0
  136. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_brown.png +0 -0
  137. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_cyan.png +0 -0
  138. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_gray.png +0 -0
  139. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_green.png +0 -0
  140. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_light_blue.png +0 -0
  141. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_light_gray.png +0 -0
  142. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_lime.png +0 -0
  143. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_magenta.png +0 -0
  144. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_orange.png +0 -0
  145. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_pink.png +0 -0
  146. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_purple.png +0 -0
  147. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_red.png +0 -0
  148. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_white.png +0 -0
  149. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_yellow.png +0 -0
  150. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/barrier.png +0 -0
  151. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/end_portal.png +0 -0
  152. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/grass.png +0 -0
  153. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/lava.png +0 -0
  154. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/structure_void.png +0 -0
  155. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/water.png +0 -0
  156. amulet/resource_pack/java/java_vanilla_fix/pack.png +0 -0
  157. amulet/resource_pack/java/resource_pack.py +44 -0
  158. amulet/resource_pack/java/resource_pack_manager.py +551 -0
  159. amulet/resource_pack/unknown_resource_pack.py +10 -0
  160. amulet/utils/__init__.pyi +0 -5
  161. amulet/utils/call_spec/_call_spec.py +2 -7
  162. amulet/utils/comment_json.py +188 -0
  163. amulet/utils/matrix.py +3 -3
  164. amulet/utils/numpy.hpp +36 -0
  165. amulet/utils/numpy_helpers.py +2 -2
  166. amulet/utils/world_utils.py +2 -2
  167. amulet/version.py.cpp +281 -0
  168. amulet/version.pyi +0 -8
  169. {amulet_core-2.0a5.dist-info → amulet_core-2.0a7.dist-info}/METADATA +3 -3
  170. amulet_core-2.0a7.dist-info/RECORD +295 -0
  171. amulet/chunk_/components/biome.py +0 -155
  172. amulet/chunk_/components/block_entity.py +0 -117
  173. amulet/chunk_/components/entity.py +0 -64
  174. amulet/chunk_/components/height_2d.py +0 -16
  175. amulet/level/bedrock/__init__.py +0 -2
  176. amulet/level/bedrock/_chunk_handle.py +0 -19
  177. amulet/level/bedrock/_dimension.py +0 -22
  178. amulet/level/bedrock/_level.py +0 -187
  179. amulet/level/bedrock/_raw/__init__.py +0 -5
  180. amulet/level/bedrock/_raw/_actor_counter.py +0 -53
  181. amulet/level/bedrock/_raw/_chunk.py +0 -54
  182. amulet/level/bedrock/_raw/_chunk_decode.py +0 -668
  183. amulet/level/bedrock/_raw/_chunk_encode.py +0 -602
  184. amulet/level/bedrock/_raw/_constant.py +0 -9
  185. amulet/level/bedrock/_raw/_dimension.py +0 -343
  186. amulet/level/bedrock/_raw/_level.py +0 -463
  187. amulet/level/bedrock/_raw/_level_dat.py +0 -90
  188. amulet/level/bedrock/_raw/_typing.py +0 -6
  189. amulet/level/bedrock/_raw/leveldb_chunk_versions.py +0 -83
  190. amulet/level/bedrock/chunk/__init__.py +0 -1
  191. amulet/level/bedrock/chunk/_chunk.py +0 -126
  192. amulet/level/bedrock/chunk/components/chunk_version.py +0 -12
  193. amulet/level/bedrock/chunk/components/finalised_state.py +0 -13
  194. amulet/level/bedrock/chunk/components/raw_chunk.py +0 -15
  195. amulet/level/construction/__init__.py +0 -0
  196. amulet/level/java/_chunk_handle.pyi +0 -15
  197. amulet/level/java/_dimension.pyi +0 -13
  198. amulet/level/java/_level.pyi +0 -120
  199. amulet/level/java/_raw/_chunk_decode.py +0 -561
  200. amulet/level/java/_raw/_chunk_encode.py +0 -463
  201. amulet/level/java/_raw/_constant.pyi +0 -20
  202. amulet/level/java/_raw/_data_pack/__init__.pyi +0 -8
  203. amulet/level/java/_raw/_data_pack/data_pack.pyi +0 -197
  204. amulet/level/java/_raw/_data_pack/data_pack_manager.pyi +0 -75
  205. amulet/level/java/_raw/_dimension.pyi +0 -72
  206. amulet/level/java/_raw/_level.pyi +0 -238
  207. amulet/level/java/_raw/_typing.pyi +0 -5
  208. amulet/level/java/anvil/__init__.pyi +0 -11
  209. amulet/level/java/anvil/_dimension.pyi +0 -109
  210. amulet/level/java/anvil/_region.pyi +0 -197
  211. amulet/level/java/anvil/_sector_manager.pyi +0 -142
  212. amulet/level/java_forge/__init__.py +0 -0
  213. amulet/level/mcstructure/__init__.py +0 -0
  214. amulet/level/nbt/__init__.py +0 -0
  215. amulet/level/schematic/__init__.py +0 -0
  216. amulet/level/sponge_schematic/__init__.py +0 -0
  217. amulet/utils/call_spec/__init__.pyi +0 -53
  218. amulet/utils/call_spec/_call_spec.pyi +0 -272
  219. amulet/utils/matrix.pyi +0 -177
  220. amulet/utils/shareable_lock.pyi +0 -190
  221. amulet/utils/signal/__init__.pyi +0 -25
  222. amulet/utils/signal/_signal.pyi +0 -84
  223. amulet/utils/task_manager.pyi +0 -168
  224. amulet/utils/typing.py +0 -4
  225. amulet/utils/typing.pyi +0 -6
  226. amulet/utils/weakref.pyi +0 -50
  227. amulet/utils/world_utils.pyi +0 -109
  228. amulet_core-2.0a5.dist-info/RECORD +0 -210
  229. /amulet/{level/bedrock/chunk/components → mesh}/__init__.py +0 -0
  230. {amulet_core-2.0a5.dist-info → amulet_core-2.0a7.dist-info}/WHEEL +0 -0
  231. {amulet_core-2.0a5.dist-info → amulet_core-2.0a7.dist-info}/entry_points.txt +0 -0
  232. {amulet_core-2.0a5.dist-info → amulet_core-2.0a7.dist-info}/top_level.txt +0 -0
@@ -1,142 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import threading as threading
4
- import typing
5
- from typing import NamedTuple
6
-
7
- from _bisect import bisect_left, bisect_right
8
-
9
- __all__ = [
10
- "NamedTuple",
11
- "NoValidSector",
12
- "Sector",
13
- "SectorManager",
14
- "bisect_left",
15
- "bisect_right",
16
- "threading",
17
- ]
18
-
19
- class NoValidSector(Exception):
20
- """
21
- An error for when there is no sector large enough and the region cannot be resized.
22
- """
23
-
24
- class Sector(tuple):
25
- """
26
- Sector(start, stop)
27
- """
28
-
29
- __slots__: typing.ClassVar[tuple] = tuple()
30
- _field_defaults: typing.ClassVar[dict] = {}
31
- _fields: typing.ClassVar[tuple] = ("start", "stop")
32
- @staticmethod
33
- def __new__(_cls, start: ForwardRef("int"), stop: ForwardRef("int")):
34
- """
35
- Create new instance of Sector(start, stop)
36
- """
37
-
38
- @classmethod
39
- def _make(cls, iterable):
40
- """
41
- Make a new Sector object from a sequence or iterable
42
- """
43
-
44
- def __getnewargs__(self):
45
- """
46
- Return self as a plain tuple. Used by copy and pickle.
47
- """
48
-
49
- def __repr__(self):
50
- """
51
- Return a nicely formatted representation string
52
- """
53
-
54
- def _asdict(self):
55
- """
56
- Return a new dict which maps field names to their values.
57
- """
58
-
59
- def _replace(self, **kwds):
60
- """
61
- Return a new Sector object replacing specified fields with new values
62
- """
63
-
64
- def contains(self, other: Sector) -> bool:
65
- """
66
- Is the other sector entirely within this sector.
67
- """
68
-
69
- def intersects(self, other: Sector) -> bool:
70
- """
71
- Do the two sectors intersect each other.
72
- """
73
-
74
- def neighbours(self, other: Sector) -> bool:
75
- """
76
- Do the two sectors neighbour but not intersect.
77
- """
78
-
79
- def split(self, other: Sector) -> list[Sector]:
80
- """
81
-
82
- Split this sector around another sector.
83
- The other sector must be contained within this sector
84
-
85
- :param other: The other sector to split around.
86
- :return: A list of 0-2 sectors
87
-
88
- """
89
-
90
- @property
91
- def length(self) -> int: ...
92
-
93
- class SectorManager:
94
- """
95
- A class to manage a sequence of memory.
96
- """
97
-
98
- def __init__(self, start: int, stop: int, resizable: bool = True):
99
- """
100
-
101
- :param start: The start of the memory region
102
- :param stop: The end of the memory region
103
- :param resizable: Can the region be resized
104
-
105
- """
106
-
107
- def _add_size_sector(self, sector: Sector) -> None: ...
108
- def free(self, sector: Sector) -> None:
109
- """
110
-
111
- Free a reserved sector.
112
- The sector must match exactly a sector previously reserved.
113
-
114
- :param sector: The sector to free
115
-
116
- """
117
-
118
- def reserve(self, sector: Sector) -> None:
119
- """
120
-
121
- Mark a section as reserved.
122
- If you don't know exactly where the sector is use `reserve_space` to find and reserve a new sector
123
-
124
- :param sector: The sector to reserve
125
-
126
- """
127
-
128
- def reserve_space(self, length: int) -> Sector:
129
- """
130
-
131
- Find and reserve a memory location large enough to fit the requested memory.
132
-
133
- :param length: The length of the memory region to reserve
134
- :return: The index of the start of the reserved memory region
135
-
136
- """
137
-
138
- @property
139
- def sectors(self) -> list[Sector]:
140
- """
141
- A list of reserved sectors. Ordered by their start location.
142
- """
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,53 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from amulet.utils.call_spec._call_spec import (
4
- AbstractArg,
5
- AbstractHashableArg,
6
- BoolArg,
7
- BytesArg,
8
- CallableArg,
9
- CallSpec,
10
- ConstantArg,
11
- DictArg,
12
- DirectoryPathArg,
13
- FilePathArg,
14
- FloatArg,
15
- HashableCallableArg,
16
- HashableTupleArg,
17
- HashableUnionArg,
18
- IntArg,
19
- PositionalArgs,
20
- SequenceArg,
21
- StringArg,
22
- TupleArg,
23
- UnionArg,
24
- callable_spec,
25
- method_spec,
26
- )
27
-
28
- from . import _call_spec
29
-
30
- __all__ = [
31
- "AbstractArg",
32
- "AbstractHashableArg",
33
- "BoolArg",
34
- "BytesArg",
35
- "CallSpec",
36
- "CallableArg",
37
- "ConstantArg",
38
- "DictArg",
39
- "DirectoryPathArg",
40
- "FilePathArg",
41
- "FloatArg",
42
- "HashableCallableArg",
43
- "HashableTupleArg",
44
- "HashableUnionArg",
45
- "IntArg",
46
- "PositionalArgs",
47
- "SequenceArg",
48
- "StringArg",
49
- "TupleArg",
50
- "UnionArg",
51
- "callable_spec",
52
- "method_spec",
53
- ]
@@ -1,272 +0,0 @@
1
- """
2
- This modules contains classes to notify other code of the call specification for a function.
3
- The aim is to support generating GUIs without having to manually program a GUI to handle the function call.
4
- """
5
-
6
- from __future__ import annotations
7
-
8
- import abc
9
- import typing
10
- from abc import ABC, abstractmethod
11
- from collections.abc import Sequence
12
- from typing import Any, ParamSpec, Protocol, TypeVar, cast, overload, runtime_checkable
13
-
14
- __all__ = [
15
- "ABC",
16
- "AbstractArg",
17
- "AbstractHashableArg",
18
- "Any",
19
- "BoolArg",
20
- "BytesArg",
21
- "CallSpec",
22
- "CallableArg",
23
- "ConstantArg",
24
- "DictArg",
25
- "DirectoryPathArg",
26
- "DocumentationArg",
27
- "FilePathArg",
28
- "FloatArg",
29
- "HashableCallableArg",
30
- "HashableTupleArg",
31
- "HashableUnionArg",
32
- "IntArg",
33
- "P",
34
- "ParamSpec",
35
- "PositionalArgs",
36
- "Protocol",
37
- "R",
38
- "Sequence",
39
- "SequenceArg",
40
- "StringArg",
41
- "TupleArg",
42
- "TypeVar",
43
- "TypedCallable",
44
- "TypedMethod",
45
- "UnionArg",
46
- "abstractmethod",
47
- "callable_spec",
48
- "cast",
49
- "method_spec",
50
- "overload",
51
- "runtime_checkable",
52
- ]
53
-
54
- class AbstractArg(abc.ABC):
55
- """
56
- The base class for all arguments.
57
- """
58
-
59
- def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: ...
60
-
61
- class AbstractHashableArg(AbstractArg, abc.ABC):
62
- """
63
- A base class for all arguments that are hashable.
64
- """
65
-
66
- class BoolArg(AbstractHashableArg):
67
- """
68
- A bool argument
69
- """
70
-
71
- def __init__(self, default: bool = False) -> None: ...
72
-
73
- class BytesArg(AbstractHashableArg):
74
- """
75
- A bytes argument
76
- """
77
-
78
- def __init__(self, default: bytes = ...) -> None: ...
79
-
80
- class CallSpec:
81
- """
82
- Arguments and keyword arguments that should be unpacked to call a function.
83
- """
84
-
85
- def __init__(self, *args: AbstractArg, **kwargs: AbstractArg) -> None: ...
86
-
87
- class CallableArg(AbstractArg):
88
- """
89
- An argument generated by a function.
90
- This can be used to create instances of classes.
91
- kwargs specify the arguments to pass to the function.
92
-
93
- """
94
-
95
- def __init__(
96
- self,
97
- func: typing.Callable[..., typing.Any],
98
- *args: AbstractArg,
99
- **kwargs: AbstractArg,
100
- ) -> None: ...
101
-
102
- class ConstantArg(AbstractArg):
103
- """
104
- A constant argument.
105
- Use this for fixed values.
106
-
107
- """
108
-
109
- def __init__(self, value: typing.Any) -> None: ...
110
-
111
- class DictArg(AbstractArg):
112
- """
113
- A dictionary argument
114
- """
115
-
116
- def __init__(self, key: AbstractHashableArg, value: AbstractArg) -> None: ...
117
-
118
- class DirectoryPathArg(StringArg):
119
- """
120
- A path to a directory on disk. Converts to a string.
121
- """
122
-
123
- class DocumentationArg(AbstractArg):
124
- """
125
- A way to add documentation for an argument.
126
- """
127
-
128
- def __init__(
129
- self, arg: AbstractArg, name: str | None = None, description: str | None = None
130
- ) -> None:
131
- """
132
- Construct a DocumentationArg instance.
133
-
134
- :param arg: The argument this documentation relates to.
135
- :param name: The short name for the argument.
136
- :param description: A longer description for the argument.
137
-
138
- """
139
-
140
- class FilePathArg(StringArg):
141
- """
142
- A path to a file on disk. Converts to a string.
143
- """
144
-
145
- class FloatArg(AbstractHashableArg):
146
- """
147
- A float argument
148
- """
149
-
150
- def __init__(
151
- self,
152
- default: float = 0,
153
- min_value: float | None = None,
154
- max_value: float | None = None,
155
- ) -> None: ...
156
-
157
- class HashableCallableArg(AbstractHashableArg):
158
- """
159
- An argument generated by a function.
160
- This can be used to create instances of classes.
161
- kwargs specify the arguments to pass to the function.
162
-
163
- """
164
-
165
- def __init__(
166
- self, func: typing.Callable[..., Hashable], call_spec: CallSpec
167
- ) -> None: ...
168
-
169
- class HashableTupleArg(AbstractArg):
170
- """
171
- A tuple argument where all elements are hashable.
172
- """
173
-
174
- def __init__(self, *args: AbstractHashableArg) -> None: ...
175
-
176
- class HashableUnionArg(AbstractArg):
177
- """
178
- The object must match one of the types in args
179
- """
180
-
181
- def __init__(self, *args: AbstractHashableArg) -> None: ...
182
-
183
- class IntArg(AbstractHashableArg):
184
- """
185
- An int argument
186
- """
187
-
188
- def __init__(
189
- self,
190
- default: int = 0,
191
- min_value: int | None = None,
192
- max_value: int | None = None,
193
- ) -> None: ...
194
-
195
- class PositionalArgs(SequenceArg):
196
- """
197
- A sequence of arguments that should be unpacked into the container.
198
- This is useful when a CallableArg can take a variable number of an argument.
199
-
200
- """
201
-
202
- class SequenceArg(AbstractArg):
203
- """
204
-
205
- A sequence of other arguments.
206
- Each element must match element_type.
207
- length must be a positive integer for a fixed length or None for unbounded length.
208
-
209
- """
210
-
211
- def __init__(
212
- self,
213
- element_type: AbstractArg,
214
- default: typing.Sequence[AbstractArg] = tuple(),
215
- min_length: int | None = None,
216
- max_length: int | None = None,
217
- ) -> None: ...
218
-
219
- class StringArg(AbstractHashableArg):
220
- """
221
- A string argument
222
- """
223
-
224
- def __init__(self, default: str) -> None: ...
225
-
226
- class TupleArg(AbstractArg):
227
- """
228
- A tuple argument
229
- """
230
-
231
- def __init__(self, *args: AbstractArg) -> None: ...
232
-
233
- class TypedCallable(typing.Protocol):
234
- __non_callable_proto_members__: typing.ClassVar[set] = {"call_spec"}
235
- _is_runtime_protocol: typing.ClassVar[bool] = True
236
- @classmethod
237
- def __subclasshook__(cls, other): ...
238
- def __call__(self, *args: P.args, **kwargs: P.kwargs) -> R: ...
239
- def __init__(self, *args, **kwargs): ...
240
-
241
- class TypedMethod(typing.Protocol):
242
- __non_callable_proto_members__: typing.ClassVar[set] = {"call_spec"}
243
- _is_runtime_protocol: typing.ClassVar[bool] = True
244
- @staticmethod
245
- def __get__(*args, **kwds):
246
- """
247
- Helper for @overload to raise when called.
248
- """
249
-
250
- @classmethod
251
- def __subclasshook__(cls, other): ...
252
- def __call__(self, self_: typing.Any, *args: P.args, **kwargs: P.kwargs) -> R: ...
253
- def __init__(self, *args, **kwargs): ...
254
-
255
- class UnionArg(AbstractArg):
256
- """
257
- The object must match one of the types in args
258
- """
259
-
260
- def __init__(self, *args: AbstractArg) -> None: ...
261
-
262
- def callable_spec(
263
- *args: AbstractArg, **kwargs: AbstractArg
264
- ) -> typing.Callable[[typing.Callable[P, R]], TypedCallable[P, R]]: ...
265
- def method_spec(
266
- *args: AbstractArg, **kwargs: AbstractArg
267
- ) -> typing.Callable[
268
- [typing.Callable[Concatenate[typing.Any, P], R]], TypedMethod[P, R]
269
- ]: ...
270
-
271
- P: typing.ParamSpec # value = ~P
272
- R: typing.TypeVar # value = +R
amulet/utils/matrix.pyi DELETED
@@ -1,177 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import math as math
4
- import types
5
-
6
- import numpy as numpy
7
-
8
- __all__ = [
9
- "FloatTriplet",
10
- "PointCoordinates",
11
- "decompose_transformation_matrix",
12
- "displacement_matrix",
13
- "inverse_transform_matrix",
14
- "math",
15
- "numpy",
16
- "rotation_matrix_x",
17
- "rotation_matrix_xy",
18
- "rotation_matrix_xyz",
19
- "rotation_matrix_y",
20
- "rotation_matrix_yx",
21
- "rotation_matrix_z",
22
- "scale_matrix",
23
- "transform_matrix",
24
- ]
25
-
26
- def _rotation_matrix(*angles: float, order: str) -> numpy.ndarray:
27
- """
28
-
29
- Create a rotation matrix from the inputs specified
30
-
31
- :param angles: The angles in radians
32
- :param order: The order the angles are specified. Transforms will be applied in this order.
33
- :return: The 4x4 rotation matrix
34
-
35
- """
36
-
37
- def decompose_transformation_matrix(
38
- matrix: numpy.ndarray,
39
- ) -> typing.Tuple[
40
- typing.Tuple[float, float, float],
41
- typing.Tuple[float, float, float],
42
- typing.Tuple[float, float, float],
43
- ]:
44
- """
45
-
46
- Decompose a 4x4 transformation matrix into scale, rotation and displacement tuples.
47
-
48
- :param matrix: The matrix to decompose.
49
- :return: The scale, rotation and displacement.
50
-
51
- """
52
-
53
- def displacement_matrix(x: float, y: float, z: float) -> numpy.ndarray:
54
- """
55
-
56
- Create a displacement matrix from the inputs specified
57
-
58
- :param x: The displacement in the x axis
59
- :param y: The displacement in the y axis
60
- :param z: The displacement in the z axis
61
- :return: The 4x4 displacement matrix
62
-
63
- """
64
-
65
- def inverse_transform_matrix(
66
- scale: tuple[float, float, float],
67
- rotation: tuple[float, float, float],
68
- displacement: tuple[float, float, float],
69
- order: typing.Literal["xyz", "xzy", "yxz", "yzx", "zxy", "zyx"] = "xyz",
70
- ) -> numpy.ndarray:
71
- """
72
- Create the inverse of the 4x4 transformation matrix from the scale, rotation and displacement specified.
73
- This should be the inverse of transform_matrix
74
-
75
- :param scale: The scale in the x, y and z axis
76
- :param rotation: The rotation in the x, y and z axis (axis can be changed using `order`)
77
- :param displacement: The displacement in the x, y and z axis
78
- :param order: The order to apply the rotations in.
79
- :return: The 4x4 transformation matrix of combined scale, rotation and displacement
80
-
81
- """
82
-
83
- def rotation_matrix_x(rx: float) -> numpy.ndarray:
84
- """
85
-
86
- Create a rotation matrix in the x axis
87
-
88
- :param rx: The angle in radians
89
- :return: The 4x4 rotation matrix
90
-
91
- """
92
-
93
- def rotation_matrix_xy(rx: float, ry: float) -> numpy.ndarray:
94
- """
95
-
96
- Create a rotation matrix from the inputs specified
97
-
98
- :param rx: The rotation in radians in the x axis
99
- :param ry: The rotation in radians in the y axis
100
- :return: The 4x4 rotation matrix
101
-
102
- """
103
-
104
- def rotation_matrix_xyz(x: float, y: float, z: float) -> numpy.ndarray:
105
- """
106
-
107
- Create a rotation matrix from the inputs specified
108
-
109
- :param x: The rotation in radians in the x axis
110
- :param y: The rotation in radians in the y axis
111
- :param z: The rotation in radians in the z axis
112
- :return: The 4x4 rotation matrix
113
-
114
- """
115
-
116
- def rotation_matrix_y(ry: float) -> numpy.ndarray:
117
- """
118
-
119
- Create a rotation matrix in the x axis
120
-
121
- :param ry: The angle in radians
122
- :return: The 4x4 rotation matrix
123
-
124
- """
125
-
126
- def rotation_matrix_yx(ry: float, rx: float) -> numpy.ndarray:
127
- """
128
-
129
- Create a rotation matrix from the inputs specified
130
-
131
- :param rx: The rotation in radians in the x axis
132
- :param ry: The rotation in radians in the y axis
133
- :return: The 4x4 rotation matrix
134
-
135
- """
136
-
137
- def rotation_matrix_z(rz: float) -> numpy.ndarray:
138
- """
139
-
140
- Create a rotation matrix in the x axis
141
-
142
- :param rz: The angle in radians
143
- :return: The 4x4 rotation matrix
144
-
145
- """
146
-
147
- def scale_matrix(sx: float, sy: float, sz: float) -> numpy.ndarray:
148
- """
149
-
150
- Create a scale matrix from the inputs specified
151
-
152
- :param sx: The scale in the x axis
153
- :param sy: The scale in the y axis
154
- :param sz: The scale in the z axis
155
- :return: The 4x4 scale matrix
156
-
157
- """
158
-
159
- def transform_matrix(
160
- scale: tuple[float, float, float],
161
- rotation: tuple[float, float, float],
162
- displacement: tuple[float, float, float],
163
- order: typing.Literal["xyz", "xzy", "yxz", "yzx", "zxy", "zyx"] = "xyz",
164
- ) -> numpy.ndarray:
165
- """
166
- Create a 4x4 transformation matrix from the scale, rotation and displacement specified.
167
-
168
- :param scale: The scale in the x, y and z axis
169
- :param rotation: The rotation in the x, y and z axis in radians. (axis can be changed using `order`)
170
- :param displacement: The displacement in the x, y and z axis
171
- :param order: The order to apply the rotations in.
172
- :return: The 4x4 transformation matrix of combined scale, rotation and displacement
173
-
174
- """
175
-
176
- FloatTriplet: types.GenericAlias # value = tuple[float, float, float]
177
- PointCoordinates: types.GenericAlias # value = tuple[float, float, float]