-
-
Notifications
You must be signed in to change notification settings - Fork 655
refactor: outsource methods in combinatorial polyhedron #35577
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
refactor: outsource methods in combinatorial polyhedron #35577
Conversation
@@ -3631,14 +3585,45 @@ cdef class CombinatorialPolyhedron(SageObject): | |||
elif not do_edges and self._ridges is None: | |||
raise ValueError('could not determine ridges') | |||
|
|||
cdef bint _is_dual_faster_to_compute_edges_or_ridges(self, bint do_edges) except -1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to use a more general method name that returns an "algorithm name" instead of a boolean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point.
Taken care of in e4ea210.
I think I optimized in all the right places. However, I also optimized in all the wrong places. Having testable methods with human-readable input and output seems better.
the method is called once per polyhedron, so speed does not matter here
Documentation preview for this PR is ready! 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thank you. |
📚 Description
The class
CombinatorialPolyhedron
is clustered with way too long methods.We create two new methods, whose purpose can be understood by reading the name.
This refactoring is motivated by #34773. (Before I want to introduce more logic, I want to clean up a bit.)
📝 Checklist
⌛ Dependencies