Skip to content
New issue

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

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

docstring & typehints in simplify.network_simplify(), etc. #107

Merged
merged 4 commits into from
Nov 26, 2024

Conversation

jGaboardi
Copy link
Collaborator

@jGaboardi jGaboardi commented Nov 24, 2024

This PR:

Once we are satisfied with the wording, I will propagate docstrings & typehints in the internal functions in a follow up PR.

@jGaboardi jGaboardi self-assigned this Nov 24, 2024
@jGaboardi jGaboardi added the documentation Improvements or additions to documentation label Nov 24, 2024
@jGaboardi jGaboardi mentioned this pull request Nov 24, 2024
5 tasks
Comment on lines 513 to 514
The factor by which singles, pairs, and clusters are simplified.
This value is multiplied by ``max_segment_length``.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can take a bit to understand. In my head it is the vice versa, the max_segment_length is multiplied by this factor to get the simplification epsilon.

Comment on lines 519 to 520
First option threshold used to determine face artifacts.
Passed into ``artifacts.get_artifacts()``.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not clear.

When artifact_threshold is passed, we don't compute it from artifacts and just use the given value. This is useful for small networks where artifact detection may fail or become unreliable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, given artifacts.get_artifacts() and everything else mentioned here is essentially private, I am not sure public docstring should point to that.

First option threshold used to determine face artifacts.
Passed into ``artifacts.get_artifacts()``.
artifact_threshold_fallback : None | float | int = None
Second option threshold used to determine face artifacts.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this is used as a fallback. So we try to detect artifact threshold from the data and use that one but if that fails, we fall back to the value given here.

Comment on lines 525 to 541
Areal theshold for block detection.
Passed into ``artifacts.get_artifacts()``.
isoareal_threshold_blocks : float | int = 0.5
Isoareal theshold for block detection.
See ``esda.shape.isoareal_quotient``.
Passed into ``artifacts.get_artifacts()``.
area_threshold_circles : float | int = 5e4
Areal theshold for circle detection.
Passed into ``artifacts.get_artifacts()``.
isoareal_threshold_circles_enclosed : float | int = 0.75
Isoareal theshold for enclosed circle detection.
See ``esda.shape.isoareal_quotient``.
Passed into ``artifacts.get_artifacts()``.
isoperimetric_threshold_circles_touching : float | int = 0.9
Isoperimetric theshold for enclosed circle touching.
See ``esda.shape.isoperimetric_quotient``.
Passed into ``artifacts.get_artifacts()``.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these will eventually, on the public API need more explanation on what they do and why they exist.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll create a ticket dedicated to that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xref: #110

Comment on lines +490 to +493
"""Top-level workflow for simplifying networks. The input raw road network data is
first preprocessed (topological corrections & node consolidation) before two
iterations of artifact detection and simplification. For further information on
face artifact detection and extraction see :cite:`fleischmann2023`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will probably need way more but I am happy to craft that documentation at some point.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya, I intended this a first minimal pass to get the process started. With that in mind, is there any more of an explanation to be added in this iteration?

@jGaboardi jGaboardi merged commit 05ab52c into main Nov 26, 2024
11 checks passed
@jGaboardi jGaboardi deleted the GH20_simplify_docstrings branch November 26, 2024 15:32
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants