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

Refactor Vasp output classes #1426

Merged
merged 5 commits into from
Jun 7, 2024
Merged

Refactor Vasp output classes #1426

merged 5 commits into from
Jun 7, 2024

Conversation

pmrv
Copy link
Contributor

@pmrv pmrv commented May 24, 2024

The vasp.interactive sub module defined subclasses that did not change the functionality of the base classes. As far as I can tell they were not used except in VaspInteractive.interactive_close, so I have removed them but left the imports in place in case any HDF5 files still refer to them.

@pmrv pmrv requested a review from ligerzero-ai May 24, 2024 14:40
@coveralls
Copy link

Pull Request Test Coverage Report for Build 9225747625

Details

  • 4 of 4 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.08%) to 71.101%

Totals Coverage Status
Change from base Build 9181543489: 0.08%
Covered Lines: 10626
Relevant Lines: 14945

💛 - Coveralls

@jan-janssen
Copy link
Member

jan-janssen commented May 24, 2024

I think that is a very reasonable suggestion, originally there was:

    def to_hdf(self, hdf):
        """
        Save the object in a HDF5 file
        Args:
            hdf (pyiron_base.objects.generic.hdfio.ProjectHDFio): HDF path to which the object is to be saved
        """
        with hdf.open("dft") as hdf_dft:
            # hdf_go["description"] = self.description
            for key, val in self.log_dict.items():
                if isinstance(val, list) or isinstance(val, np.ndarray):
                    hdf_dft[key] = val[:-1]
                else:
                    hdf_dft[key] = val

This was then fixed around five years ago f2d6e66 and afterwards nobody cleaned it up.

@@ -2026,6 +2026,7 @@ def __init__(self):
self.outcar = Outcar()
self.oszicar = Oszicar()
self.generic_output = GenericOutput()
self.dft_output = DFTOutput()
Copy link
Member

Choose a reason for hiding this comment

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

I feel this is not included in the to_dict() and from_dict() as the VASP base implementation stores the corresponding entries in Output.generic_output.dft_log_dict while the VASP interactive implementation uses Output.dft_output.log_dict.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure how it is handled, but the vasp.interactive.Output was literally not used as far as I could tell. When I create a test vasp job in a notebook (pr.create.job.Vasp) its job._output_parser object is the vasp.base.Output, only when VaspInteractive.interactive_close is called this was overwritten. I can test again with a "proper" interactive vasp job, though, in case there are any weird edge cases.

Copy link
Contributor

@ligerzero-ai ligerzero-ai left a comment

Choose a reason for hiding this comment

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

LGTM, up to you to see if edge cases exist, but I don't think it's worth the time.

@pmrv pmrv added the integration Start the notebook integration tests for this PR label Jun 6, 2024
@pmrv
Copy link
Contributor Author

pmrv commented Jun 7, 2024

Test failure discussed in #1444, merging anyway.

@pmrv pmrv merged commit 9ea7b60 into main Jun 7, 2024
26 of 28 checks passed
@pmrv pmrv deleted the vasp branch June 7, 2024 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration Start the notebook integration tests for this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants