Skip to content

Conversation

kliem
Copy link
Contributor

@kliem kliem commented Apr 28, 2023

📚 Description

Motivated by #34773.

The initialization of CombinatorialPolyhedron is rather complicated. Changing functionality is difficult this way, so we extract some of the initialization to dedicated methods.

📝 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

else:
data_modified = data
self._init_from_polyhedron(data)
return
elif isinstance(data, LatticePolytopeClass):
Copy link
Contributor

Choose a reason for hiding this comment

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

if each branch ends with return, perhaps better to use if instead of elif?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 5c21a79.

@github-actions
Copy link

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

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.

Nice refactoring, LGTM.

@kliem
Copy link
Contributor Author

kliem commented Apr 29, 2023

Thanks for the review.

@vbraun vbraun merged commit be85e35 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.

3 participants