Returns: An array mapping the indices of SuperAnimal bodyparts Raises: ValueError: If the conversion table is misconfigured.
(self)
| 36 | self.validate() |
| 37 | |
| 38 | def to_array(self) -> np.ndarray: |
| 39 | """ |
| 40 | Returns: |
| 41 | An array mapping the indices of SuperAnimal bodyparts |
| 42 | |
| 43 | Raises: |
| 44 | ValueError: If the conversion table is misconfigured. |
| 45 | """ |
| 46 | self.validate() |
| 47 | sa_indices = {sa_bpt: i for i, sa_bpt in enumerate(self.super_animal_bodyparts)} |
| 48 | sa_bpt_ordering = [self.table[bpt] for bpt in self.converted_bodyparts()] |
| 49 | return np.array([sa_indices[sa_bpt] for sa_bpt in sa_bpt_ordering]) |
| 50 | |
| 51 | def converted_bodyparts(self) -> list[str]: |
| 52 | """Returns: The project bodyparts included in this ordered""" |
no test coverage detected