// NOTE: This ends up getting called stupidly often, but I don't think
//       it is expensive enough to be a real cause for concern.
This ends up getting called stupidly often, but I don't think
it is expensive enough to be a real cause for concern.
This ends up getting called stupidly often but I don ' t think it is expensive enough to be a real cause for concern .
fn find_layers(&self, coords: &Coords, meta: &CommonMeta) -> Layers
        {
            use rsp2_structure::layer;
            let bonds: Option<meta::FracBonds> = meta.pick();
            let result = match bonds {
                Some(bonds) => {
                    // enhance layer assignments using connected components to support layers that
                    // overlap after buckling
                    let ccs = bonds.to_periodic_graph().connected_components_by_site();
                    layer::find_layers_with_labels(&ccs, &coords, V3([0, 0, 1]), 0.25)
                },
                // FIXME: this is supported just so that we can wait until after parameter
                //        optimization before generating the bond graph.
                //        There ought to be a better way...
                None => layer::find_layers(&coords, V3([0, 0, 1]), 0.25),
            };
            result.unwrap_or_else(|e| {
                panic!("Failure to determine layers when using kolmogorov/crespi/z: {}", e);
            })
        }
fn find_layers ( & self , coords : & Coords , meta : & CommonMeta ) -> Layers { use rsp2_structure :: layer ; let bonds : Option < meta :: FracBonds > = meta . pick ( ) ; let result = match bonds { Some ( bonds ) => { // enhance layer assignments using connected components to support layers that // overlap after buckling let ccs = bonds . to_periodic_graph ( ) . connected_components_by_site ( ) ; layer :: find_layers_with_labels ( & ccs , & coords , V3 ( [ 0 , 0 , 1 ] ) , 0.25 ) } , // FIXME: this is supported just so that we can wait until after parameter //        optimization before generating the bond graph. //        There ought to be a better way... None => layer :: find_layers ( & coords , V3 ( [ 0 , 0 , 1 ] ) , 0.25 ) , } ; result . unwrap_or_else ( | e | { panic ! ( " " e ) ; } ) }
NOTE: This ends up getting called stupidly often, but I don't think
it is expensive enough to be a real cause for concern.
NOTE : This ends up getting called stupidly often but I don ' t think it is expensive enough to be a real cause for concern .
&self
coords
&Coords
meta
&CommonMeta