pub fn coursewise(
    mut methods: Vec<super::Method>,
    calls: &CallVec<super::Call>,
    calling_bell: Bell,
    splice_style: SpliceStyle,
    part_head: &Row,
) -> Result<Layout> {
    // Cache data about each method, and compute the overall stage of the comp
    super::utils::check_duplicate_shorthands(&methods)?;
    let is_spliced = methods.len() > 1;
    let stage = methods
        .iter()
        .map(|m| m.stage())
        .max()
        .ok_or(Error::NoMethods)?;
    assert!(methods.iter().all(|m| m.stage() == stage)); // TODO: Implement mixed stage splicing

    // Pre-process CH masks
    super::utils::preprocess_ch_masks(&mut methods, calls, stage)?;
    for m in &methods {
        check_chs_in_other_parts(&m.ch_masks, part_head)?;
        super::utils::check_for_ambiguous_courses(
            &m.ch_masks,
            &m.lead_head().closure_from_rounds(),
        )?;
    }

    // Generate links
    let links = generate_links(&methods, calls, calling_bell, stage, splice_style)?.into();

    Ok(Layout {
        links,
        starts: rounds_locations(&methods, stage, Boundary::Start),
        ends: rounds_locations(&methods, stage, Boundary::End),
        // Create a block for each method
        method_blocks: methods
            .into_iter()
            .map(|m| m.course_method_block(is_spliced))
            .collect::<BlockVec<_>>(),
        stage,
        leadwise: false,
    })
}
/// Generate a [`Layout`] such that chunks will be labelled by their course-head, rather than by
/// their lead-head.
Generate a [`Layout`] such that chunks will be labelled by their course-head, rather than by
their lead-head.
Generate a [ ` Layout ` ] such that chunks will be labelled by their course - head rather than by their lead - head .
pub fn coursewise(
    mut methods: Vec<super::Method>,
    calls: &CallVec<super::Call>,
    calling_bell: Bell,
    splice_style: SpliceStyle,
    part_head: &Row,
) -> Result<Layout> {
    // Cache data about each method, and compute the overall stage of the comp
    super::utils::check_duplicate_shorthands(&methods)?;
    let is_spliced = methods.len() > 1;
    let stage = methods
        .iter()
        .map(|m| m.stage())
        .max()
        .ok_or(Error::NoMethods)?;
    assert!(methods.iter().all(|m| m.stage() == stage)); // TODO: Implement mixed stage splicing
    // Pre-process CH masks
    super::utils::preprocess_ch_masks(&mut methods, calls, stage)?;
    for m in &methods {
        check_chs_in_other_parts(&m.ch_masks, part_head)?;
        super::utils::check_for_ambiguous_courses(
            &m.ch_masks,
            &m.lead_head().closure_from_rounds(),
        )?;
    }
    // Generate links
    let links = generate_links(&methods, calls, calling_bell, stage, splice_style)?.into();
    Ok(Layout {
        links,
        starts: rounds_locations(&methods, stage, Boundary::Start),
        ends: rounds_locations(&methods, stage, Boundary::End),
        // Create a block for each method
        method_blocks: methods
            .into_iter()
            .map(|m| m.course_method_block(is_spliced))
            .collect::<BlockVec<_>>(),
        stage,
        leadwise: false,
    })
}
pub fn coursewise ( mut methods : Vec < super :: Method > , calls : & CallVec < super :: Call > , calling_bell : Bell , splice_style : SpliceStyle , part_head : & Row , ) -> Result < Layout > { // Cache data about each method, and compute the overall stage of the comp super :: utils :: check_duplicate_shorthands ( & methods ) ? ; let is_spliced = methods . len ( ) > 1 ; let stage = methods . iter ( ) . map ( | m | m . stage ( ) ) . max ( ) . ok_or ( Error :: NoMethods ) ? ; assert ! ( methods iter ( ) all ( m m stage ( ) stage ) ) ; // TODO: Implement mixed stage splicing // Pre-process CH masks super :: utils :: preprocess_ch_masks ( & mut methods , calls , stage ) ? ; for m in & methods { check_chs_in_other_parts ( & m . ch_masks , part_head ) ? ; super :: utils :: check_for_ambiguous_courses ( & m . ch_masks , & m . lead_head ( ) . closure_from_rounds ( ) , ) ? ; } // Generate links let links = generate_links ( & methods , calls , calling_bell , stage , splice_style ) ? . into ( ) ; Ok ( Layout { links , starts : rounds_locations ( & methods , stage , Boundary :: Start ) , ends : rounds_locations ( & methods , stage , Boundary :: End ) , // Create a block for each method method_blocks : methods . into_iter ( ) . map ( | m | m . course_method_block ( is_spliced ) ) . collect :: < BlockVec < _ > > ( ) , stage , leadwise : false , } ) }
Generate a [`Layout`] such that chunks will be labelled by their course-head, rather than by
their lead-head.
Generate a [ ` Layout ` ] such that chunks will be labelled by their course - head rather than by their lead - head .
methods
Vec<super::Method>
calls
&CallVec<super::Call>
calling_bell
Bell
splice_style
SpliceStyle
part_head
&Row
methods
Vec<super::Method>
calls
&CallVec<super::Call>
calling_bell
Bell
splice_style
SpliceStyle
part_head
&Row