fn _displacements(
            &self,
            coords: &Coords,
            meta: HList2<
                meta::SiteElements,
                meta::SiteMasses,
            >,
        ) -> FailResult<DirWithDisps>
        {Ok({
            let elements: meta::SiteElements = meta.pick();

            let dir = TempDir::new_labeled("rsp2", "phonopy")?;
            {
                let dir = dir.path();
                trace!("Displacement dir: '{}'...", dir.display());

                let extra_args = self.args_from_settings();
                self.conf.save(dir.join(FNAME_CONF_DISPS))?;
                Poscar {
                    comment: "blah", coords, elements,
                }.save(dir.join("POSCAR"))?;
                extra_args.save(dir.join(FNAME_SETTINGS_ARGS))?;

                {
                    trace!("Calling phonopy for displacements...");
                    let mut command = Command::new("phonopy");
                    command
                        .args(&extra_args.0)
                        .arg(FNAME_CONF_DISPS)
                        .arg("--displacement")
                        .current_dir(&dir);

                    log_stdio_and_wait(command, None)?;
                }

                {
                    trace!("Producing {}...", FNAME_OUT_SYMMETRY);
                    let mut command = Command::new("phonopy");
                    command
                        .args(&extra_args.0)
                        .arg(FNAME_CONF_DISPS)
                        .arg("--sym")
                        .current_dir(&dir)
                        .stdout(fsx::create(dir.join(FNAME_OUT_SYMMETRY))?);

                    check_status(command.status()?)?;

                    //---------------------------
                    // NOTE: Even though integer-based FracTrans is gone, this limitation is
                    //       still necessary because we're only capable of hashing the rotations
                    //       when using GroupTree. (meaning they must be unique, meaning there
                    //       must be no pure translations)
                    //       (though maybe it would be better to check for pure translations *there*,
                    //        rather than checking PPOSCAR *here*)
                    //---------------------------
                    //
                    // check if input structure was primitive
                    let Poscar { coords: prim, .. } = Poscar::load(dir.join("PPOSCAR"))?;

                    let ratio = coords.lattice().volume() / prim.lattice().volume();
                    let ratio = round_checked(ratio, 1e-4)?;

                    ensure!(ratio == 1, "attempted to compute symmetry of a supercell");
                }

            }
            DirWithDisps::from_existing(dir)?
        })}
// this pattern of having a second impl method is to simulate rebinding
// the output of `finalize_config` to `self`. (otherwise, we'd be forced
// to have a `self: &Self` in scope with the incorrect config, which would
// be a massive footgun)
this pattern of having a second impl method is to simulate rebinding
the output of `finalize_config` to `self`. (otherwise, we'd be forced
to have a `self: &Self` in scope with the incorrect config, which would
be a massive footgun)
this pattern of having a second impl method is to simulate rebinding the output of ` finalize_config ` to ` self ` . ( otherwise we ' d be forced to have a ` self : &Self ` in scope with the incorrect config which would be a massive footgun )
fn _displacements(
            &self,
            coords: &Coords,
            meta: HList2<
                meta::SiteElements,
                meta::SiteMasses,
            >,
        ) -> FailResult<DirWithDisps>
        {Ok({
            let elements: meta::SiteElements = meta.pick();
            let dir = TempDir::new_labeled("rsp2", "phonopy")?;
            {
                let dir = dir.path();
                trace!("Displacement dir: '{}'...", dir.display());
                let extra_args = self.args_from_settings();
                self.conf.save(dir.join(FNAME_CONF_DISPS))?;
                Poscar {
                    comment: "blah", coords, elements,
                }.save(dir.join("POSCAR"))?;
                extra_args.save(dir.join(FNAME_SETTINGS_ARGS))?;
                {
                    trace!("Calling phonopy for displacements...");
                    let mut command = Command::new("phonopy");
                    command
                        .args(&extra_args.0)
                        .arg(FNAME_CONF_DISPS)
                        .arg("--displacement")
                        .current_dir(&dir);
                    log_stdio_and_wait(command, None)?;
                }
                {
                    trace!("Producing {}...", FNAME_OUT_SYMMETRY);
                    let mut command = Command::new("phonopy");
                    command
                        .args(&extra_args.0)
                        .arg(FNAME_CONF_DISPS)
                        .arg("--sym")
                        .current_dir(&dir)
                        .stdout(fsx::create(dir.join(FNAME_OUT_SYMMETRY))?);
                    check_status(command.status()?)?;
                    //---------------------------
                    // NOTE: Even though integer-based FracTrans is gone, this limitation is
                    //       still necessary because we're only capable of hashing the rotations
                    //       when using GroupTree. (meaning they must be unique, meaning there
                    //       must be no pure translations)
                    //       (though maybe it would be better to check for pure translations *there*,
                    //        rather than checking PPOSCAR *here*)
                    //---------------------------
                    //
                    // check if input structure was primitive
                    let Poscar { coords: prim, .. } = Poscar::load(dir.join("PPOSCAR"))?;
                    let ratio = coords.lattice().volume() / prim.lattice().volume();
                    let ratio = round_checked(ratio, 1e-4)?;
                    ensure!(ratio == 1, "attempted to compute symmetry of a supercell");
                }
            }
            DirWithDisps::from_existing(dir)?
        })}
fn _displacements ( & self , coords : & Coords , meta : HList2 < meta :: SiteElements , meta :: SiteMasses , > , ) -> FailResult < DirWithDisps > { Ok ( { let elements : meta :: SiteElements = meta . pick ( ) ; let dir = TempDir :: new_labeled ( " " , " " ) ? ; { let dir = dir . path ( ) ; trace ! ( " " dir display ( ) ) ; let extra_args = self . args_from_settings ( ) ; self . conf . save ( dir . join ( FNAME_CONF_DISPS ) ) ? ; Poscar { comment : " " , coords , elements , } . save ( dir . join ( " " ) ) ? ; extra_args . save ( dir . join ( FNAME_SETTINGS_ARGS ) ) ? ; { trace ! ( " " ) ; let mut command = Command :: new ( " " ) ; command . args ( & extra_args . 0 ) . arg ( FNAME_CONF_DISPS ) . arg ( " " ) . current_dir ( & dir ) ; log_stdio_and_wait ( command , None ) ? ; } { trace ! ( " " FNAME_OUT_SYMMETRY ) ; let mut command = Command :: new ( " " ) ; command . args ( & extra_args . 0 ) . arg ( FNAME_CONF_DISPS ) . arg ( " " ) . current_dir ( & dir ) . stdout ( fsx :: create ( dir . join ( FNAME_OUT_SYMMETRY ) ) ? ) ; check_status ( command . status ( ) ? ) ? ; //--------------------------- // NOTE: Even though integer-based FracTrans is gone, this limitation is //       still necessary because we're only capable of hashing the rotations //       when using GroupTree. (meaning they must be unique, meaning there //       must be no pure translations) //       (though maybe it would be better to check for pure translations *there*, //        rather than checking PPOSCAR *here*) //--------------------------- // // check if input structure was primitive let Poscar { coords : prim , .. } = Poscar :: load ( dir . join ( " " ) ) ? ; let ratio = coords . lattice ( ) . volume ( ) / prim . lattice ( ) . volume ( ) ; let ratio = round_checked ( ratio , 1e-4 ) ? ; ensure ! ( ratio 1 " " ) ; } } DirWithDisps :: from_existing ( dir ) ? } ) }
this pattern of having a second impl method is to simulate rebinding
the output of `finalize_config` to `self`.
this pattern of having a second impl method is to simulate rebinding the output of ` finalize_config ` to ` self ` .
&self
coords
&Coords
meta
HList2<
                meta::SiteElements,
                meta::SiteMasses,
            >
&self
coords
&Coords
meta
HList2<
                meta::SiteElements,
                meta::SiteMasses,
            >