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

add method orient to Graph #38778

Merged
merged 3 commits into from
Oct 12, 2024
Merged

Conversation

dcoudert
Copy link
Contributor

@dcoudert dcoudert commented Oct 6, 2024

As suggested by @maxale in #38758 (comment), we add a method to apply an orientation function to a graph and obtain the corresponding directed graph.

📝 Checklist

  • The title is concise and informative.
  • 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 and checked the documentation preview.

⌛ Dependencies

Copy link

github-actions bot commented Oct 6, 2024

Documentation preview for this PR (built with commit bb3749d; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

Copy link
Collaborator

@tscrim tscrim left a comment

Choose a reason for hiding this comment

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

Lines 172 to 175 are never reached since they are an "else" after two cases, one of which must be true. Is line 172 supposed to be an if?

@dcoudert
Copy link
Contributor Author

These lines can be reached setting data_structure=None, immutable=None and sparse=True or False.

In fact, lines 154-182 are copy-paste from method copy in generic_graph.py. May be I should make a method like _choose_data_structure_for_copy in generic_graph.py and use it for both methods ?

@tscrim
Copy link
Collaborator

tscrim commented Oct 10, 2024

Ah, I see. It’s fine for now. Then can you add doctests covering those cases?

@dcoudert
Copy link
Contributor Author

We'll see if the new tests are sufficient.

Copy link
Collaborator

@tscrim tscrim left a comment

Choose a reason for hiding this comment

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

That should be good. Thank you.

@dcoudert
Copy link
Contributor Author

Thanks for the review.

@vbraun vbraun merged commit e61d20c into sagemath:develop Oct 12, 2024
19 of 20 checks passed
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