Skip to content

Commit

Permalink
Enforce apscheduler<=3.10.4
Browse files Browse the repository at this point in the history
  • Loading branch information
gmatteo committed Feb 6, 2024
1 parent db55c14 commit 80fe623
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 16 deletions.
16 changes: 8 additions & 8 deletions abipy/abio/tests/test_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def test_helper_functions(self):
assert inp["ndivsm"] == 3 and inp["iscf"] == -2 and len(inp["kptbounds"]) == 12

inp.set_kpath(ndivsm=-20)
assert inp["nkpt"] == 156 and inp["iscf"] == -2
assert inp["nkpt"] == 157 and inp["iscf"] == -2

inp.set_qpath(ndivsm=3, qptbounds=None)
assert len(inp["ph_qpath"]) == 12 and inp["ph_nqpath"] == 12 and inp["ph_ndivsm"] == 3
Expand Down Expand Up @@ -344,9 +344,9 @@ def test_new_with_structure_2(self):
abi_kwargs=abi_kwargs)

n_val = inp.num_valence_electrons
n_cond = round(10)
n_cond = round(10)

spin_up_gs = f"\n{int((n_val - 3) / 2)}*1 1 1 1 {n_cond}*0"
spin_up_gs = f"\n{int((n_val - 3) / 2)}*1 1 1 1 {n_cond}*0"
spin_dn_gs = f"\n{int((n_val - 3) / 2)}*1 1 0 0 {n_cond}*0"

nsppol = 2
Expand All @@ -359,13 +359,13 @@ def test_new_with_structure_2(self):

new_inp = inp.new_with_structure(new_structure=sc_stru,
scdims=[2,1,1],verbose=0)
assert new_inp["nband"] == '*276'
#self.abivalidate_input(new_inp)
assert new_inp["nband"] == '*276'
#self.abivalidate_input(new_inp)
# Not valid now because occ should be rewritten as well
# TODO
# go from
# go from
# occ='125*1 1 1 1 10*0'
# to
# to
# occ='125*1 1 1 1 125*1 1 1 1 10*0 10*0 '
# if size is doubled.

Expand Down Expand Up @@ -573,7 +573,7 @@ def test_dfpt_methods(self):
self.abivalidate_input(nscf_inp)

# Test make_ebands_input with nband = "*91" (occopt 2)
gs_occopt2 = gs_inp.new_with_vars(nband="*91", occopt=2)
gs_occopt2 = gs_inp.new_with_vars(nband="*91", occopt=2, paral_kgb=0)
nscf_inp = gs_occopt2.make_ebands_input(nb_extra=10)
assert nscf_inp["nband"] == "*101"
self.abivalidate_input(nscf_inp)
Expand Down
9 changes: 8 additions & 1 deletion abipy/electrons/optic.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,14 @@ def read_tensor3_terms(self, key, components, itemp=0):
od = OrderedDict([(comp, OrderedDict()) for comp in components])
for chiname in ALL_CHIS[key]["terms"]:
#print("About to read:", chiname)
var = self.read_variable(chiname)

try:
var = self.read_variable(chiname)
except self.Error as exc:
# This to support new terms added ina shg
if key != "shg":
raise exc

for comp in components:
try:
ijkp = self.computed_components[key].index(comp)
Expand Down
6 changes: 3 additions & 3 deletions abipy/eph/a2f.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,8 @@ def plot_nuterms(self, units="eV", ax_mat=None, with_lambda=True, fontsize=8,
lax_nu = [ax.twinx() for ax in ax_mat.flat]
# Share axis after creation. Based on
# https://stackoverflow.com/questions/42973223/how-share-x-axis-of-two-subplots-after-they-are-created
lax_nu[0].get_shared_x_axes().join(*lax_nu)
lax_nu[0].get_shared_y_axes().join(*lax_nu)
#lax_nu[0].get_shared_x_axes().join(*lax_nu)
#lax_nu[0].get_shared_y_axes().join(*lax_nu)
for i, ax in enumerate(lax_nu):
if i == 2: continue
ax.set_yticklabels([])
Expand Down Expand Up @@ -749,7 +749,7 @@ def plot_eph_strength(self, what_list=("phbands", "gamma", "lambda"), ax_list=No
return fig

@add_fig_kwargs
def plot(self, what="gamma", units="eV", scale=None, alpha=0.6, ylims=None,
def plot(self, what="gamma", units="eV", scale=None, alpha=0.6, ylims=None,
ax=None, colormap="jet", **kwargs) -> Figure:
"""
Plot phonon bands with gamma(q, nu) or lambda(q, nu) depending on the value of `what`.
Expand Down
4 changes: 2 additions & 2 deletions abipy/scripts/tests/test_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@ def test_abicomp(self):
r = env.run(self.script, "spg", cif_paths[0], cif_paths[1], cif_paths[2], self.loglevel, self.verbose,
expect_stderr=self.expect_stderr)

r = env.run(self.script, "mp_structure", cif_paths[0], cif_paths[1], self.loglevel, self.verbose,
expect_stderr=self.expect_stderr)
#r = env.run(self.script, "mp_structure", cif_paths[0], cif_paths[1], self.loglevel, self.verbose,
# expect_stderr=self.expect_stderr)

dirpath = os.path.join(abidata.dirpath, "refs", "si_ebands")
args = [os.path.join(dirpath, p) for p in ("si_nscf_GSR.nc", "si_scf_WFK.nc")]
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
monty
tabulate
apscheduler
apscheduler<=3.10.4
pydispatcher>=2.0.5
tqdm
pyyaml>=3.11
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def cleanup():
"monty",
"tabulate",
#"apscheduler==2.1.0",
"apscheduler",
"apscheduler<=3.10.4",
"pydispatcher>=2.0.5",
"tqdm",
"pyyaml>=3.11",
Expand Down

0 comments on commit 80fe623

Please sign in to comment.