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

Replace Sweep with object-specific traits #2106

Merged
merged 7 commits into from
Nov 23, 2023
Merged

Replace Sweep with object-specific traits #2106

merged 7 commits into from
Nov 23, 2023

Conversation

hannobraun
Copy link
Owner

The old Sweep trait was over-generalized. There was no code that actually used it to abstract over multiple of its implementations, and I don't think it would have been practical to do so. Those implementations, on the other hand, were partially implemented not for single types, but tuples of them (thereby effectively adding arguments that the trait didn't have), while at the same time ignoring argument the trait did have.

Overall, this was both messy and unnecessary. In this pull request, I've replaced those Sweep implementations with object-specific sweep traits that are more targeted to the needs of the object they're sweeping. This also provides a place for object-specific sweep documentation, some of which I've added.

Lastly, this brings operations::sweep more in line with other operations modules, which function in a similar way.

This came out of my work on #2098.

This results in a situation that is simpler and more correct: The trait
method no longer takes arguments that it can't use and it's no longer
possible to sweep a vertex without providing a cache. On top of that,
this provides a place to put vertex-specific sweep documentation.
@hannobraun hannobraun enabled auto-merge November 23, 2023 15:41
@hannobraun hannobraun merged commit 71888c7 into main Nov 23, 2023
4 checks passed
@hannobraun hannobraun deleted the sweep branch November 23, 2023 15:43
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.

1 participant