-
Notifications
You must be signed in to change notification settings - Fork 430
Closed
Labels
C-questionCategory: User questions that are neither featureCategory: User questions that are neither featureP-help-wantedCall for participation: Help is requested to fix this issueCall for participation: Help is requested to fix this issueS-nominated-to-closeStatus: A contributor thinks this PR or issue should be closed outStatus: A contributor thinks this PR or issue should be closed out
Milestone
Description
I'm writing a Partial-Order Aligner for DNA sequence, using petgraph as my underlying graph implementation. Currently I'm using chars as my node-weight type so that when I debug things by in Dot format i see the underlying sequence, however the rest of the code uses the underlying weights as u8's for ease of comparison with text slices necessitating a bunch of conversions.
What I'd like to do ideally is use u8's all around and then simply customize the formatter to convert my node weights from u8 to char when being output to file. It looks like the underlying code already supports node and edge-specific formatters:
fn graph_fmt<NF, EF, NW, EW>(&self, g: G, f: &mut fmt::Formatter,
mut node_fmt: NF, mut edge_fmt: EF) -> fmt::Result
where G: NodeIndexable + IntoNodeReferences + IntoEdgeReferences,
G: GraphProp,
G: Data<NodeWeight=NW, EdgeWeight=EW>,
NF: FnMut(&NW, &mut FnMut(&Display) -> fmt::Result) -> fmt::Result,
EF: FnMut(&EW, &mut FnMut(&Display) -> fmt::Result) -> fmt::Result,
{ ... }
But it's not clear to me how this code is being called and how it could be modified by a user. Suggestions?
mitchmindtree, mankinskin, yamafaktory, fosskers, oowekyala and 1 more
Metadata
Metadata
Assignees
Labels
C-questionCategory: User questions that are neither featureCategory: User questions that are neither featureP-help-wantedCall for participation: Help is requested to fix this issueCall for participation: Help is requested to fix this issueS-nominated-to-closeStatus: A contributor thinks this PR or issue should be closed outStatus: A contributor thinks this PR or issue should be closed out