Skip to content

Commit

Permalink
merge current mastr
Browse files Browse the repository at this point in the history
  • Loading branch information
JaGeo committed Jan 24, 2025
1 parent 0d5ff55 commit e7b558a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 7 additions & 0 deletions src/pymatgen/electronic_structure/cohp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,13 @@ def is_spin_polarized(self) -> bool:

@property
def translation(self) -> list[int, int, int]:
"""
Returns the translation vector with respect to the origin cell
as defined in LOBSTER.
Returns:
list[int, int, int]
"""
return self._translation

def icohpvalue(self, spin: Spin = Spin.up) -> float:
Expand Down
8 changes: 1 addition & 7 deletions src/pymatgen/io/lobster/lobsterenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import math
import tempfile
from typing import TYPE_CHECKING, NamedTuple
import warnings

import matplotlib as mpl
import numpy as np
Expand Down Expand Up @@ -941,7 +942,6 @@ def _find_environments(
centralsite = site
copysite = copy.copy(centralsite)
cell_start = centralsite.frac_coords - copysite.to_unit_cell().frac_coords
print(cell_start)
neighbors_by_distance_start = self.structure.get_sites_in_sphere(
pt=centralsite.coords,
r=np.max(lengths_from_ICOHPs) + 0.5,
Expand Down Expand Up @@ -980,7 +980,6 @@ def _find_environments(

for neigh_idx, neigh in enumerate(neighbors_by_distance):
index_here2 = index_here_list[neigh_idx]
print(index_here2)
for dist_idx, dist in enumerate(copied_distances_from_ICOHPs):
if (
np.isclose(dist, list_distances[neigh_idx], rtol=1e-4)
Expand Down Expand Up @@ -1008,16 +1007,11 @@ def _find_environments(
_list_neighisite.append(index_here2)
_neigh_coords.append(coords[neigh_idx])
_neigh_frac_coords.append(neigh.frac_coords)
print("test")
print(copied_translations_from_ICOHPs[dist_idx])
print(translations_by_distance[neigh_idx])
print(cell_start)
del copied_distances_from_ICOHPs[dist_idx]
del copied_neighbors_from_ICOHPs[dist_idx]
del copied_translations_from_ICOHPs[dist_idx]
break

print(_list_neighsite)
list_neighisite.append(_list_neighisite)
list_neighsite.append(_list_neighsite)
list_lengths.append(lengths_from_ICOHPs)
Expand Down

0 comments on commit e7b558a

Please sign in to comment.