arboretum/layers/tracks/_track_utils.py
def vertex_properties(self, color_by: str) -> np.ndarray:
        """ return the properties of tracks by vertex """

        # if we change the coloring, rebuild the vertex colors array
        vertex_properties = []
        for idx, track_property in enumerate(self.properties):
            property = track_property[color_by]

            if isinstance(property, (list, np.ndarray)):
                p = property
            elif isinstance(property, (int, float, np.generic)):
                p = [property] * len(self.data[idx])  # length of the track
            else:
                raise TypeError(
                    f'Property {track_property} type not recognized'
                )

            vertex_properties.append(p)

        # concatenate them, and use a colormap to color them
        vertex_properties = np.concatenate(vertex_properties, axis=0)

        return vertex_properties
 return the properties of tracks by vertex 
return the properties of tracks by vertex
return the properties of tracks by vertex
def vertex_properties(self, color_by: str) -> np.ndarray:
        vertex_properties = []
        for idx, track_property in enumerate(self.properties):
            property = track_property[color_by]
            if isinstance(property, (list, np.ndarray)):
                p = property
            elif isinstance(property, (int, float, np.generic)):
                p = [property] * len(self.data[idx])  
            else:
                raise TypeError(
                    f'Property {track_property} type not recognized'
                )
            vertex_properties.append(p)
        vertex_properties = np.concatenate(vertex_properties, axis=0)
        return vertex_properties
def vertex_properties ( self , color_by : str ) -> np . ndarray : vertex_properties = [ ] for idx , track_property in enumerate ( self . properties ) : property = track_property [ color_by ] if isinstance ( property , ( list , np . ndarray ) ) : p = property elif isinstance ( property , ( int , float , np . generic ) ) : p = [ property ] * len ( self . data [ idx ] ) else : raise TypeError ( f'Property {track_property} type not recognized' ) vertex_properties . append ( p ) vertex_properties = np . concatenate ( vertex_properties , axis = 0 ) return vertex_properties
return the properties of tracks by vertex
return the properties of tracks by vertex
""" return the properties of tracks by vertex """ # if we change the coloring, rebuild the vertex colors array # length of the track # concatenate them, and use a colormap to color them
self
color_by
str