diff --git a/sumo/electronic_structure/bandstructure.py b/sumo/electronic_structure/bandstructure.py index b89adfc8..988e930d 100644 --- a/sumo/electronic_structure/bandstructure.py +++ b/sumo/electronic_structure/bandstructure.py @@ -149,7 +149,6 @@ def get_projections(bs, selection, normalise=None): # store the projections for all elements and orbitals in a useable format for spin, element, orbital in it.product(spins, elements, all_orbitals): - # convert data to [nb][nk] el_orb_proj = [ [all_proj[spin][nb][nk][element][orbital] for nk in range(nkpts)] @@ -164,7 +163,6 @@ def get_projections(bs, selection, normalise=None): # now go through the selected orbitals and extract what's needed spec_proj = [] for spec in selection: - if isinstance(spec, str): # spec is just an element type, therefore sum all orbitals element = spec diff --git a/sumo/electronic_structure/effective_mass.py b/sumo/electronic_structure/effective_mass.py index a7a1f26a..191b9a9f 100644 --- a/sumo/electronic_structure/effective_mass.py +++ b/sumo/electronic_structure/effective_mass.py @@ -61,7 +61,6 @@ def get_fitting_data(bs, spin, band_id, kpoint_id, num_sample_points=3): # check to see if there are enough points to sample from first # check in the forward direction if kpoint_id + num_sample_points <= branch_data["end_index"]: - # calculate sampling limits start_id = kpoint_id end_id = kpoint_id + num_sample_points + 1 @@ -90,7 +89,6 @@ def get_fitting_data(bs, spin, band_id, kpoint_id, num_sample_points=3): # check in the backward direction if kpoint_id - num_sample_points >= branch_data["start_index"]: - # calculate sampling limits start_id = kpoint_id - num_sample_points end_id = kpoint_id + 1 diff --git a/sumo/io/castep.py b/sumo/io/castep.py index 6546624c..7e2b3d71 100644 --- a/sumo/io/castep.py +++ b/sumo/io/castep.py @@ -138,7 +138,6 @@ def to_file(self, filename): @classmethod def from_file(cls, filename): - with zopen(filename, "rt") as f: lines = [line.strip() for line in f] diff --git a/sumo/io/questaal.py b/sumo/io/questaal.py index 57476a07..8403af4d 100644 --- a/sumo/io/questaal.py +++ b/sumo/io/questaal.py @@ -308,7 +308,6 @@ def _get_structure_from_lattice(self): def to_file(self, filename): """Write QuestaalInit object to init file""" with open(filename, "w") as f: - f.write("LATTICE\n") for key, value in self.lattice.items(): if key == "PLAT": diff --git a/sumo/plotting/bs_plotter.py b/sumo/plotting/bs_plotter.py index d952e573..3ca1ead7 100644 --- a/sumo/plotting/bs_plotter.py +++ b/sumo/plotting/bs_plotter.py @@ -556,7 +556,6 @@ def get_projected_plot( # nd is branch index for spin, nd in it.product(spins, range(nbranches)): - # mask data to reduce plotting load bands = np.array(data["energy"][str(spin)][nd]) mask = np.where( @@ -597,7 +596,6 @@ def get_projected_plot( weights[weights < 0] = 0 if mode == "rgb": - # colours aren't used now but needed later for legend colours = [color1, color2, color3] diff --git a/sumo/plotting/phonon_bs_plotter.py b/sumo/plotting/phonon_bs_plotter.py index 1a032658..5e7cf1eb 100644 --- a/sumo/plotting/phonon_bs_plotter.py +++ b/sumo/plotting/phonon_bs_plotter.py @@ -246,7 +246,6 @@ def _makeplot( if dos is not None: self._plot_phonon_dos(dos, ax=fig.axes[1], color=color, dashline=dashline) else: - # keep correct aspect ratio; match axis to canvas x0, x1 = ax.get_xlim() y0, y1 = ax.get_ylim() diff --git a/sumo/symmetry/seekpath_kpath.py b/sumo/symmetry/seekpath_kpath.py index f150b8b0..59012248 100644 --- a/sumo/symmetry/seekpath_kpath.py +++ b/sumo/symmetry/seekpath_kpath.py @@ -78,7 +78,7 @@ def kpath_from_seekpath(cls, seekpath, point_coords): # convert from seekpath format e.g. [(l1, l2), (l2, l3), (l4, l5)] # to our preferred representation [[l1, l2, l3], [l4, l5]] path = [[seekpath[0][0]]] - for (k1, k2) in seekpath: + for k1, k2 in seekpath: if path[-1] and path[-1][-1] == k1: path[-1].append(k2) else: diff --git a/tests/tests_plotting/test_band_plotter.py b/tests/tests_plotting/test_band_plotter.py index d1663fcb..8754cc72 100644 --- a/tests/tests_plotting/test_band_plotter.py +++ b/tests/tests_plotting/test_band_plotter.py @@ -18,7 +18,6 @@ def test_sanitise_label(self): ("@X", None), ("@HEX", None), ): - self.assertEqual(SBSPlotter._sanitise_label(label_in), label_out) def test_sanitise_label_group(self): @@ -45,5 +44,4 @@ def test_sanitise_label_group(self): (r"X@$\mid$@Y", r"X"), (r"@X@$\mid$@Y", None), ): - self.assertEqual(SBSPlotter._sanitise_label_group(label_in), label_out)