msarahan / state-adjacency-graphs

project to create adjacency graphs for the US census blocks within states
1 stars 4 forks source link

Set id_column as index in loaded dataframe and provide getter #45

Closed jisantuc closed 5 years ago

jisantuc commented 6 years ago

Overview

This PR sets the column TwoStepGraph is told is the id column as the index on the dataframe loaded into the MgggGraph. As it stands, there's no cheap way to extract the attributes of a specific vertex if you know it's ID. After this change, the graph coming out of TwoStepAlgorithm(path, id_column) has a get_vertex_attrs method that provides cheap access to all or a subset of a vertex's attributes.

Testing

Load up your favorite shapefile and check out some vertices