rename attribute to property

This commit is contained in:
2025-03-14 09:20:49 -05:00
parent acc5780dc4
commit c6bf401bc5
11 changed files with 225 additions and 241 deletions

14
src/utils.py Normal file
View File

@@ -0,0 +1,14 @@
import numpy as np
def random_property_rotation(
user_keypad: np.ndarray,
attr_rotation: list[int]
) -> np.ndarray:
transposed = user_keypad.T
if len(attr_rotation) != len(transposed):
raise ValueError("prop_rotation must be the same length as the number of attributes")
for idx, attr_set in enumerate(transposed):
rotation = attr_rotation[idx]
rotation = rotation % len(attr_set) if len(attr_set) > 0 else 0
transposed[idx] = np.roll(attr_set, rotation)
return transposed.T