Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Adding metrics to strokes made by COINS#704

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
csebastiao wants to merge29 commits intopysal:main
base:main
Choose a base branch
Loading
fromanastassiavybornova:stroke-graph

Conversation

@csebastiao
Copy link

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

Contribution

Adding astrokegraph.py file with 2 main functions:

  • strokes_to_graph takingmomepy.COINS as an input and returning a dual graph where each node is a stroke inmomepy.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 bystrokes_to_graph as an input and returning amomepy.COINS object as an output.

Questions

  • Do we needgraph_to_strokes, as it returns the output frommomepy.COINS ?
  • Does the structure ofstrokes_to_graph where the return of the primal graph is optional make sense ?

TODOs

  • Finish the documentation.
  • Finish test coverage.

anastassiavybornovaand others added29 commitsApril 14, 2025 11:43
@codecov
Copy link

codecovbot commentedJul 24, 2025
edited
Loading

Codecov Report

Attention: Patch coverage is50.45045% with55 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 linesPatch %Lines
momepy/strokegraph.py31.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 linesCoverage Δ
momepy/__init__.py100.0% <100.0%> (ø)
momepy/tests/test_strokegraph.py100.0% <100.0%> (ø)
momepy/strokegraph.py31.2% <31.2%> (ø)

... and1 file with indirect coverage changes

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

@anastassiavybornova
Copy link
Contributor

  • have a function thatonly transforms data structure coins>graph
  • have metric computation as separate functions: in momempy, the logic is: every metric has its own function. steps: create graph > pass it to function > return metric.
  • for metrics that are vanilla networkx: do NOT compute separately.
  • for metrics that are derived: separate functions, if they rely on some vanilla stuff >> have it there inside the derived-metric function
  • instead of "strokes_to_graph", call it "coins_to_nx". in gdf_to_nx: keyword for primal vs dual exists. in "coins_to_nx": keyword
  • we do not need to return primal graph at all (anvy: make sure we can recreate -- mapping through geopandas)
  • graph_to_strokes: pointless -- can be simply dropped

once api is fixed, ping martin, get thumbs up, then we can work on tests.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@csebastiao@anastassiavybornova

[8]ページ先頭

©2009-2025 Movatter.jp