Closed rdnfn closed 3 years ago
I think this is actually solved in the change I made today to store all the polygons in the dataframe, because I also removed the **attributes
line when adding nodes (since there's not much point in adding them to the graph if we already have them in the dataframe. See https://github.com/ai4er-cdt/gtc-biodiversity/blob/feature/graph-analysis-habitat/src/models/geograph.py#L428, hopefully I will submit a PR with this tomorrow.
Nice, nevermind then!
Description: When loading a GeoGraph from a dataframe that already contains some of the attributes that are automatically added to each node, the graph is not created because of a double key error.
Possible solution: Add all dataframe attributes as single dict node attribute (eg.
df_attributes
), that would avoid the possibility that the df and geograph internal keys match.Reproducable test case: