Skip to content

[WIP] Refactor QHACalc and PhononCalc#154

Open
rul048 wants to merge 4 commits intomaterialyzeai:mainfrom
rul048:fix/qha_ha
Open

[WIP] Refactor QHACalc and PhononCalc#154
rul048 wants to merge 4 commits intomaterialyzeai:mainfrom
rul048:fix/qha_ha

Conversation

@rul048
Copy link
Copy Markdown
Contributor

@rul048 rul048 commented Mar 4, 2026

Summary

Major changes:

Todos

  • Tests: Reference values in test_qha.py may need updating if the matgl model version differs from the one used to generate the original expected values.

Checklist

  • Google format doc strings added. Check with ruff.
  • Type annotations included. Check with mypy.
  • Tests added for new features/fixes.
  • If applicable, new classes/functions/modules have duecredit @due.dcite decorators to reference relevant papers by DOI.

t_max=self.t_max,
t_min=self.t_min,
relax_structure=False,
write_phonon=False,
Copy link
Copy Markdown
Contributor

@Andrew-S-Rosen Andrew-S-Rosen Mar 5, 2026

Choose a reason for hiding this comment

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

Hard coding write_phonon as False seems like it may not be ideal. What if the user wants to store the phonon properties (i.e. the YAML) out for each run to inspect the results later? Currently, there is no mechanism to do so. Of course, even if one were able to set it to True, we'd need to make sure there is no overwriting with each scale factor, so the scale factor would need to be appended to the filename or the files stored in a unique subdirectory to prevent overwriting. Also, if someone passes phonon_calc_kwargs={"write_phonon": True}, they will currently get an error.

I recognize the original code has write_phonon=False, so we can make that a separate issue report and address later if preferred, but since the I/O may influence the refactoring, I bring it up here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A similar comment may hold for the phonon_calc_kwargs, since specifying any of the file I/O flags to True will cause each scale factor to overwrite the files of the prior scale factor run I think.

@Andrew-S-Rosen
Copy link
Copy Markdown
Contributor

Andrew-S-Rosen commented Mar 7, 2026

There are many changes here (like to the test suite) that seem superfluous. Given the presence of several bugs in the original QHACalc, I remain a bit hesitant about the large number of cosmetic changes proposed here. Note that the proposed refactor conflicts with some of my important bug fix PRs, like #159.

Would it be possible to have the PR just fix #150 and #152?

@rul048
Copy link
Copy Markdown
Contributor Author

rul048 commented Mar 7, 2026

Thank you for the feedback. I will take your suggestion into careful consideration. I plan to first review and merge your bugfix PRs and then revisit the refactoring to make sure it does not conflict with those changes.

@Andrew-S-Rosen
Copy link
Copy Markdown
Contributor

Andrew-S-Rosen commented Mar 8, 2026

Alright, I am done with my major PRs for QHACalc with #163, #168, and #174. Thank you and sorry that it may have caused many conflicts with your PR here. I appreciate your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants