pysal / momepy

Urban Morphology Measuring Toolkit
https://docs.momepy.org
BSD 3-Clause "New" or "Revised" License
496 stars 59 forks source link

DOC: fix clustering example #521

Closed martinfleis closed 1 year ago

martinfleis commented 1 year ago

Closes #520

The diff is terrible but this is the change:


- buildings['interbuilding_distance'] = momepy.MeanInterbuildingDistance(buildings, queen_1, 'uID', queen_3, verbose=False).series
+ buildings['interbuilding_distance'] = momepy.MeanInterbuildingDistance(buildings, queen_1, 'uID', 3, verbose=False).series

The code in the example was just wrong, resulting in Exceptions when creating the ego graph, resulting in NaNs.

martinfleis commented 1 year ago

I also don't like the try/except implementation we have in there but have no energy to refactor that. It is not buggy but just a bad pattern. I also think that with libpysal.graph, I would be able to vectorise the whole thing but that is a 2024 problem.

jGaboardi commented 1 year ago

I also don't like the try/except implementation we have in there but have no energy to refactor that. It is not buggy but just a bad pattern. I also think that with libpysal.graph, I would be able to vectorise the whole thing but that is a 2024 problem.

Yeah, let's make an independent issue for that and punt.