rename attribute to property

This commit is contained in:
2025-03-14 09:35:19 -05:00
parent 1e2dfa9c9c
commit 1162bd54e1
12 changed files with 187 additions and 188 deletions

View File

@@ -2,13 +2,13 @@ import numpy as np
def random_property_rotation(
user_keypad: np.ndarray,
attr_rotation: list[int]
prop_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)
if len(prop_rotation) != len(transposed):
raise ValueError("prop_rotation must be the same length as the number of properties")
for idx, prop_set in enumerate(transposed):
rotation = prop_rotation[idx]
rotation = rotation % len(prop_set) if len(prop_set) > 0 else 0
transposed[idx] = np.roll(prop_set, rotation)
return transposed.T