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

Inputs - JDFTx IO Module #4189

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

benrich37
Copy link

@benrich37 benrich37 commented Nov 21, 2024

Summary

Major changes:

  • feature 1: inputs.py module containing JDFTXInfile class to give pythonic representation to the inputs for a JDFTx calculation
  • feature 2: "helper" module generic_tags.py holding "Tag" objects (AbstractTag and inheritors of AbstractTag) to represent the different data structures JDFTx expects for inputs
  • feature 3: "helper" module jdftxinfile_master_format.py to create proper "Tag" objects for input tags
  • feature 4: "helper" module jdftxinfile_ref_options.py to hold lists of acceptable input strings for different input tags (ie list of acceptable XC functionals for the tag "elec-ex-corr")

@benrich37 benrich37 mentioned this pull request Nov 22, 2024
benrich37 and others added 8 commits November 25, 2024 16:52
…ut calling `.items()`) - This does not appear in my local pre-commit (which I believe is running correctly) but started causing the "lint" action to fail starting around 11/22 (along with other failures from unrelated pre-existing parts of pymatgen)
… "as_dict" method that passes through the __setitem__ method so that the values within the dictionary fed to "as_dict" can be as flexible as the values set explicitly by the user (also made minor updates to __setitem__ to handle setting multiple values for repeatable tags better)
…e validation methods to AbstractTag for validations that are called multiple times, cleaned up cluttered tests and added comments to make it more clear what is being tested
@computron
Copy link
Member

@mkhorton , are you OK with merging this change?

@shyuep I am not sure why some of the optional checks are not running, I started the tests a couple of days ago.

Looks like all changes are restricted to the io/jdftx module, so not much likelihood of things breaking

@mkhorton mkhorton enabled auto-merge (squash) December 19, 2024 05:33
@mkhorton
Copy link
Member

Thanks for your patience with this one, long PRs adding a big new feature are always more difficult to review. I think this nicely self-contained and is in good shape to merge in. We can save further improvements for follow-up PRs that we can review/merge more quickly, and we can take the same approach with #4190 too.

One thing that wasn't obvious to me, why the /tmp directory in the test files? I couldn't see where it was used in the diff.

@benrich37
Copy link
Author

benrich37 commented Dec 20, 2024

Thanks for your patience with this one, long PRs adding a big new feature are always more difficult to review. I think this nicely self-contained and is in good shape to merge in. We can save further improvements for follow-up PRs that we can review/merge more quickly, and we can take the same approach with #4190 too.

One thing that wasn't obvious to me, why the /tmp directory in the test files? I couldn't see where it was used in the diff.

Awesome thank you! Sorry for the new push - had a minor bug from inconsistent tracking of units. And the tmp directory is used to hold files that are created and deleted during the tests (ie testing that an input file can be written and then read correctly). I thought it would make the tests run quicker to have the directory exist permanently instead of created when needed but I can change that if the alternative is better.

Edit: The new push is actually restricted to #4078 -

We can save further improvements for follow-up PRs that we can review/merge more quickly

So edits for minor bugs I should keep within #4078 and leave #4189 and #4190 untouched, right?

@mkhorton
Copy link
Member

I thought it would make the tests run quicker to have the directory exist permanently instead of created when needed but I can change that if the alternative is better.

It'd be better to remove it :) Creating a directory doesn't take much time, and might add some confusion to others to see it there. Tests should do "set up" and "tear down" as needed.

So edits for minor bugs I should keep within #4078 and leave #4189 and #4190 untouched, right?

As long as you merge in changes from the main branch (or rebase) #4078 once #4189 and #4190 are merged, or you can create new PRs. Either way is fine, I will try and be responsive!

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.

3 participants