Skip to content

Conversation

kliem
Copy link
Contributor

@kliem kliem commented Apr 28, 2023

📚 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

  • The title is concise, informative, and self-explanatory.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation accordingly.

⌛ Dependencies

@@ -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:
Copy link
Contributor

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

Copy link
Contributor Author

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.

@github-actions
Copy link

Documentation preview for this PR is ready! 🎉
Built with commit: 2d54320

Copy link
Contributor

@mkoeppe mkoeppe left a comment

Choose a reason for hiding this comment

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

LGTM.

@kliem
Copy link
Contributor Author

kliem commented Apr 29, 2023

Thank you.

@vbraun vbraun merged commit eb25bd0 into sagemath:develop May 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants