-
Notifications
You must be signed in to change notification settings - Fork 918
JDFTXInfile
Comparison Methods
#4416
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
Merged
shyuep
merged 17 commits into
materialsproject:master
from
benrich37:jdftxinfile-is-comparable-to
May 23, 2025
Merged
JDFTXInfile
Comparison Methods
#4416
shyuep
merged 17 commits into
materialsproject:master
from
benrich37:jdftxinfile-is-comparable-to
May 23, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…arameters for JDFTx, unwritten `is_comparable_to` method for `JDFTXInfile`
…s format option for `MultiformatTag`s
…e set as a list with elements of different format options, changing `JDFTXStructure.get_str` to build a dictionary representation of each ion instead of a list (not sure how it was even working before)
…ity handler, and now `_is_equal_to` to the abstractmethod to be implemented which compares two non-list values
…e objects, along convenience arguments to filter which tags to pay attention to. Not sure if `is_comparable_to` is implementable in a way generalizable enough to be useful.
…y in implementations
… `JDFTXInfile.from_structure`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Major changes:
feature 1: Convenience methods for comparing
JDFTXInfile
objects--
JDFTXInfile.is_comparable_to
--- Returns True if at least one tag is found different
--- Optional arguments
exclude_tags
,exclude_tag_categories
,ensure_include_tags
to ignore certain tags in the comparison----
exclude_tag_categories
defaults to["export", "restart", "structure"]
as"export"
and"restart"
are very rarely pertinent to comparability,"structure"
as subtags of this category are generally the one thing being intentionally changed in comparisons (ie different local minima or a slab with/without an adsorbate)--
JDFTXInfile.get_filtered_differing_tags
--- What is used in
JDFTXInfile.is_comparable_to
to get filtered differing tags betweenJDFTXInfile
objects--- Convenient as a "verbose" alternative to
JDFTXInfile.is_comparable_to
--
AbstractTag.is_equal_to
andAbstractTag._is_equal_to
--- Used in tag comparison for finding differing tags
---
AbstractTag._is_equal_to
is an abstract method that must be implemented for eachAbstractTag
inheritorfeature 2: Default
JDFTXInfile
objectpymatgen.io.jdftx.inputs.ref_infile
-- Initialized from reading default JDFTx settings from
pymatgen.io.jdftx.jdftxinfile_default_inputs.default_inputs: dict
-- Used in
JDFTXInfile.get_differing_tags_from
for tags inself
missing fromother
that are identical to the default settingfix 1: Re-ordered contents of
JDFTXInfile
to follow the order: magic methods -> class methods / transformation methods -> validation methods -> properties -> private methodsfix 2: Checking for
'selective_dynamics'
insite_properties
for aStructure
passed inJDFTXInfile.from_structure
(used ifselective_dynamics
argument left asNone
)Todos
TagContainer
s to their default values-- The current implementation of comparison for tags to default values only works if the tag as written exactly matches the full default value - at the very least the missing subtags of a partially filled
TagContainer
needs to be filled with the default values before comparing to the full default value-- Some subtags also change depending on the other subtags present for a particular tag (ie convergence threshold depending on algorithm specified for
'fluid-minimize'
, so an improved mapping for dynamic default values needs to be implemented