diff --git a/examples/LiFePO4-NEB.ipynb b/examples/LiFePO4-NEB.ipynb index 1fad7e1..e544290 100644 --- a/examples/LiFePO4-NEB.ipynb +++ b/examples/LiFePO4-NEB.ipynb @@ -152,10 +152,10 @@ "%%time\n", "results = {}\n", "for UP_label, UP_cal in UP_cals.items():\n", - " relaxor = RelaxCalc(UP_cal, optimizer=\"BFGS\", relax_cell=True, fmax=0.02)\n", - " s_LFPO_relaxed = relaxor.calc(s_LFPO)['final_structure']\n", + " relaxer = RelaxCalc(UP_cal, optimizer=\"BFGS\", relax_cell=True, fmax=0.02)\n", + " supercell_LFPO_relaxed = relaxer.calc(s_LFPO)['final_structure']\n", " results[UP_label] = {\n", - " \"supercell_LFPO\": s_LFPO_relaxed\n", + " \"supercell_LFPO\": supercell_LFPO_relaxed\n", " }" ] }, @@ -185,19 +185,19 @@ "source": [ "%%time\n", "for UP_label, UP_cal in UP_cals.items():\n", - " relaxor = RelaxCalc(UP_cal, optimizer=\"BFGS\", relax_cell=False, fmax=0.02)\n", - " s_LFPO_relaxed = results[UP_label][\"supercell_LFPO\"]\n", + " relaxer = RelaxCalc(UP_cal, optimizer=\"BFGS\", relax_cell=False, fmax=0.02)\n", + " supercell_LFPO_relaxed = results[UP_label][\"supercell_LFPO\"]\n", "\n", " # NEB path along b and c directions have the same starting image.\n", - " s_LFPO_end_b = s_LFPO_relaxed.copy()\n", + " s_LFPO_end_b = supercell_LFPO_relaxed.copy()\n", " s_LFPO_end_b.remove_sites([11])\n", - " s_LFPO_end_b_relaxed = relaxor.calc(s_LFPO_end_b)['final_structure']\n", - " s_LFPO_end_c = s_LFPO_relaxed.copy()\n", + " s_LFPO_end_b_relaxed = relaxer.calc(s_LFPO_end_b)['final_structure']\n", + " s_LFPO_end_c = supercell_LFPO_relaxed.copy()\n", " s_LFPO_end_c.remove_sites([4])\n", - " s_LFPO_end_c_relaxed = relaxor.calc(s_LFPO_end_c)['final_structure']\n", - " s_LFPO_start_bc = s_LFPO_relaxed.copy()\n", + " s_LFPO_end_c_relaxed = relaxer.calc(s_LFPO_end_c)['final_structure']\n", + " s_LFPO_start_bc = supercell_LFPO_relaxed.copy()\n", " s_LFPO_start_bc.remove_sites([5])\n", - " s_LFPO_start_bc_relaxed = relaxor.calc(s_LFPO_start_bc)['final_structure']\n", + " s_LFPO_start_bc_relaxed = relaxer.calc(s_LFPO_start_bc)['final_structure']\n", " results[UP_label].update(\n", " {\n", " \"supercell_LFPO_end_b\":s_LFPO_end_b_relaxed,\n", @@ -627,13 +627,14 @@ "\n", "\n", "def generate_path_cif_from_images(images: list, filename: str):\n", - " images_struct = [AseAtomsAdaptor().get_structure(i) for i in images]\n", + " \"\"\"Generate a cif file from a list of image atoms.\"\"\"\n", + " image_structs = list(map(AseAtomsAdaptor().get_structure, images))\n", " sites = set()\n", - " lat = images_struct[0].lattice\n", - " for site in chain(*(struct for struct in images_struct)):\n", + " lat = image_structs[0].lattice\n", + " for site in chain(*(struct for struct in image_structs)):\n", " sites.add(PeriodicSite(site.species, site.frac_coords, lat))\n", - " nebpath = Structure.from_sites(sorted(sites))\n", - " nebpath.to(filename, \"cif\")" + " neb_path = Structure.from_sites(sorted(sites))\n", + " neb_path.to(filename, \"cif\")" ] }, {