amulet-core 2.0a8__cp311-cp311-win_amd64.whl → 2.0.1a2.post250529084738__cp311-cp311-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 (271) hide show
  1. amulet/core/__init__.py +36 -0
  2. amulet/core/__pyinstaller/hook-amulet.core.py +4 -0
  3. amulet/core/_amulet_core.cp311-win_amd64.pyd +0 -0
  4. amulet/core/_amulet_core.pyi +7 -0
  5. amulet/{_version.py → core/_version.py} +3 -3
  6. amulet/core/amulet_core.dll +0 -0
  7. amulet/core/amulet_core.lib +0 -0
  8. amulet/core/amulet_coreConfig.cmake +18 -0
  9. amulet/{biome.pyi → core/biome/__init__.pyi} +3 -3
  10. amulet/core/biome/biome.hpp +53 -0
  11. amulet/{block.pyi → core/block/__init__.pyi} +25 -26
  12. amulet/core/block/block.hpp +156 -0
  13. amulet/{block_entity.pyi → core/block_entity/__init__.pyi} +7 -7
  14. amulet/core/block_entity/block_entity.hpp +84 -0
  15. amulet/{errors.py → core/chunk/__init__.pyi} +37 -33
  16. amulet/core/chunk/chunk.hpp +126 -0
  17. amulet/core/chunk/component/__init__.pyi +18 -0
  18. amulet/core/chunk/component/biome_3d_component.hpp +96 -0
  19. amulet/core/chunk/component/block_component.hpp +101 -0
  20. amulet/core/chunk/component/block_component.pyi +28 -0
  21. amulet/core/chunk/component/block_entity_component.hpp +119 -0
  22. amulet/core/chunk/component/section_array_map.hpp +129 -0
  23. amulet/{chunk_components.pyi → core/chunk/component/section_array_map.pyi} +4 -24
  24. amulet/core/dll.hpp +21 -0
  25. amulet/core/entity/__init__.pyi +105 -0
  26. amulet/core/entity/entity.hpp +100 -0
  27. amulet/{palette → core/palette}/__init__.pyi +2 -2
  28. amulet/core/palette/biome_palette.hpp +65 -0
  29. amulet/{palette → core/palette}/biome_palette.pyi +8 -8
  30. amulet/core/palette/block_palette.hpp +71 -0
  31. amulet/{palette → core/palette}/block_palette.pyi +12 -10
  32. amulet/core/selection/__init__.pyi +8 -0
  33. amulet/core/selection/box.hpp +86 -0
  34. amulet/core/selection/box.pyi +215 -0
  35. amulet/core/selection/group.hpp +80 -0
  36. amulet/core/selection/group.pyi +213 -0
  37. amulet/{version.pyi → core/version/__init__.pyi} +58 -10
  38. amulet/core/version/version.hpp +204 -0
  39. {amulet_core-2.0a8.dist-info → amulet_core-2.0.1a2.post250529084738.dist-info}/METADATA +25 -20
  40. amulet_core-2.0.1a2.post250529084738.dist-info/RECORD +45 -0
  41. {amulet_core-2.0a8.dist-info → amulet_core-2.0.1a2.post250529084738.dist-info}/WHEEL +1 -1
  42. amulet_core-2.0.1a2.post250529084738.dist-info/entry_points.txt +2 -0
  43. amulet/__init__.cp311-win_amd64.pyd +0 -0
  44. amulet/__init__.py.cpp +0 -45
  45. amulet/__init__.pyi +0 -30
  46. amulet/__pyinstaller/hook-amulet.py +0 -4
  47. amulet/_init.py +0 -26
  48. amulet/biome.cpp +0 -36
  49. amulet/biome.hpp +0 -43
  50. amulet/biome.py.cpp +0 -122
  51. amulet/block.cpp +0 -435
  52. amulet/block.hpp +0 -119
  53. amulet/block.py.cpp +0 -377
  54. amulet/block_entity.cpp +0 -12
  55. amulet/block_entity.hpp +0 -56
  56. amulet/block_entity.py.cpp +0 -115
  57. amulet/chunk.cpp +0 -16
  58. amulet/chunk.hpp +0 -100
  59. amulet/chunk.py.cpp +0 -80
  60. amulet/chunk.pyi +0 -28
  61. amulet/chunk_components/biome_3d_component.cpp +0 -5
  62. amulet/chunk_components/biome_3d_component.hpp +0 -79
  63. amulet/chunk_components/block_component.cpp +0 -41
  64. amulet/chunk_components/block_component.hpp +0 -88
  65. amulet/chunk_components/block_entity_component.cpp +0 -5
  66. amulet/chunk_components/block_entity_component.hpp +0 -147
  67. amulet/chunk_components/section_array_map.cpp +0 -129
  68. amulet/chunk_components/section_array_map.hpp +0 -147
  69. amulet/collections/eq.py.hpp +0 -37
  70. amulet/collections/hash.py.hpp +0 -27
  71. amulet/collections/holder.py.hpp +0 -37
  72. amulet/collections/iterator.py.hpp +0 -80
  73. amulet/collections/mapping.py.hpp +0 -199
  74. amulet/collections/mutable_mapping.py.hpp +0 -226
  75. amulet/collections/sequence.py.hpp +0 -163
  76. amulet/collections.pyi +0 -40
  77. amulet/data_types.py +0 -29
  78. amulet/entity.py +0 -182
  79. amulet/game/__init__.py +0 -7
  80. amulet/game/_game.py +0 -152
  81. amulet/game/_universal/__init__.py +0 -1
  82. amulet/game/_universal/_biome.py +0 -17
  83. amulet/game/_universal/_block.py +0 -47
  84. amulet/game/_universal/_version.py +0 -68
  85. amulet/game/abc/__init__.py +0 -22
  86. amulet/game/abc/_block_specification.py +0 -150
  87. amulet/game/abc/biome.py +0 -213
  88. amulet/game/abc/block.py +0 -331
  89. amulet/game/abc/game_version_container.py +0 -25
  90. amulet/game/abc/json_interface.py +0 -27
  91. amulet/game/abc/version.py +0 -44
  92. amulet/game/bedrock/__init__.py +0 -1
  93. amulet/game/bedrock/_biome.py +0 -35
  94. amulet/game/bedrock/_block.py +0 -42
  95. amulet/game/bedrock/_version.py +0 -165
  96. amulet/game/java/__init__.py +0 -2
  97. amulet/game/java/_biome.py +0 -35
  98. amulet/game/java/_block.py +0 -60
  99. amulet/game/java/_version.py +0 -176
  100. amulet/game/translate/__init__.py +0 -12
  101. amulet/game/translate/_functions/__init__.py +0 -15
  102. amulet/game/translate/_functions/_code_functions/__init__.py +0 -0
  103. amulet/game/translate/_functions/_code_functions/_text.py +0 -553
  104. amulet/game/translate/_functions/_code_functions/banner_pattern.py +0 -67
  105. amulet/game/translate/_functions/_code_functions/bedrock_chest_connection.py +0 -152
  106. amulet/game/translate/_functions/_code_functions/bedrock_moving_block_pos.py +0 -88
  107. amulet/game/translate/_functions/_code_functions/bedrock_sign.py +0 -152
  108. amulet/game/translate/_functions/_code_functions/bedrock_skull_rotation.py +0 -16
  109. amulet/game/translate/_functions/_code_functions/custom_name.py +0 -146
  110. amulet/game/translate/_functions/_frozen.py +0 -66
  111. amulet/game/translate/_functions/_state.py +0 -54
  112. amulet/game/translate/_functions/_typing.py +0 -98
  113. amulet/game/translate/_functions/abc.py +0 -123
  114. amulet/game/translate/_functions/carry_nbt.py +0 -160
  115. amulet/game/translate/_functions/carry_properties.py +0 -80
  116. amulet/game/translate/_functions/code.py +0 -143
  117. amulet/game/translate/_functions/map_block_name.py +0 -66
  118. amulet/game/translate/_functions/map_nbt.py +0 -111
  119. amulet/game/translate/_functions/map_properties.py +0 -93
  120. amulet/game/translate/_functions/multiblock.py +0 -112
  121. amulet/game/translate/_functions/new_block.py +0 -42
  122. amulet/game/translate/_functions/new_entity.py +0 -43
  123. amulet/game/translate/_functions/new_nbt.py +0 -206
  124. amulet/game/translate/_functions/new_properties.py +0 -64
  125. amulet/game/translate/_functions/sequence.py +0 -51
  126. amulet/game/translate/_functions/walk_input_nbt.py +0 -331
  127. amulet/game/translate/_translator.py +0 -433
  128. amulet/img/__init__.py +0 -10
  129. amulet/img/missing_no.png +0 -0
  130. amulet/img/missing_pack.png +0 -0
  131. amulet/img/missing_world.png +0 -0
  132. amulet/io/binary_reader.hpp +0 -45
  133. amulet/io/binary_writer.hpp +0 -30
  134. amulet/item.py +0 -75
  135. amulet/level/__init__.pyi +0 -23
  136. amulet/level/_load.py +0 -100
  137. amulet/level/abc/__init__.py +0 -12
  138. amulet/level/abc/_chunk_handle.py +0 -358
  139. amulet/level/abc/_dimension.py +0 -86
  140. amulet/level/abc/_history/__init__.py +0 -1
  141. amulet/level/abc/_history/_cache.py +0 -224
  142. amulet/level/abc/_history/_history_manager.py +0 -291
  143. amulet/level/abc/_level/__init__.py +0 -5
  144. amulet/level/abc/_level/_compactable_level.py +0 -10
  145. amulet/level/abc/_level/_creatable_level.py +0 -28
  146. amulet/level/abc/_level/_disk_level.py +0 -17
  147. amulet/level/abc/_level/_level.py +0 -449
  148. amulet/level/abc/_level/_loadable_level.py +0 -42
  149. amulet/level/abc/_player_storage.py +0 -7
  150. amulet/level/abc/_raw_level.py +0 -187
  151. amulet/level/abc/_registry.py +0 -40
  152. amulet/level/java/__init__.pyi +0 -16
  153. amulet/level/java/_chunk_handle.py +0 -17
  154. amulet/level/java/_dimension.py +0 -20
  155. amulet/level/java/_level.py +0 -184
  156. amulet/level/java/_raw/__init__.pyi +0 -15
  157. amulet/level/java/_raw/_chunk.pyi +0 -23
  158. amulet/level/java/_raw/_constant.py +0 -9
  159. amulet/level/java/_raw/_data_pack/__init__.py +0 -2
  160. amulet/level/java/_raw/_data_pack/data_pack.py +0 -241
  161. amulet/level/java/_raw/_data_pack/data_pack_manager.py +0 -77
  162. amulet/level/java/_raw/_dimension.py +0 -86
  163. amulet/level/java/_raw/_level.py +0 -507
  164. amulet/level/java/_raw/_typing.py +0 -3
  165. amulet/level/java/_raw/java_chunk_decode.cpp +0 -531
  166. amulet/level/java/_raw/java_chunk_decode.hpp +0 -23
  167. amulet/level/java/_raw/java_chunk_encode.cpp +0 -25
  168. amulet/level/java/_raw/java_chunk_encode.hpp +0 -23
  169. amulet/level/java/anvil/__init__.py +0 -2
  170. amulet/level/java/anvil/_dimension.py +0 -170
  171. amulet/level/java/anvil/_region.py +0 -421
  172. amulet/level/java/anvil/_sector_manager.py +0 -223
  173. amulet/level/java/chunk.pyi +0 -81
  174. amulet/level/java/chunk_/_chunk.py +0 -260
  175. amulet/level/java/chunk_/components/inhabited_time.py +0 -12
  176. amulet/level/java/chunk_/components/last_update.py +0 -12
  177. amulet/level/java/chunk_/components/legacy_version.py +0 -12
  178. amulet/level/java/chunk_/components/light_populated.py +0 -12
  179. amulet/level/java/chunk_/components/named_height_2d.py +0 -37
  180. amulet/level/java/chunk_/components/status.py +0 -11
  181. amulet/level/java/chunk_/components/terrain_populated.py +0 -12
  182. amulet/level/java/chunk_components/data_version_component.cpp +0 -32
  183. amulet/level/java/chunk_components/data_version_component.hpp +0 -31
  184. amulet/level/java/chunk_components/java_raw_chunk_component.cpp +0 -56
  185. amulet/level/java/chunk_components/java_raw_chunk_component.hpp +0 -45
  186. amulet/level/java/chunk_components.pyi +0 -22
  187. amulet/level/java/java_chunk.cpp +0 -170
  188. amulet/level/java/java_chunk.hpp +0 -141
  189. amulet/level/java/long_array.hpp +0 -175
  190. amulet/level/java/long_array.pyi +0 -39
  191. amulet/level/temporary_level/__init__.py +0 -1
  192. amulet/level/temporary_level/_level.py +0 -16
  193. amulet/mesh/__init__.py +0 -0
  194. amulet/mesh/block/__init__.pyi +0 -301
  195. amulet/mesh/block/_cube.py +0 -198
  196. amulet/mesh/block/_missing_block.py +0 -20
  197. amulet/mesh/block/block_mesh.cpp +0 -107
  198. amulet/mesh/block/block_mesh.hpp +0 -207
  199. amulet/mesh/util.py +0 -17
  200. amulet/palette/biome_palette.hpp +0 -85
  201. amulet/palette/block_palette.cpp +0 -32
  202. amulet/palette/block_palette.hpp +0 -93
  203. amulet/player.py +0 -62
  204. amulet/pybind11/collections.hpp +0 -118
  205. amulet/pybind11/numpy.hpp +0 -26
  206. amulet/pybind11/py_module.hpp +0 -34
  207. amulet/pybind11/type_hints.hpp +0 -51
  208. amulet/pybind11/types.hpp +0 -25
  209. amulet/pybind11/typing.hpp +0 -7
  210. amulet/resource_pack/__init__.py +0 -63
  211. amulet/resource_pack/abc/__init__.py +0 -2
  212. amulet/resource_pack/abc/resource_pack.py +0 -38
  213. amulet/resource_pack/abc/resource_pack_manager.py +0 -85
  214. amulet/resource_pack/java/__init__.py +0 -2
  215. amulet/resource_pack/java/download_resources.py +0 -212
  216. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_black.png +0 -0
  217. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_blue.png +0 -0
  218. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_brown.png +0 -0
  219. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_cyan.png +0 -0
  220. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_gray.png +0 -0
  221. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_green.png +0 -0
  222. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_light_blue.png +0 -0
  223. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_light_gray.png +0 -0
  224. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_lime.png +0 -0
  225. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_magenta.png +0 -0
  226. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_orange.png +0 -0
  227. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_pink.png +0 -0
  228. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_purple.png +0 -0
  229. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_red.png +0 -0
  230. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_white.png +0 -0
  231. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_yellow.png +0 -0
  232. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/barrier.png +0 -0
  233. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/end_portal.png +0 -0
  234. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/grass.png +0 -0
  235. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/lava.png +0 -0
  236. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/structure_void.png +0 -0
  237. amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/water.png +0 -0
  238. amulet/resource_pack/java/java_vanilla_fix/pack.png +0 -0
  239. amulet/resource_pack/java/resource_pack.py +0 -44
  240. amulet/resource_pack/java/resource_pack_manager.py +0 -563
  241. amulet/resource_pack/unknown_resource_pack.py +0 -10
  242. amulet/selection/__init__.py +0 -2
  243. amulet/selection/abstract_selection.py +0 -342
  244. amulet/selection/box.py +0 -852
  245. amulet/selection/group.py +0 -481
  246. amulet/utils/__init__.pyi +0 -23
  247. amulet/utils/call_spec/__init__.py +0 -24
  248. amulet/utils/call_spec/_call_spec.py +0 -257
  249. amulet/utils/cast.py +0 -10
  250. amulet/utils/comment_json.py +0 -188
  251. amulet/utils/format_utils.py +0 -41
  252. amulet/utils/generator.py +0 -18
  253. amulet/utils/matrix.py +0 -243
  254. amulet/utils/numpy.hpp +0 -36
  255. amulet/utils/numpy.pyi +0 -11
  256. amulet/utils/numpy_helpers.py +0 -19
  257. amulet/utils/shareable_lock.py +0 -335
  258. amulet/utils/signal/__init__.py +0 -10
  259. amulet/utils/signal/_signal.py +0 -228
  260. amulet/utils/task_manager.py +0 -235
  261. amulet/utils/typed_property.py +0 -111
  262. amulet/utils/weakref.py +0 -70
  263. amulet/utils/world_utils.py +0 -102
  264. amulet/version.cpp +0 -136
  265. amulet/version.hpp +0 -142
  266. amulet/version.py.cpp +0 -281
  267. amulet_core-2.0a8.dist-info/RECORD +0 -241
  268. amulet_core-2.0a8.dist-info/entry_points.txt +0 -2
  269. /amulet/{__pyinstaller → core/__pyinstaller}/__init__.py +0 -0
  270. /amulet/{py.typed → core/py.typed} +0 -0
  271. {amulet_core-2.0a8.dist-info → amulet_core-2.0.1a2.post250529084738.dist-info}/top_level.txt +0 -0
@@ -1,342 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from abc import ABC, abstractmethod
4
- from typing import Iterable, Iterator, TYPE_CHECKING, Any
5
- import numpy
6
-
7
- from amulet.data_types import (
8
- ChunkCoordinates,
9
- SubChunkCoordinates,
10
- FloatTriplet,
11
- BlockCoordinates,
12
- )
13
-
14
- if TYPE_CHECKING:
15
- from .box import SelectionBox
16
- from .group import SelectionGroup
17
-
18
-
19
- class AbstractBaseSelection(ABC):
20
- """
21
- A parent selection class to force a consistent API for selection group and box.
22
- """
23
-
24
- __slots__ = ()
25
-
26
- @abstractmethod
27
- def __eq__(self, other: Any) -> bool:
28
- """
29
- Is the selection equal to the other selection.
30
-
31
- >>> selection1: AbstractBaseSelection
32
- >>> selection2: AbstractBaseSelection
33
- >>> selection1 == selection2
34
- True
35
-
36
- :param other: The other selection to test.
37
- :return: True if the selections are the same, False otherwise.
38
- """
39
- raise NotImplementedError
40
-
41
- @abstractmethod
42
- def __repr__(self) -> str:
43
- raise NotImplementedError
44
-
45
- @abstractmethod
46
- def __str__(self) -> str:
47
- raise NotImplementedError
48
-
49
- @property
50
- @abstractmethod
51
- def blocks(self) -> Iterator[BlockCoordinates]:
52
- """
53
- The location of every block in the selection.
54
-
55
- :return: An Iterator of block locations.
56
- """
57
- raise NotImplementedError
58
-
59
- @property
60
- @abstractmethod
61
- def bounds(self) -> tuple[BlockCoordinates, BlockCoordinates]:
62
- """
63
- The minimum and maximum points in the selection.
64
- """
65
- raise NotImplementedError
66
-
67
- @property
68
- @abstractmethod
69
- def bounds_array(self) -> numpy.ndarray:
70
- """
71
- The minimum and maximum points in the selection as a numpy array.
72
- """
73
- raise NotImplementedError
74
-
75
- @abstractmethod
76
- def bounding_box(self) -> SelectionBox:
77
- """Get a SelectionBox that contains this selection."""
78
- raise NotImplementedError
79
-
80
- @abstractmethod
81
- def selection_group(self) -> SelectionGroup:
82
- """Get this selection as a SelectionGroup."""
83
- raise NotImplementedError
84
-
85
- @abstractmethod
86
- def chunk_boxes(
87
- self, sub_chunk_size: int = 16
88
- ) -> Iterator[tuple[ChunkCoordinates, SelectionBox]]:
89
- """
90
- An Iterator of chunk coordinates and boxes that intersect the selection and the chunk.
91
-
92
- >>> selection1: AbstractBaseSelection
93
- >>> for (cx, cz), box in selection1.chunk_boxes():
94
- >>> ...
95
-
96
- :param sub_chunk_size: The dimension of a sub-chunk. Default 16.
97
- """
98
- raise NotImplementedError
99
-
100
- @abstractmethod
101
- def chunk_count(self, sub_chunk_size: int = 16) -> int:
102
- """
103
- The number of chunks that intersect the selection.
104
-
105
- :param sub_chunk_size: The dimension of a sub-chunk. Default 16.
106
- """
107
- raise NotImplementedError
108
-
109
- @abstractmethod
110
- def chunk_locations(self, sub_chunk_size: int = 16) -> Iterable[ChunkCoordinates]:
111
- """
112
- An iterable of chunk coordinates that intersect the selection.
113
-
114
- >>> selection1: AbstractBaseSelection
115
- >>> for cx, cz in selection1.chunk_locations():
116
- >>> ...
117
-
118
- :param sub_chunk_size: The dimension of a sub-chunk. Default 16.
119
- """
120
- raise NotImplementedError
121
-
122
- @abstractmethod
123
- def contains_block(self, x: int, y: int, z: int) -> bool:
124
- """
125
- Is the block contained within the selection.
126
-
127
- >>> selection1: AbstractBaseSelection
128
- >>> (1, 2, 3) in selection1
129
- True
130
-
131
- :param x: The x coordinate of the block. Defined by the most negative corner.
132
- :param y: The y coordinate of the block. Defined by the most negative corner.
133
- :param z: The z coordinate of the block. Defined by the most negative corner.
134
- :return: True if the block is in the selection.
135
- """
136
- raise NotImplementedError
137
-
138
- @abstractmethod
139
- def contains_point(self, x: float, y: float, z: float) -> bool:
140
- """
141
- Is the point contained within the selection.
142
-
143
- >>> selection1: AbstractBaseSelection
144
- >>> (1.5, 2.5, 3.5) in selection1
145
- True
146
-
147
- :param x: The x coordinate of the point.
148
- :param y: The y coordinate of the point.
149
- :param z: The z coordinate of the point.
150
- :return: True if the point is in the selection.
151
- """
152
- raise NotImplementedError
153
-
154
- def intersection(self, other: AbstractBaseSelection) -> AbstractBaseSelection:
155
- """
156
- Create and return a new a selection containing the volume that this selection and other both contain.
157
-
158
- If the selections do not intersect the returned selection will have no volume.
159
-
160
- Use :meth:`intersects` to test if the two selections intersect.
161
-
162
- :param other: The other selection.
163
- :return: A new selection containing the intersection.
164
- """
165
- out = self._intersection(other)
166
- if out is NotImplemented:
167
- out = other._intersection(self)
168
- if out is NotImplemented:
169
- raise TypeError(
170
- f"intersection is not supported between instances of type {self.__class__} and {other.__class__}"
171
- )
172
- return out
173
-
174
- @abstractmethod
175
- def _intersection(self, other: AbstractBaseSelection) -> AbstractBaseSelection:
176
- """Get the intersection between self and other.
177
-
178
- :param other: The other selection
179
- :return: The selection that intersects. NotImplemented if the operation is not supported.
180
- """
181
-
182
- def intersects(self, other: AbstractBaseSelection) -> bool:
183
- """
184
- Does this selection intersect ``other``.
185
-
186
- :param other: The other selection.
187
- :return: True if the selections intersect, False otherwise.
188
- """
189
- out = self._intersects(other)
190
- if out is NotImplemented:
191
- out = other._intersects(self)
192
- if out is NotImplemented:
193
- raise TypeError(
194
- f"intersects is not supported between instances of type {self.__class__} and {other.__class__}"
195
- )
196
- return out
197
-
198
- @abstractmethod
199
- def _intersects(self, other: AbstractBaseSelection) -> bool:
200
- """Check if other intersects this instance.
201
-
202
- :param other: The other selection to test
203
- :return: True if intersects, False if not intersects and NotImplemented if the operation is not supported.
204
- """
205
- raise NotImplementedError
206
-
207
- @property
208
- @abstractmethod
209
- def max(self) -> BlockCoordinates:
210
- """
211
- The maximum point in the selection.
212
- """
213
- raise NotImplementedError
214
-
215
- @property
216
- @abstractmethod
217
- def max_array(self) -> numpy.ndarray:
218
- """
219
- The maximum point in the selection as a numpy array.
220
- """
221
- raise NotImplementedError
222
-
223
- @property
224
- @abstractmethod
225
- def max_x(self) -> int:
226
- """
227
- The maximum x coordinate of the selection.
228
- """
229
- raise NotImplementedError
230
-
231
- @property
232
- @abstractmethod
233
- def max_y(self) -> int:
234
- """
235
- The maximum y coordinate of the selection.
236
- """
237
- raise NotImplementedError
238
-
239
- @property
240
- @abstractmethod
241
- def max_z(self) -> int:
242
- """
243
- The maximum z coordinate of the selection.
244
- """
245
- raise NotImplementedError
246
-
247
- @property
248
- @abstractmethod
249
- def min(self) -> BlockCoordinates:
250
- """
251
- The minimum point in the selection.
252
- """
253
- raise NotImplementedError
254
-
255
- @property
256
- @abstractmethod
257
- def min_array(self) -> numpy.ndarray:
258
- """
259
- The minimum point in the selection as a numpy array.
260
- """
261
- raise NotImplementedError
262
-
263
- @property
264
- @abstractmethod
265
- def min_x(self) -> int:
266
- """
267
- The minimum x coordinate of the selection.
268
- """
269
- raise NotImplementedError
270
-
271
- @property
272
- @abstractmethod
273
- def min_y(self) -> int:
274
- """
275
- The minimum y coordinate of the selection.
276
- """
277
- raise NotImplementedError
278
-
279
- @property
280
- @abstractmethod
281
- def min_z(self) -> int:
282
- """
283
- The minimum z coordinate of the selection.
284
- """
285
- raise NotImplementedError
286
-
287
- @abstractmethod
288
- def sub_chunk_boxes(
289
- self, sub_chunk_size: int = 16
290
- ) -> Iterator[tuple[SubChunkCoordinates, SelectionBox]]:
291
- """
292
- An Iterator of sub-chunk coordinates and boxes that intersect the selection and the sub-chunk.
293
-
294
- >>> selection1: AbstractBaseSelection
295
- >>> for (cx, cy, cz), box in selection1.sub_chunk_boxes():
296
- >>> ...
297
-
298
- :param sub_chunk_size: The dimension of a sub-chunk. Default 16.
299
- """
300
- raise NotImplementedError
301
-
302
- @abstractmethod
303
- def sub_chunk_count(self, sub_chunk_size: int = 16) -> int:
304
- """
305
- The number of sub-chunks that intersect the selection.
306
-
307
- :param sub_chunk_size: The dimension of a sub-chunk. Default 16.
308
- """
309
- raise NotImplementedError
310
-
311
- @abstractmethod
312
- def sub_chunk_locations(
313
- self, sub_chunk_size: int = 16
314
- ) -> Iterable[SubChunkCoordinates]:
315
- """
316
- An iterable of sub-chunk coordinates that intersect the selection.
317
-
318
- >>> selection1: AbstractBaseSelection
319
- >>> for cx, cy, cz in selection1.sub_chunk_locations():
320
- >>> ...
321
-
322
- :param sub_chunk_size: The dimension of a sub-chunk. Default 16.
323
- """
324
- raise NotImplementedError
325
-
326
- @abstractmethod
327
- def subtract(self, other: AbstractBaseSelection) -> AbstractBaseSelection:
328
- raise NotImplementedError
329
-
330
- @abstractmethod
331
- def transform(
332
- self, scale: FloatTriplet, rotation: FloatTriplet, translation: FloatTriplet
333
- ) -> AbstractBaseSelection:
334
- raise NotImplementedError
335
-
336
- @property
337
- @abstractmethod
338
- def volume(self) -> int:
339
- """
340
- The number of blocks in the selection.
341
- """
342
- raise NotImplementedError