Closed jan-janssen closed 4 months ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
pyiron_atomistics/vasp/potential.py | 5 | 7 | 71.43% | ||
pyiron_atomistics/vasp/base.py | 22 | 27 | 81.48% | ||
<!-- | Total: | 67 | 74 | 90.54% | --> |
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
pyiron_atomistics/vasp/structure.py | 4 | 97.98% | ||
pyiron_atomistics/vasp/base.py | 72 | 66.36% | ||
<!-- | Total: | 76 | --> |
Totals | |
---|---|
Change from base Build 9438715818: | -0.02% |
Covered Lines: | 10680 |
Relevant Lines: | 15007 |
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
pyiron_atomistics/vasp/potential.py | 5 | 7 | 71.43% | ||
pyiron_atomistics/vasp/base.py | 16 | 21 | 76.19% | ||
<!-- | Total: | 61 | 68 | 89.71% | --> |
Totals | |
---|---|
Change from base Build 9438715818: | -0.02% |
Covered Lines: | 10680 |
Relevant Lines: | 15007 |
This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
pyiron_atomistics/vasp/base.py | 23 | 25 | 92.0% | ||
pyiron_atomistics/vasp/potential.py | 5 | 7 | 71.43% | ||
<!-- | Total: | 68 | 72 | 94.44% | --> |
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
pyiron_atomistics/dft/bader.py | 4 | 92.73% | ||
pyiron_atomistics/vasp/base.py | 214 | 66.03% | ||
<!-- | Total: | 218 | --> |
Totals | |
---|---|
Change from base Build 9438715818: | -0.02% |
Covered Lines: | 10681 |
Relevant Lines: | 15009 |
@samwaseda As we already discussed a very similar pull request for LAMMPS https://github.com/pyiron/pyiron_atomistics/pull/1446 I just added you as an additional reviewer here.
This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
pyiron_atomistics/vasp/base.py | 23 | 25 | 92.0% | ||
pyiron_atomistics/vasp/potential.py | 5 | 7 | 71.43% | ||
<!-- | Total: | 68 | 72 | 94.44% | --> |
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
pyiron_atomistics/dft/bader.py | 4 | 92.73% | ||
pyiron_atomistics/vasp/base.py | 214 | 66.03% | ||
<!-- | Total: | 218 | --> |
Totals | |
---|---|
Change from base Build 9438715818: | -0.02% |
Covered Lines: | 10681 |
Relevant Lines: | 15009 |
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
pyiron_atomistics/vasp/base.py | 23 | 25 | 92.0% | ||
pyiron_atomistics/vasp/potential.py | 5 | 7 | 71.43% | ||
<!-- | Total: | 68 | 72 | 94.44% | --> |
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
pyiron_atomistics/vasp/base.py | 3 | 66.03% | ||
<!-- | Total: | 3 | --> |
Totals | |
---|---|
Change from base Build 9450521916: | -0.02% |
Covered Lines: | 10681 |
Relevant Lines: | 15009 |
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
pyiron_atomistics/vasp/base.py | 23 | 25 | 92.0% | ||
pyiron_atomistics/vasp/potential.py | 5 | 7 | 71.43% | ||
<!-- | Total: | 68 | 72 | 94.44% | --> |
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
pyiron_atomistics/vasp/base.py | 3 | 66.03% | ||
<!-- | Total: | 3 | --> |
Totals | |
---|---|
Change from base Build 9450521916: | -0.02% |
Covered Lines: | 10681 |
Relevant Lines: | 15009 |
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
pyiron_atomistics/vasp/potential.py | 5 | 7 | 71.43% | ||
pyiron_atomistics/vasp/base.py | 17 | 22 | 77.27% | ||
<!-- | Total: | 62 | 69 | 89.86% | --> |
Totals | |
---|---|
Change from base Build 9477094720: | -0.02% |
Covered Lines: | 10695 |
Relevant Lines: | 15025 |
Define a calculate()
function which can be submitted using an pympipool.Executor
:
from pympipool import Executor
import os
import posixpath
import shutil
import subprocess
from pyiron_atomistics import Project
from pyiron_atomistics.vasp.output import parse_vasp_output
def calculate_vasp(working_directory, input_file_dict, executable_dict, collect_output_kwargs):
os.makedirs(working_directory, exist_ok=True)
for file_name, content in input_file_dict["files_to_create"].items():
with open(os.path.join(working_directory, file_name), "w") as f:
f.writelines(content)
for file_name, source in input_file_dict["files_to_copy"].items():
shutil.copy(source, os.path.join(working_directory, file_name))
_ = subprocess.run(
executable_dict["command"],
cwd=working_directory,
shell=executable_dict["shell"],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
universal_newlines=True,
check=True,
)
return parse_vasp_output(
working_directory=working_directory,
**collect_output_kwargs,
)
pr = Project("test")
pr.remove_jobs(recursive=True, silently=True)
job = pr.create.job.Vasp("vasp")
job.structure = pr.create.structure.ase.bulk("Al", cubic=True)
job.validate_ready_to_run()
executable, shell = job.executable.get_input_for_subprocess_call(
cores=job.server.cores, threads=job.server.threads, gpus=job.server.gpus
)
with Executor(backend="mpi") as exe:
future = exe.submit(
calculate_vasp,
working_directory="tmp",
input_file_dict=job.get_input_file_dict(),
executable_dict={
"command": executable,
"shell": shell,
},
collect_output_kwargs={
"sorted_indices": job.sorted_indices,
"structure": job.structure,
},
)
output_dict = future.result()
job._python_only_job = True
job.save()
job._store_output(output_dict=output_dict)
job_reload = pr.load(job.job_name)
print(job_reload.output.energy_pot)
Waiting for https://github.com/pyiron/pyiron_base/pull/1472
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
pyiron_atomistics/vasp/potential.py | 5 | 7 | 71.43% | ||
pyiron_atomistics/vasp/base.py | 22 | 26 | 84.62% | ||
<!-- | Total: | 67 | 73 | 91.78% | --> |
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
pyiron_atomistics/vasp/base.py | 17 | 61.73% | ||
pyiron_atomistics/lammps/output.py | 21 | 87.18% | ||
pyiron_atomistics/lammps/interactive.py | 22 | 45.59% | ||
pyiron_atomistics/lammps/base.py | 73 | 79.85% | ||
<!-- | Total: | 133 | --> |
Totals | |
---|---|
Change from base Build 9609409415: | -0.1% |
Covered Lines: | 10676 |
Relevant Lines: | 15023 |
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
pyiron_atomistics/vasp/potential.py | 5 | 7 | 71.43% | ||
pyiron_atomistics/vasp/base.py | 22 | 26 | 84.62% | ||
<!-- | Total: | 67 | 73 | 91.78% | --> |
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
pyiron_atomistics/vasp/base.py | 17 | 61.73% | ||
<!-- | Total: | 17 | --> |
Totals | |
---|---|
Change from base Build 9609409415: | -0.1% |
Covered Lines: | 10677 |
Relevant Lines: | 15026 |
The
get_input_file_dict()
returns a dictionary with the following structure:With this unification the
write_input()
function can be replace with a standardised function for all codes: