-
-
Notifications
You must be signed in to change notification settings - Fork 481
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #32723: Helper function to avoid duplicated code when using weights
Many functions with parameters `by_weight` and `weight_function` have duplicated code for checking the parameters and setting the weight function. Here we add a helper function `_get_weight_function` that takes all related parameters as input and return proper values for parameter `by_weight` and a valid weight function. A next step will be to unify the usage of weights in graphs, as proposed in #13112, since we use either `use_edge_labels` or the combination of `by_weight` and `weight_function`. URL: https://trac.sagemath.org/32723 Reported by: dcoudert Ticket author(s): David Coudert Reviewer(s): Travis Scrimshaw
- Loading branch information
Showing
1 changed file
with
83 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters