Skip to content

Conversation

csebastiao
Copy link

See #591 for explanation. Drafted without full tests and documentation. We ran the code with https://github.com/pysal/momepy/blob/main/ci/envs/312-latest.yaml.

Contribution

Adding a strokegraph.py file with 2 main functions:

  • strokes_to_graph taking momepy.COINS as an input and returning a dual graph where each node is a stroke in momepy.COINSand each edge is when two strokes are intersecting. Optional arguments include computing additional metrics on the strokes (degree, closeness, betweenness, connectivity, access, orthogonality, and spacing, see (El Gouj et al., 2022) for details), and returning the primal graph of the street network with the information about each stroke on every edge composing them.
  • graph_to_strokes taking the dual graph generated by strokes_to_graph as an input and returning a momepy.COINS object as an output.

Questions

  • Do we need graph_to_strokes, as it returns the output from momepy.COINS ?
  • Does the structure of strokes_to_graph where the return of the primal graph is optional make sense ?

TODOs

  • Finish the documentation.
  • Finish test coverage.

Copy link

codecov bot commented Jul 24, 2025

Codecov Report

Attention: Patch coverage is 50.45045% with 55 lines in your changes missing coverage. Please review.

Project coverage is 97.4%. Comparing base (4037c70) to head (7b9c02c).
Report is 112 commits behind head on main.

Files with missing lines Patch % Lines
momepy/strokegraph.py 31.2% 55 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #704     +/-   ##
=======================================
+ Coverage   97.4%   97.4%   +0.1%     
=======================================
  Files         26      42     +16     
  Lines       4328    7275   +2947     
=======================================
+ Hits        4214    7088   +2874     
- Misses       114     187     +73     
Files with missing lines Coverage Δ
momepy/__init__.py 100.0% <100.0%> (ø)
momepy/tests/test_strokegraph.py 100.0% <100.0%> (ø)
momepy/strokegraph.py 31.2% <31.2%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants