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

Added MeamFit code to pyiron_contrib #376

Merged
merged 21 commits into from
Sep 12, 2022
Merged

Added MeamFit code to pyiron_contrib #376

merged 21 commits into from
Sep 12, 2022

Conversation

usaikia
Copy link
Contributor

@usaikia usaikia commented Apr 10, 2022

MeamFit was available only in pyiron_mpie. Here I coped the code the from pyiron_mpie and added into pyiron_contrib with a minor modification to copy vasprun.xml files from previously finished vasp md jobs.

@coveralls
Copy link

coveralls commented Apr 10, 2022

Pull Request Test Coverage Report for Build 3036104244

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

Totals Coverage Status
Change from base Build 2997641014: 0.009%
Covered Lines: 901
Relevant Lines: 10170

💛 - Coveralls

@pmrv
Copy link
Contributor

pmrv commented Apr 11, 2022

I'll be back next week and have a detailed look then, but it already looks fine.

@jan-janssen
Copy link
Member

You still have to add the code to the job_class_dict https://github.com/pyiron/pyiron_contrib/blob/master/pyiron_contrib/__init__.py#L14

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.

Thanks @usaikia for moving it over, I think it'll be very useful!

Sorry for the nitty comments, but I'd like new code additions to be pretty good shape otherwise we'll never get around to it.

class MeamFit(GenericJob):
def __init__(self, project, job_name):
"""
ExampleJob generating a list of random numbers to simulate energy fluctuations.
Copy link
Contributor

@pmrv pmrv Apr 20, 2022

Choose a reason for hiding this comment

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

Needs to be updated. Ideally it would be a little example how to call everything.

pyiron_contrib/atomistics/meamfit/meamfit.py Outdated Show resolved Hide resolved
pyiron_contrib/atomistics/meamfit/meamfit.py Outdated Show resolved Hide resolved
time_step_start (int): initial timestep - after equilibration
time_step_end (int): last timestep to use
time_step_delta (int):
quantity (str): ['E', 'F'] for fitting the energies use 'E' and 'F' for fitting the forces
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the default not one of the allowed values?

time_step_end (int): last timestep to use
time_step_delta (int):
quantity (str): ['E', 'F'] for fitting the energies use 'E' and 'F' for fitting the forces
weight (list): default is one, but for lower temperatures use higher weights [100, 1000]
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the default of length three? What does it mean to use a weight >100-1000 if the default is 1? A link to the official documentation would be enough.

pyiron_contrib/atomistics/meamfit/meamfit.py Outdated Show resolved Hide resolved
Comment on lines 232 to 238
def _copy_vasprun_xml(self, cwd=None):
for job_id in self._calculation_dataframe.index:
self.project.load(job_id).decompress()
working_directory = self.project.get_job_working_directory(int(job_id))
shutil.copyfile(posixpath.join(working_directory, 'vasprun.xml'),
posixpath.join(cwd, self._get_vasprun_name(job_id)))
self.project.load(job_id).compress()
Copy link
Contributor

Choose a reason for hiding this comment

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

Move closer to write_input or even inline it.

pyiron_contrib/atomistics/meamfit/meamfit.py Outdated Show resolved Hide resolved
pyiron_contrib/atomistics/meamfit/meamfit.py Outdated Show resolved Hide resolved
pyiron_contrib/atomistics/meamfit/meamfit.py Outdated Show resolved Hide resolved
usaikia and others added 3 commits May 4, 2022 13:53
Add doc string and runtime error to from_directory(). Also fixed a small bug in _collect_potential_performance() which was also causing problem in collecting outputs.
@usaikia
Copy link
Contributor Author

usaikia commented Jun 15, 2022

@pmrv This pull request is complete from my side. Please have a look. If you agree, I will merge it.

write ‘Fr’ or ‘Fo’ for the second and third cases respectively.
weight (list): default is [1.0, 0.0, 0.0].

More information on these parameters are available in the MeamFit user manual- https://www.scd.stfc.ac.uk/Pages/MEAMfit-v2.aspx
Copy link
Contributor

Choose a reason for hiding this comment

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

I cannot find a manual under the given link. Is it not public?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The manual is not available publicly. In order to use the code users has to ask for permission individually from Andrew Ian Duff ([email protected])​​. Andrew send the code and manual to the user with permission to use the code.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, then let's just put a comment to that effect into the main docstring of the class.

@pmrv
Copy link
Contributor

pmrv commented Sep 12, 2022

I've made some small changes. @usaikia Can you double check everything still works? Except for the manual link everything seems good to go for me. If the manual is not available publically, just remove the link and merge.

@pmrv
Copy link
Contributor

pmrv commented Sep 12, 2022

There should also be a reference to the MEAMFit paper: https://www.sciencedirect.com/science/article/pii/S0010465515001964#f000020
Here's an example of how to do that:

remove link to manual as it is not available publicly and add reference to MeamFit paper.
@usaikia usaikia merged commit 72b6888 into master Sep 12, 2022
@delete-merged-branch delete-merged-branch bot deleted the meamfit branch September 12, 2022 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants