Skip to content

Commit

Permalink
Test py3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
gmatteo committed Oct 16, 2024
1 parent c86d2c6 commit 2dc6bd2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:
config:
- os: ubuntu-latest
python: '3.11'
config:
- os: ubuntu-latest
python: '3.12'

runs-on: ${{ matrix.config.os }}
env:
Expand All @@ -51,7 +54,7 @@ jobs:
cp abipy/data/managers/gh_manager.yml $HOME/.abinit/abipy/manager.yml
cp abipy/data/managers/gh_scheduler.yml $HOME/.abinit/abipy/scheduler.yml
# FIXME TEMPORARY HACK
pip install git+https://github.com/gmatteo/pymatgen.git@master -U
#pip install git+https://github.com/gmatteo/pymatgen.git@master -U
- name: pytest
run: |
Expand Down
6 changes: 3 additions & 3 deletions abipy/lumi/deltaSCF.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ def draw_displacements_vesta(self,in_path, mass_weighted = False,
scale_vector=20,width_vector=0.3,color_vector=[255,0,0],centered=True,
factor_keep_vectors=0.1,
out_path="VESTA_FILES",out_filename="gs_ex_relaxation"):
"""
r"""
Draw the ground state to excited state atomic relaxation on a vesta structure.
Args:
Expand Down Expand Up @@ -613,7 +613,7 @@ def displacements_visu(self, a_g=10, **kwargs):

@add_fig_kwargs
def plot_delta_R_distance(self, defect_symbol,colors=["k","r","g","b","c","m"],ax=None, **kwargs):
"""
r"""
Plot \DeltaR vs distance from defect for each atom, colored by species.
Args:
Expand Down Expand Up @@ -646,7 +646,7 @@ def plot_delta_R_distance(self, defect_symbol,colors=["k","r","g","b","c","m"],a

@add_fig_kwargs
def plot_delta_F_distance(self, defect_symbol,colors=["k","r","g","b","c","m"],ax=None, **kwargs):
"""
r"""
Plot \DeltaF vs distance from defect for each atom, colored by species.
Args:
Expand Down
24 changes: 12 additions & 12 deletions abipy/scripts/oncv.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def _find_oncv_output(path: str) -> str:
new_path = root + ".out"
if not os.path.exists(new_path):
raise ValueError("Cannot find neither %s nor %s" % (path, new_path))
cprint("Maybe you meant %s" % new_path, "yellow")
cprint("Maybe you meant %s" % new_path, color="yellow")
return new_path


Expand All @@ -51,7 +51,7 @@ def oncv_gnuplot(options):
# Parse output file.
onc_parser = OncvParser(out_path).scan()
if not onc_parser.run_completed:
cprint("oncvpsp output is not completed. Exiting", "red")
cprint("oncvpsp output is not completed. Exiting", color="red")
return 1

onc_parser.gnuplot()
Expand Down Expand Up @@ -155,7 +155,7 @@ def oncv_run(options):
elif options.rel == "fr":
if not root.endswith("_r"):
root += "_r"
cprint("FR calculation with input file without `_r` suffix. Will add `_r` to output files", "yellow")
cprint("FR calculation with input file without `_r` suffix. Will add `_r` to output files", color="yellow")

elif options.rel == "from_file":
calc_type = "scalar-relativistic"
Expand All @@ -168,11 +168,11 @@ def oncv_run(options):
out_path = root + ".out"

if os.path.exists(psp8_path):
cprint("%s already exists and will be overwritten" % os.path.relpath(psp8_path), "yellow")
cprint("%s already exists and will be overwritten" % os.path.relpath(psp8_path), color="yellow")
if os.path.exists(djrepo_path):
cprint("%s already exists and will be overwritten" % os.path.relpath(djrepo_path), "yellow")
cprint("%s already exists and will be overwritten" % os.path.relpath(djrepo_path), color="yellow")
if os.path.exists(out_path):
cprint("%s already exists and will be overwritten" % os.path.relpath(out_path), "yellow")
cprint("%s already exists and will be overwritten" % os.path.relpath(out_path), color="yellow")

# Select calc_type
if calc_type is None:
Expand All @@ -188,11 +188,11 @@ def oncv_run(options):
print(f"Output files produced in directory:\n\t{psgen.workdir}")

if retcode := psgen.start_and_wait() != 0:
cprint("oncvpsp returned %s. Exiting" % retcode, "red")
cprint("oncvpsp returned %s. Exiting" % retcode, color="red")
return retcode

if psgen.status != psgen.S_OK:
cprint(f"psgen.status = {psgen.status} != psgen.S_OK", "red")
cprint(f"psgen.status = {psgen.status} != psgen.S_OK", color="red")

if psgen.parser.warnings:
print(2 * "\n")
Expand All @@ -212,7 +212,7 @@ def oncv_run(options):
# Parse the output file.
onc_parser = OncvParser(out_path).scan()
if not onc_parser.run_completed:
cprint("oncvpsp output is not completed. Exiting", "red")
cprint("oncvpsp output is not completed. Exiting", color="red")
return 1

# Extract psp8 files from the oncvpsp output and write it to file.
Expand All @@ -225,11 +225,11 @@ def oncv_run(options):
with open(psp8_path.replace(".psp8", ".upf"), "wt") as fh:
fh.write(upf_str)
else:
cprint("UPF2 file has not been produced. Use `both` in input file!", "red")
cprint("UPF2 file has not been produced. Use `both` in input file!", color="red")

pseudo = Pseudo.from_file(psp8_path)
if pseudo is None:
cprint("Cannot parse psp8 file: %s" % psp8_path, "red")
cprint("Cannot parse psp8 file: %s" % psp8_path, color="red")
return 1

# Initialize and write djson file.
Expand Down Expand Up @@ -346,7 +346,7 @@ def get_copts_parser(multi=False):

# Subparser for compare command.
copts_parser_multi = get_copts_parser(multi=True)
p_compare = subparsers.add_parser('compare', parents=[copts_parser_multi, plot_parser],
p_compare = subparsers.add_parser("compare", parents=[copts_parser_multi, plot_parser],
help=oncv_compare.__doc__)

# notebook options.
Expand Down

0 comments on commit 2dc6bd2

Please sign in to comment.