Contract the array of `cls` to the size of `subcls`.
(cls, subcls: Type['PoseArray'], array: np.ndarray)
| 162 | |
| 163 | @classmethod |
| 164 | def contract_array(cls, subcls: Type['PoseArray'], array: np.ndarray) -> np.ndarray: |
| 165 | """ |
| 166 | Contract the array of `cls` to the size of `subcls`. |
| 167 | """ |
| 168 | assert cls.is_valid_array(array) |
| 169 | assert set(cls.arrorder) >= set(subcls.arrorder) |
| 170 | full_arr = PoseArray.expand_array(cls, array) |
| 171 | result = np.zeros(subcls.kNumUsedMotors) |
| 172 | result = full_arr[subcls.arrorder] |
| 173 | return result |
| 174 | |
| 175 | @classmethod |
| 176 | @lru_cache(maxsize=1) |
no test coverage detected