amulet-core 2.0a6__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.
- amulet/__init__.cp312-win_amd64.pyd +0 -0
- amulet/__init__.py.cpp +4 -0
- amulet/__init__.pyi +0 -2
- amulet/_init.py +0 -2
- amulet/_version.py +3 -3
- amulet/biome.pyi +0 -2
- amulet/block.pyi +0 -2
- amulet/block_entity.pyi +0 -2
- amulet/chunk.pyi +0 -2
- amulet/chunk_components.pyi +20 -18
- amulet/collections/eq.py.hpp +1 -1
- amulet/collections/mapping.py.hpp +18 -11
- amulet/collections/mutable_mapping.py.hpp +17 -6
- amulet/collections/sequence.py.hpp +5 -6
- amulet/collections.pyi +8 -5
- amulet/entity.py +22 -20
- amulet/game/translate/_functions/_code_functions/_text.py +2 -2
- amulet/game/translate/_functions/abc.py +10 -3
- amulet/img/__init__.py +10 -0
- amulet/img/missing_no.png +0 -0
- amulet/img/missing_pack.png +0 -0
- amulet/level/__init__.pyi +2 -6
- amulet/level/abc/_level/_creatable_level.py +1 -2
- amulet/level/abc/_level/_level.py +1 -5
- amulet/level/java/__init__.pyi +0 -5
- amulet/level/java/_raw/__init__.pyi +0 -4
- amulet/level/java/_raw/java_chunk_decode.cpp +2 -4
- amulet/level/java/long_array.pyi +2 -1
- amulet/mesh/block/__init__.py +1 -0
- amulet/mesh/block/block_mesh.py +369 -0
- amulet/mesh/block/cube.py +149 -0
- amulet/mesh/block/missing_block.py +20 -0
- amulet/mesh/util.py +17 -0
- amulet/player.py +4 -6
- amulet/pybind11/collections.hpp +80 -38
- amulet/pybind11/numpy.hpp +26 -0
- amulet/pybind11/py_module.hpp +16 -51
- amulet/pybind11/type_hints.hpp +51 -0
- amulet/pybind11/types.hpp +14 -6
- amulet/pybind11/typing.hpp +7 -0
- amulet/resource_pack/__init__.py +62 -0
- amulet/resource_pack/abc/__init__.py +2 -0
- amulet/resource_pack/abc/resource_pack.py +38 -0
- amulet/resource_pack/abc/resource_pack_manager.py +87 -0
- amulet/resource_pack/bedrock/__init__.py +2 -0
- amulet/resource_pack/bedrock/bedrock_vanilla_fix/pack_icon.png +0 -0
- amulet/resource_pack/bedrock/bedrock_vanilla_fix/textures/blocks/grass_carried.png +0 -0
- amulet/resource_pack/bedrock/bedrock_vanilla_fix/textures/blocks/grass_side_carried.png +0 -0
- amulet/resource_pack/bedrock/bedrock_vanilla_fix/textures/blocks/water.png +0 -0
- amulet/resource_pack/bedrock/blockshapes/__init__.py +31 -0
- amulet/resource_pack/bedrock/blockshapes/air.py +35 -0
- amulet/resource_pack/bedrock/blockshapes/base_blockshape.py +29 -0
- amulet/resource_pack/bedrock/blockshapes/bubble_column.py +29 -0
- amulet/resource_pack/bedrock/blockshapes/cake.py +46 -0
- amulet/resource_pack/bedrock/blockshapes/chest.py +54 -0
- amulet/resource_pack/bedrock/blockshapes/comparator.py +51 -0
- amulet/resource_pack/bedrock/blockshapes/cross_texture.py +186 -0
- amulet/resource_pack/bedrock/blockshapes/cross_texture0.py +17 -0
- amulet/resource_pack/bedrock/blockshapes/cross_texture_green.py +16 -0
- amulet/resource_pack/bedrock/blockshapes/cube.py +38 -0
- amulet/resource_pack/bedrock/blockshapes/default.py +14 -0
- amulet/resource_pack/bedrock/blockshapes/door.py +38 -0
- amulet/resource_pack/bedrock/blockshapes/door1.py +14 -0
- amulet/resource_pack/bedrock/blockshapes/door2.py +14 -0
- amulet/resource_pack/bedrock/blockshapes/door3.py +14 -0
- amulet/resource_pack/bedrock/blockshapes/door4.py +14 -0
- amulet/resource_pack/bedrock/blockshapes/door5.py +14 -0
- amulet/resource_pack/bedrock/blockshapes/door6.py +14 -0
- amulet/resource_pack/bedrock/blockshapes/double_plant.py +40 -0
- amulet/resource_pack/bedrock/blockshapes/enchanting_table.py +22 -0
- amulet/resource_pack/bedrock/blockshapes/farmland.py +22 -0
- amulet/resource_pack/bedrock/blockshapes/fence.py +22 -0
- amulet/resource_pack/bedrock/blockshapes/flat.py +55 -0
- amulet/resource_pack/bedrock/blockshapes/flat_wall.py +55 -0
- amulet/resource_pack/bedrock/blockshapes/furnace.py +44 -0
- amulet/resource_pack/bedrock/blockshapes/furnace_lit.py +14 -0
- amulet/resource_pack/bedrock/blockshapes/green_cube.py +39 -0
- amulet/resource_pack/bedrock/blockshapes/ladder.py +36 -0
- amulet/resource_pack/bedrock/blockshapes/lilypad.py +14 -0
- amulet/resource_pack/bedrock/blockshapes/partial_block.py +57 -0
- amulet/resource_pack/bedrock/blockshapes/piston.py +44 -0
- amulet/resource_pack/bedrock/blockshapes/piston_arm.py +72 -0
- amulet/resource_pack/bedrock/blockshapes/portal_frame.py +22 -0
- amulet/resource_pack/bedrock/blockshapes/pressure_plate.py +29 -0
- amulet/resource_pack/bedrock/blockshapes/pumpkin.py +36 -0
- amulet/resource_pack/bedrock/blockshapes/pumpkin_carved.py +14 -0
- amulet/resource_pack/bedrock/blockshapes/pumpkin_lit.py +14 -0
- amulet/resource_pack/bedrock/blockshapes/red_dust.py +14 -0
- amulet/resource_pack/bedrock/blockshapes/repeater.py +53 -0
- amulet/resource_pack/bedrock/blockshapes/slab.py +33 -0
- amulet/resource_pack/bedrock/blockshapes/slab_double.py +15 -0
- amulet/resource_pack/bedrock/blockshapes/tree.py +41 -0
- amulet/resource_pack/bedrock/blockshapes/turtle_egg.py +15 -0
- amulet/resource_pack/bedrock/blockshapes/vine.py +52 -0
- amulet/resource_pack/bedrock/blockshapes/wall.py +22 -0
- amulet/resource_pack/bedrock/blockshapes/water.py +38 -0
- amulet/resource_pack/bedrock/download_resources.py +147 -0
- amulet/resource_pack/bedrock/resource_pack.py +40 -0
- amulet/resource_pack/bedrock/resource_pack_manager.py +361 -0
- amulet/resource_pack/bedrock/sort_blockshapes.py +15 -0
- amulet/resource_pack/java/__init__.py +2 -0
- amulet/resource_pack/java/download_resources.py +212 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_black.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_blue.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_brown.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_cyan.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_gray.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_green.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_light_blue.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_light_gray.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_lime.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_magenta.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_orange.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_pink.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_purple.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_red.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_white.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/banner/banner_yellow.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/barrier.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/end_portal.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/grass.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/lava.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/structure_void.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/assets/minecraft/textures/block/water.png +0 -0
- amulet/resource_pack/java/java_vanilla_fix/pack.png +0 -0
- amulet/resource_pack/java/resource_pack.py +44 -0
- amulet/resource_pack/java/resource_pack_manager.py +551 -0
- amulet/resource_pack/unknown_resource_pack.py +10 -0
- amulet/utils/__init__.pyi +0 -5
- amulet/utils/call_spec/_call_spec.py +2 -7
- amulet/utils/comment_json.py +188 -0
- amulet/utils/matrix.py +3 -3
- amulet/utils/numpy_helpers.py +2 -2
- amulet/utils/world_utils.py +2 -2
- amulet/version.pyi +0 -8
- {amulet_core-2.0a6.dist-info → amulet_core-2.0a7.dist-info}/METADATA +2 -2
- amulet_core-2.0a7.dist-info/RECORD +295 -0
- amulet/chunk_/components/biome.py +0 -155
- amulet/chunk_/components/block_entity.py +0 -117
- amulet/chunk_/components/entity.py +0 -64
- amulet/chunk_/components/height_2d.py +0 -16
- amulet/level/bedrock/__init__.py +0 -2
- amulet/level/bedrock/_chunk_handle.py +0 -19
- amulet/level/bedrock/_dimension.py +0 -22
- amulet/level/bedrock/_level.py +0 -187
- amulet/level/bedrock/_raw/__init__.py +0 -5
- amulet/level/bedrock/_raw/_actor_counter.py +0 -53
- amulet/level/bedrock/_raw/_chunk.py +0 -54
- amulet/level/bedrock/_raw/_chunk_decode.py +0 -668
- amulet/level/bedrock/_raw/_chunk_encode.py +0 -602
- amulet/level/bedrock/_raw/_constant.py +0 -9
- amulet/level/bedrock/_raw/_dimension.py +0 -343
- amulet/level/bedrock/_raw/_level.py +0 -463
- amulet/level/bedrock/_raw/_level_dat.py +0 -90
- amulet/level/bedrock/_raw/_typing.py +0 -6
- amulet/level/bedrock/_raw/leveldb_chunk_versions.py +0 -83
- amulet/level/bedrock/chunk/__init__.py +0 -1
- amulet/level/bedrock/chunk/_chunk.py +0 -126
- amulet/level/bedrock/chunk/components/chunk_version.py +0 -12
- amulet/level/bedrock/chunk/components/finalised_state.py +0 -13
- amulet/level/bedrock/chunk/components/raw_chunk.py +0 -15
- amulet/level/construction/__init__.py +0 -0
- amulet/level/java/_chunk_handle.pyi +0 -15
- amulet/level/java/_dimension.pyi +0 -13
- amulet/level/java/_level.pyi +0 -120
- amulet/level/java/_raw/_chunk_decode.py +0 -561
- amulet/level/java/_raw/_chunk_encode.py +0 -463
- amulet/level/java/_raw/_constant.pyi +0 -20
- amulet/level/java/_raw/_data_pack/__init__.pyi +0 -8
- amulet/level/java/_raw/_data_pack/data_pack.pyi +0 -197
- amulet/level/java/_raw/_data_pack/data_pack_manager.pyi +0 -75
- amulet/level/java/_raw/_dimension.pyi +0 -72
- amulet/level/java/_raw/_level.pyi +0 -238
- amulet/level/java/_raw/_typing.pyi +0 -5
- amulet/level/java/anvil/__init__.pyi +0 -11
- amulet/level/java/anvil/_dimension.pyi +0 -109
- amulet/level/java/anvil/_region.pyi +0 -197
- amulet/level/java/anvil/_sector_manager.pyi +0 -142
- amulet/level/java_forge/__init__.py +0 -0
- amulet/level/mcstructure/__init__.py +0 -0
- amulet/level/nbt/__init__.py +0 -0
- amulet/level/schematic/__init__.py +0 -0
- amulet/level/sponge_schematic/__init__.py +0 -0
- amulet/pybind11/python.hpp +0 -14
- amulet/utils/call_spec/__init__.pyi +0 -53
- amulet/utils/call_spec/_call_spec.pyi +0 -272
- amulet/utils/matrix.pyi +0 -177
- amulet/utils/shareable_lock.pyi +0 -190
- amulet/utils/signal/__init__.pyi +0 -25
- amulet/utils/signal/_signal.pyi +0 -84
- amulet/utils/task_manager.pyi +0 -168
- amulet/utils/typing.py +0 -4
- amulet/utils/typing.pyi +0 -6
- amulet/utils/weakref.pyi +0 -50
- amulet/utils/world_utils.pyi +0 -109
- amulet_core-2.0a6.dist-info/RECORD +0 -253
- /amulet/img/{missing_world_icon.png → missing_world.png} +0 -0
- /amulet/{level/bedrock/chunk/components → mesh}/__init__.py +0 -0
- {amulet_core-2.0a6.dist-info → amulet_core-2.0a7.dist-info}/WHEEL +0 -0
- {amulet_core-2.0a6.dist-info → amulet_core-2.0a7.dist-info}/entry_points.txt +0 -0
- {amulet_core-2.0a6.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
|
amulet/level/nbt/__init__.py
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
amulet/pybind11/python.hpp
DELETED
|
@@ -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]
|