Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LAMMPS: Implement calculate() function #1446

Merged
merged 28 commits into from
Jun 21, 2024
Merged

LAMMPS: Implement calculate() function #1446

merged 28 commits into from
Jun 21, 2024

Conversation

jan-janssen
Copy link
Member

@jan-janssen jan-janssen commented Jun 10, 2024

Switch the LAMMPS job to the calculate() function as it is introduced in pyiron/pyiron_base#1477 . The pull request is expected to fail until pyiron/pyiron_base#1477 is merged.

With these new changes it is possible to evaluate LAMMPS jobs as functions. For a classical LAMMPS job you would use:

from pyiron_atomistics import Project

pr = Project("test")
job = pr.create.job.Lammps("lmp")
job.structure = pr.create.structure.ase.bulk("Al", cubic=True)
job.run()

This still works, but in addition you can also use an external executor:

from pyiron_atomistics import Project
from concurrent.futures import ProcessPoolExecutor

pr = Project("test")
job = pr.create.job.Lammps("lmp")
job.structure = pr.create.structure.ase.bulk("Al", cubic=True)

with ProcessPoolExecutor() as exe:
    fs = exe.submit(job.get_calculate_function(), **job.calculate_kwargs)
    shell_output, output_dict, job_crashed = fs.result()

job.save_output(output_dict=output_dict, shell_output=shell_output)

@jan-janssen jan-janssen added the format_black reformat the code using the black standard label Jun 10, 2024
@coveralls
Copy link

coveralls commented Jun 10, 2024

Pull Request Test Coverage Report for Build 9444291497

Details

  • 13 of 13 (100.0%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.002%) to 71.187%

Files with Coverage Reduction New Missed Lines %
pyiron_atomistics/lammps/potential.py 2 62.5%
Totals Coverage Status
Change from base Build 9438715818: 0.002%
Covered Lines: 10678
Relevant Lines: 15000

💛 - Coveralls

"files_to_copy": files_to_copy,
}

def write_input(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this go to AtomisticGenericJob?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the corresponding pull request is already open on pyiron_base pyiron/pyiron_base#1472 .

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then why is a copy here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is primarily for historic reasons, this was the first pull request, before the one in pyiron_base. The copy is removed in #1451

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But doesn't it make more sense to not add it in the first place in this PR?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless a new version of base is released the tests fail without this temporary function.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with it, but it seems to me like a bigger evil to copy and paste lines of code only to be deleted in the next PR if the sole reason to do it is you want to merge it earlier, because it's gonna stay in the commit history and might confuse the future developers. Maybe someone like @pmrv or @liamhuber has an opinion?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samwaseda, what you are saying sounds perfectly reasonable to me. If this PR ought to depend on a PR in base, unless there is some pressing need to get it merged and released, just wait for what's needed to be available in base.

@coveralls
Copy link

coveralls commented Jun 11, 2024

Pull Request Test Coverage Report for Build 9471820921

Warning: This coverage report may be inaccurate.

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.

Details

  • 17 of 17 (100.0%) changed or added relevant lines in 1 file are covered.
  • 217 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.001%) to 71.184%

Files with Coverage Reduction New Missed Lines %
pyiron_atomistics/lammps/potential.py 2 62.5%
pyiron_atomistics/dft/bader.py 4 92.73%
pyiron_atomistics/vasp/base.py 211 66.1%
Totals Coverage Status
Change from base Build 9438715818: -0.001%
Covered Lines: 10679
Relevant Lines: 15002

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jun 12, 2024

Pull Request Test Coverage Report for Build 9476628334

Details

  • 17 of 17 (100.0%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.002%) to 71.184%

Files with Coverage Reduction New Missed Lines %
pyiron_atomistics/lammps/potential.py 2 62.5%
Totals Coverage Status
Change from base Build 9450521916: 0.002%
Covered Lines: 10679
Relevant Lines: 15002

💛 - Coveralls

@jan-janssen jan-janssen added format_black reformat the code using the black standard and removed format_black reformat the code using the black standard labels Jun 12, 2024
@coveralls
Copy link

coveralls commented Jun 12, 2024

Pull Request Test Coverage Report for Build 9476697150

Details

  • 17 of 17 (100.0%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.002%) to 71.184%

Files with Coverage Reduction New Missed Lines %
pyiron_atomistics/lammps/potential.py 2 62.5%
Totals Coverage Status
Change from base Build 9450521916: 0.002%
Covered Lines: 10679
Relevant Lines: 15002

💛 - Coveralls

@jan-janssen
Copy link
Member Author

jan-janssen commented Jun 12, 2024

This comment is no longer valid.

@jan-janssen jan-janssen marked this pull request as draft June 12, 2024 05:37
@jan-janssen
Copy link
Member Author

jan-janssen commented Jun 12, 2024

Waiting for pyiron/pyiron_base#1477

@coveralls
Copy link

coveralls commented Jun 12, 2024

Pull Request Test Coverage Report for Build 9477283041

Details

  • 19 of 19 (100.0%) changed or added relevant lines in 2 files are covered.
  • 50 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.002%) to 71.201%

Files with Coverage Reduction New Missed Lines %
pyiron_atomistics/lammps/potential.py 2 62.5%
pyiron_atomistics/lammps/output.py 19 87.18%
pyiron_atomistics/lammps/base.py 29 80.2%
Totals Coverage Status
Change from base Build 9477094720: 0.002%
Covered Lines: 10693
Relevant Lines: 15018

💛 - Coveralls

Copy link
Contributor

@pmrv pmrv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jan-janssen jan-janssen changed the title LAMMPS: Implement get_input_file_dict() LAMMPS: Implement calculate() function Jun 20, 2024
@jan-janssen jan-janssen added format_black reformat the code using the black standard and removed format_black reformat the code using the black standard labels Jun 20, 2024
pyiron-runner and others added 2 commits June 20, 2024 10:36
…alculate

# Conflicts:
#	pyiron_atomistics/lammps/base.py
@jan-janssen jan-janssen marked this pull request as ready for review June 21, 2024 04:46
@jan-janssen jan-janssen added format_black reformat the code using the black standard and removed format_black reformat the code using the black standard labels Jun 21, 2024
@coveralls
Copy link

coveralls commented Jun 21, 2024

Pull Request Test Coverage Report for Build 9609063823

Details

  • 73 of 106 (68.87%) changed or added relevant lines in 2 files are covered.
  • 4 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.008%) to 71.18%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pyiron_atomistics/lammps/output.py 4 5 80.0%
pyiron_atomistics/lammps/base.py 69 101 68.32%
Files with Coverage Reduction New Missed Lines %
pyiron_atomistics/lammps/base.py 1 79.85%
pyiron_atomistics/lammps/interactive.py 1 45.14%
pyiron_atomistics/lammps/potential.py 2 62.5%
Totals Coverage Status
Change from base Build 9608395794: -0.008%
Covered Lines: 10687
Relevant Lines: 15014

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jun 21, 2024

Pull Request Test Coverage Report for Build 9609156113

Details

  • 73 of 106 (68.87%) changed or added relevant lines in 2 files are covered.
  • 4 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.008%) to 71.18%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pyiron_atomistics/lammps/output.py 4 5 80.0%
pyiron_atomistics/lammps/base.py 69 101 68.32%
Files with Coverage Reduction New Missed Lines %
pyiron_atomistics/lammps/base.py 1 79.85%
pyiron_atomistics/lammps/interactive.py 1 45.14%
pyiron_atomistics/lammps/potential.py 2 62.5%
Totals Coverage Status
Change from base Build 9608395794: -0.008%
Covered Lines: 10687
Relevant Lines: 15014

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jun 21, 2024

Pull Request Test Coverage Report for Build 9609216747

Details

  • 73 of 106 (68.87%) changed or added relevant lines in 2 files are covered.
  • 4 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.008%) to 71.18%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pyiron_atomistics/lammps/output.py 4 5 80.0%
pyiron_atomistics/lammps/base.py 69 101 68.32%
Files with Coverage Reduction New Missed Lines %
pyiron_atomistics/lammps/base.py 1 79.85%
pyiron_atomistics/lammps/interactive.py 1 45.14%
pyiron_atomistics/lammps/potential.py 2 62.5%
Totals Coverage Status
Change from base Build 9608395794: -0.008%
Covered Lines: 10687
Relevant Lines: 15014

💛 - Coveralls

@jan-janssen jan-janssen merged commit 00177f7 into main Jun 21, 2024
23 of 24 checks passed
@jan-janssen jan-janssen deleted the lammps_calculate branch June 21, 2024 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
format_black reformat the code using the black standard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants