Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: cleanups, clarify (+test) connected components #180

Merged
merged 11 commits into from
Feb 24, 2025
Merged

Conversation

acl-cqc
Copy link
Contributor

@acl-cqc acl-cqc commented Jan 21, 2025

Most of this relates to the behaviour on connected components (the correct name - each component is connected), but a few other small doc fixes as, erm, I've not looked at any of the code for awhile....

@acl-cqc acl-cqc changed the title Doc cleanups, clarify connected components, driveby simplify port_links doc+test+refactor: Doc cleanups, clarify connected components, driveby simplify port_links Jan 21, 2025
Copy link

codecov bot commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.63%. Comparing base (b0c0cfc) to head (2d80c06).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #180      +/-   ##
==========================================
+ Coverage   83.55%   83.63%   +0.08%     
==========================================
  Files          24       24              
  Lines        6317     6349      +32     
  Branches     6317     6349      +32     
==========================================
+ Hits         5278     5310      +32     
  Misses        967      967              
  Partials       72       72              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@acl-cqc acl-cqc changed the title doc+test+refactor: Doc cleanups, clarify connected components, driveby simplify port_links docs+test+refactor: Doc cleanups, clarify connected components, driveby simplify port_links Jan 21, 2025
@acl-cqc acl-cqc changed the title docs+test+refactor: Doc cleanups, clarify connected components, driveby simplify port_links docs,test: Doc cleanups esp. connected components Jan 21, 2025
@acl-cqc acl-cqc changed the title docs,test: Doc cleanups esp. connected components docs: cleanups, clarify (+test) connected components Jan 21, 2025
@acl-cqc acl-cqc requested a review from aborgna-q January 21, 2025 18:12
src/view.rs Outdated
Comment on lines 455 to 456
/// Iterates over the input neighbours of the `node`.
/// Shorthand for [`LinkView::neighbours`]`(`[`Direction::Incoming`]`)`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// Iterates over the input neighbours of the `node`.
/// Shorthand for [`LinkView::neighbours`]`(`[`Direction::Incoming`]`)`.
/// Iterates over the input neighbours of the `node`.
///
/// Shorthand for [`LinkView::neighbours`]`(`[`Direction::Incoming`]`)`.

src/view.rs Outdated
Comment on lines 463 to 464
/// Iterates over the output neighbours of the `node`.
/// Shorthand for [`LinkView::neighbours`]`(`[`Direction::Outgoing`]`)`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// Iterates over the output neighbours of the `node`.
/// Shorthand for [`LinkView::neighbours`]`(`[`Direction::Outgoing`]`)`.
/// Iterates over the output neighbours of the `node`.
///
/// Shorthand for [`LinkView::neighbours`]`(`[`Direction::Outgoing`]`)`.

Comment on lines 48 to 51
/// If both incoming and outgoing boundary edges are empty, the subgraph is taken
/// to be the entire graph (i.e. all components); otherwise, the subgraph
/// contains only the parts of those components of which the boundary includes
/// at least one edge (or disconnected port).
Copy link
Collaborator

Choose a reason for hiding this comment

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

May be more clear?

Suggested change
/// If both incoming and outgoing boundary edges are empty, the subgraph is taken
/// to be the entire graph (i.e. all components); otherwise, the subgraph
/// contains only the parts of those components of which the boundary includes
/// at least one edge (or disconnected port).
/// If both incoming and outgoing boundary edges are empty, the subgraph is taken
/// to be the entire graph (i.e. all components); otherwise, connected components that do not appear in the boundary will not be included.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like "appear in the boundary" but rephrased to avoid the double negative (do not appear...will not be)

@@ -42,8 +42,13 @@ use super::{MultiView, PortView};
/// wall. The [Direction] of edges (incoming/outgoing) defines which side of
/// the wall is inside, and which is outside.
///
/// If both incoming and outgoing boundary edges are empty, the subgraph is
/// taken to be the entire graph.
/// Note that if the graph contains multiple connected components, there may be
Copy link
Collaborator

Choose a reason for hiding this comment

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

Re-reading this definition, it seems to be describing the behaviour of Subgraph::new_subgraph rather than the structure itself.
(It's missing the arbitrary extra nodes).

Should we move this there, or add the optional closed connected components here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, good point. I kept the first bit here (introduction to the concept, boundary does not distinguish between two possibilities) and moved the rest to new_subgraph

@acl-cqc acl-cqc requested a review from aborgna-q February 24, 2025 17:33
Copy link

codspeed-hq bot commented Feb 24, 2025

CodSpeed Performance Report

Merging #180 will not alter performance

Comparing acl/docs_cleanup (2d80c06) with main (b0c0cfc)

Summary

✅ 36 untouched benchmarks

@acl-cqc acl-cqc added this pull request to the merge queue Feb 24, 2025
Merged via the queue into main with commit 585cf99 Feb 24, 2025
13 checks passed
@acl-cqc acl-cqc deleted the acl/docs_cleanup branch February 24, 2025 19:39
@hugrbot hugrbot mentioned this pull request Feb 24, 2025
github-merge-queue bot pushed a commit that referenced this pull request Feb 24, 2025
## 🤖 New release

* `portgraph`: 0.13.1 -> 0.13.2 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

## [0.13.2](v0.13.1...v0.13.2)
- 2025-02-24

### Documentation

- cleanups, clarify (+test) connected components (#180)

### New Features

- add Subgraph::copy_in_parent (#182)

### Refactor

- Simplify PortGraph::port_links (#188)
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).
@hugrbot hugrbot mentioned this pull request Mar 3, 2025
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