Skip to content

Commit

Permalink
Disable mprester tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gmatteo committed Oct 7, 2024
1 parent abcb736 commit 28f8360
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 15 deletions.
4 changes: 2 additions & 2 deletions abipy/core/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,8 @@ def skip_if_abinit_not_ge(self, version: str) -> None:
@staticmethod
def test_mprester():
"""Skip MP rester tests."""
#raise unittest.SkipTest("MPRester tests have been disabled")
return True
raise unittest.SkipTest("MPRester tests have been disabled")
#return True

def is_url_reachable(url: str) -> bool:
"""check if a URL is reachable:"""
Expand Down
12 changes: 6 additions & 6 deletions abipy/core/tests/test_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,17 @@ def test_utils(self):
assert d["abi_spg_number"] == 227
assert d["abi_bravais"] == "Bravais cF (face-center cubic)"

# Temporarily disables as webserver is down.
#if self.is_url_reachable("www.crystallography.net"):
mgb2_cod = Structure.from_cod_id(1526507, primitive=True)
assert mgb2_cod.formula == "Mg1 B2"
assert mgb2_cod.spget_lattice_type() == "hexagonal"

llzo = Structure.from_file(abidata.cif_file("LLZO_oxi.cif"))
assert llzo.is_ordered
d = llzo.abiget_spginfo(tolsym=0.001)
assert d["spg_number"] == 142

# Temporarily disables ad webserver is down.
#if self.is_url_reachable("www.crystallography.net"):
mgb2_cod = Structure.from_cod_id(1526507, primitive=True)
assert mgb2_cod.formula == "Mg1 B2"
assert mgb2_cod.spget_lattice_type() == "hexagonal"

mgb2 = abidata.structure_from_ucell("MgB2")
if self.has_ase():
mgb2.abi_primitive()
Expand Down
2 changes: 1 addition & 1 deletion abipy/electrons/ebands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2675,8 +2675,8 @@ def plot_ax(self, ax, e0, spin=None, band=None, **kwargs) -> list:
for band in band_range:
yy = self.eigens[spin, :, band] - e0

# Set label only at the first iteration
lines.extend(ax.plot(xx, yy, label=label, **kwargs))
# Set label only at the first iteration
label = None

if with_linewidths:
Expand Down
14 changes: 8 additions & 6 deletions abipy/eph/gpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,15 @@ def yield_figs(self, **kwargs): # pragma: no cover
This function *generates* a predefined list of matplotlib figures with minimal input from the user.
"""
if self.r.eph_fix_korq == "k":
plt_kwargs = dict(with_phbands=True, with_ebands=True, show=False)
yield self.plot_g_qpath(with_qexp=1, **plt_kwargs)
yield self.plot_g_qpath(with_qexp=0, **plt_kwargs)
#yield self.ebands_kq.plot(show=False)
#yield self.phbands.plot(show=False)
yield self.plot_g_qpath()

if self.r.eph_fix_korq == "q":
#yield self.ebands_k.plot(show=False)
yield self.plot_g_kpath()
plt_kwargs = dict(with_ebands=True, show=False)
yield self.plot_g_kpath(**plt_kwargs)

def write_notebook(self, nbpath=None) -> str:
"""
Expand Down Expand Up @@ -365,10 +367,10 @@ def read_ebands_which_fixed(self, which_fixed: str):
# eigens are in Ha
if which_fixed == "k":
frac_coords = kpath_frac_coords + qpath_frac_coords
all_eigens = self.read_value("all_eigens_kq") * abu.Ha_eV
all_eigens = self.all_eigens_kq * abu.Ha_eV
elif which_fixed == "q":
frac_coords = kpath_frac_coords
all_eigens = self.read_value("all_eigens_k") * abu.Ha_eV
all_eigens = self.all_eigens_k * abu.Ha_eV
else:
raise ValueError(f"Invalid value {which_fixed=}")

Expand Down Expand Up @@ -436,7 +438,7 @@ def get_gnuq_average_spin(self, spin: int, band_range: list|tuple|None, eps_mev:
# double all_eigens_k(nsppol, nk_path, nband) ;
# double all_eigens_kq(nsppol, nq_path, nband) ;
all_eigens_k, all_eigens_kq = self.all_eigens_k, self.all_eigens_kq # eV units
phfreqs_ha = self.phfreqs_ha # Ha units
phfreqs_ha = self.phfreqs_ha # Ha units

# Now read the e-ph matrix elements. On disk we have
# n-index, m-index
Expand Down
5 changes: 5 additions & 0 deletions abipy/flowtk/tests/test_psrepos.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ def test_encode_decode_filepath(self):
repo = get_repo_from_name("ONCVPSP-PBEsol-SR-PDv0.4")
if not repo.is_installed():
raise self.SkipTest("ONCVPSP-PBEsol-SR-PDv0.4 should be installed")

#self.assert_msonable(repo, test_is_subclass=True)
#print(repo.as_dict())
#raise ValueError()

filepath = os.path.join(repo.dirpath, "Ni/Ni-sp.psp8")
encoded = encode_pseudopath(filepath)
assert encoded == "@ONCVPSP-PBEsol-SR-PDv0.4/Ni/Ni-sp.psp8"
Expand Down

0 comments on commit 28f8360

Please sign in to comment.