def setUp(self): entry_dict = get_entry_dict( os.path.join(get_path(""), "Cu_entries.txt")) self.Cu_entry_dict = entry_dict with open(os.path.join(get_path(""), 'ucell_entries.txt')) as ucell_entries: ucell_entries = json.loads(ucell_entries.read()) self.Cu_ucell_entry = ComputedStructureEntry.from_dict( ucell_entries["Cu"]) self.Cu_analyzer = SurfaceEnergyPlotter(entry_dict, self.Cu_ucell_entry) self.metals_O_entry_dict = load_O_adsorption() ucell_entry = ComputedStructureEntry.from_dict(ucell_entries["Pt"]) self.Pt_analyzer = SurfaceEnergyPlotter(self.metals_O_entry_dict["Pt"], ucell_entry) ucell_entry = ComputedStructureEntry.from_dict(ucell_entries["Ni"]) self.Ni_analyzer = SurfaceEnergyPlotter(self.metals_O_entry_dict["Ni"], ucell_entry) ucell_entry = ComputedStructureEntry.from_dict(ucell_entries["Rh"]) self.Rh_analyzer = SurfaceEnergyPlotter(self.metals_O_entry_dict["Rh"], ucell_entry) self.Oads_analyzer_dict = { "Pt": self.Pt_analyzer, "Ni": self.Ni_analyzer, "Rh": self.Rh_analyzer }
def setUp(self): # Load all entries La_hcp_entry_dict = get_entry_dict(os.path.join(get_path(""), "La_hcp_entries.txt")) La_fcc_entry_dict = get_entry_dict(os.path.join(get_path(""), "La_fcc_entries.txt")) with open(os.path.join(get_path(""), "ucell_entries.txt")) as ucell_entries: ucell_entries = json.loads(ucell_entries.read()) La_hcp_ucell_entry = ComputedStructureEntry.from_dict(ucell_entries["La_hcp"]) La_fcc_ucell_entry = ComputedStructureEntry.from_dict(ucell_entries["La_fcc"]) # Set up the NanoscaleStabilityClass self.La_hcp_analyzer = SurfaceEnergyPlotter(La_hcp_entry_dict, La_hcp_ucell_entry) self.La_fcc_analyzer = SurfaceEnergyPlotter(La_fcc_entry_dict, La_fcc_ucell_entry) self.nanoscale_stability = NanoscaleStability([self.La_fcc_analyzer, self.La_hcp_analyzer])
def test_entry_dict_from_list(self): # Plug in a list of entries to see if it works all_Pt_slab_entries = [] Pt_entries = self.Pt_analyzer.all_slab_entries for hkl in Pt_entries.keys(): for clean in Pt_entries[hkl].keys(): all_Pt_slab_entries.append(clean) all_Pt_slab_entries.extend(Pt_entries[hkl][clean]) a = SurfaceEnergyPlotter(all_Pt_slab_entries, self.Pt_analyzer.ucell_entry) self.assertEqual(type(a).__name__, "SurfaceEnergyPlotter")