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

A workaround to fix reloading potentials with LAMMPS #1304

Merged
merged 7 commits into from
Feb 2, 2024

Conversation

jan-janssen
Copy link
Member

@jan-janssen jan-janssen commented Feb 2, 2024

The LammpsPotential class extends the GenericParameters class, so it requires extending the to_dict() and from_dict() methods.

Waiting for pyiron/pyiron_base#1304

@jan-janssen jan-janssen marked this pull request as draft February 2, 2024 16:56
@jan-janssen jan-janssen added the format_black reformat the code using the black standard label Feb 2, 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 Feb 2, 2024
@jan-janssen jan-janssen closed this Feb 2, 2024
@jan-janssen jan-janssen reopened this Feb 2, 2024
@jan-janssen jan-janssen marked this pull request as ready for review February 2, 2024 20:40
@jan-janssen
Copy link
Member Author

======================================================================
ERROR: test_Chemical_Element_to_and_from_hdf (atomic.structure.test_periodic_table.TestPeriodicTable)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/pyiron_atomistics/pyiron_atomistics/tests/atomic/structure/test_periodic_table.py", line 93, in test_Chemical_Element_to_and_from_hdf
    test_ham.from_hdf()
  File "/home/runner/work/pyiron_atomistics/pyiron_atomistics/pyiron_atomistics/lammps/interactive.py", line 499, in from_hdf
    super(LammpsInteractive, self).from_hdf(hdf=hdf, group_name=group_name)
  File "/home/runner/work/pyiron_atomistics/pyiron_atomistics/pyiron_atomistics/lammps/base.py", line 743, in from_hdf
    self.input.from_dict(
  File "/home/runner/work/pyiron_atomistics/pyiron_atomistics/pyiron_atomistics/lammps/base.py", line 1060, in from_dict
    self.potential.from_dict(data_dict["input"]["potential_inp"])
  File "/home/runner/work/pyiron_atomistics/pyiron_atomistics/pyiron_atomistics/lammps/potential.py", line 203, in from_dict
    entry_dict = {
  File "/home/runner/work/pyiron_atomistics/pyiron_atomistics/pyiron_atomistics/lammps/potential.py", line 204, in <dictcomp>
    key: [obj_dict["potential"][key]]
KeyError: 'Config'

======================================================================
ERROR: test_Chemical_Element_to_and_from_hdf_with_None_Parent (atomic.structure.test_periodic_table.TestPeriodicTable)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/pyiron_atomistics/pyiron_atomistics/tests/atomic/structure/test_periodic_table.py", line 112, in test_Chemical_Element_to_and_from_hdf_with_None_Parent
    test_ham.from_hdf()
  File "/home/runner/work/pyiron_atomistics/pyiron_atomistics/pyiron_atomistics/lammps/interactive.py", line 499, in from_hdf
    super(LammpsInteractive, self).from_hdf(hdf=hdf, group_name=group_name)
  File "/home/runner/work/pyiron_atomistics/pyiron_atomistics/pyiron_atomistics/lammps/base.py", line 743, in from_hdf
    self.input.from_dict(
  File "/home/runner/work/pyiron_atomistics/pyiron_atomistics/pyiron_atomistics/lammps/base.py", line 1060, in from_dict
    self.potential.from_dict(data_dict["input"]["potential_inp"])
  File "/home/runner/work/pyiron_atomistics/pyiron_atomistics/pyiron_atomistics/lammps/potential.py", line 203, in from_dict
    entry_dict = {
  File "/home/runner/work/pyiron_atomistics/pyiron_atomistics/pyiron_atomistics/lammps/potential.py", line 204, in <dictcomp>
    key: [obj_dict["potential"][key]]
KeyError: 'Config'

----------------------------------------------------------------------

@coveralls
Copy link

Pull Request Test Coverage Report for Build 7761636209

  • 0 of 19 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.008%) to 93.15%

Totals Coverage Status
Change from base Build 7755139528: 0.008%
Covered Lines: 14155
Relevant Lines: 15196

💛 - Coveralls

@jan-janssen jan-janssen merged commit b9c5f3f into main Feb 2, 2024
25 checks passed
@jan-janssen jan-janssen deleted the lammps_potential_dict branch February 2, 2024 21:36
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.

3 participants