pysal / momepy

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

ENH: add preserve_index keyword to gdf_to_nx to allow preservation of index and order #641

Closed martinfleis closed 4 months ago

martinfleis commented 4 months ago

Conversion to nx and back currently messes up the order of the rows and does not preserve index at all. This allows for a 1:1 roundtrip needed to keep the Graph objects and anything linked to index aligned.

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.2%. Comparing base (4037c70) to head (e5f196a). Report is 88 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/pysal/momepy/pull/641/graphs/tree.svg?width=650&height=150&src=pr&token=VNn0WR5JWT&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pysal)](https://app.codecov.io/gh/pysal/momepy/pull/641?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pysal) ```diff @@ Coverage Diff @@ ## main #641 +/- ## ======================================= + Coverage 97.4% 98.2% +0.8% ======================================= Files 26 38 +12 Lines 4328 6253 +1925 ======================================= + Hits 4214 6138 +1924 - Misses 114 115 +1 ``` | [Files with missing lines](https://app.codecov.io/gh/pysal/momepy/pull/641?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pysal) | Coverage Δ | | |---|---|---| | [momepy/tests/test\_utils.py](https://app.codecov.io/gh/pysal/momepy/pull/641?src=pr&el=tree&filepath=momepy%2Ftests%2Ftest_utils.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pysal#diff-bW9tZXB5L3Rlc3RzL3Rlc3RfdXRpbHMucHk=) | `99.4% <100.0%> (+0.2%)` | :arrow_up: | | [momepy/utils.py](https://app.codecov.io/gh/pysal/momepy/pull/641?src=pr&el=tree&filepath=momepy%2Futils.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pysal#diff-bW9tZXB5L3V0aWxzLnB5) | `99.1% <100.0%> (+0.2%)` | :arrow_up: |