Skip to content

Commit

Permalink
add tests and test files
Browse files Browse the repository at this point in the history
  • Loading branch information
naik-aakash committed Aug 17, 2023
1 parent fbe56a4 commit 40a1530
Show file tree
Hide file tree
Showing 15 changed files with 445 additions and 0 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added lobsterpy/TestData/K3Sb/COBICAR.lobster.gz
Binary file not shown.
Binary file added lobsterpy/TestData/K3Sb/COOPCAR.lobster.gz
Binary file not shown.
Binary file added lobsterpy/TestData/K3Sb/ICOBILIST.lobster.gz
Binary file not shown.
Binary file added lobsterpy/TestData/K3Sb/ICOOPLIST.lobster.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
6 changes: 6 additions & 0 deletions lobsterpy/cohp/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class Analysis:
path_to_madelung: str that describes path to POSCAR
are_cobis : bool indicating if file contains COBI/ICOBI data
are_coops : bool indicating if file contains COOP/ICOOP data
noise_cutoff : float that sets the lower limit of icohps or icoops or icobis considered
set_cohps: list of cohps
set_coordination_ions: list of coodination environment strings for each cation
set_equivalent_sites: set of inequivalent sites
Expand All @@ -60,6 +61,7 @@ def __init__(
path_to_madelung: str | None = None,
whichbonds: str = "cation-anion",
cutoff_icohp: float = 0.1,
noise_cutoff: float = 0.1,
summed_spins=True,
are_cobis=False,
are_coops=False,
Expand All @@ -77,6 +79,7 @@ def __init__(
path_to_madelung: path to MadelungEnergies.lobster (e.g., "MadelungEnergies.lobster")
are_cobis : bool indicating if file contains COBI/ICOBI data
are_coops : bool indicating if file contains COOP/ICOOP data
noise_cutoff : float that sets the lower limit of icohps or icoops or icobis considered
whichbonds: selects which kind of bonds are analyzed. "cation-anion" is the default
cutoff_icohp: only bonds that are stronger than cutoff_icohp*strongest ICOHP will be considered
summed_spins: if true, spins will be summed
Expand All @@ -94,6 +97,7 @@ def __init__(
self.path_to_madelung = path_to_madelung
self.are_cobis = are_cobis
self.are_coops = are_coops
self.noise_cutoff = noise_cutoff
self.setup_env()
self.get_information_all_bonds(summed_spins=summed_spins)

Expand Down Expand Up @@ -147,6 +151,7 @@ def setup_env(self):
adapt_extremum_to_add_cond=True,
are_cobis=self.are_cobis,
are_coops=self.are_coops,
noise_cutoff=self.noise_cutoff,
)
except ValueError as err:
if (
Expand All @@ -171,6 +176,7 @@ def setup_env(self):
adapt_extremum_to_add_cond=True,
are_cobis=self.are_cobis,
are_coops=self.are_coops,
noise_cutoff=self.noise_cutoff,
)

else:
Expand Down
Loading

0 comments on commit 40a1530

Please sign in to comment.