-
Notifications
You must be signed in to change notification settings - Fork 0
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
Vasp mapping parser #3
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps @ndaelman-hu also wants to check this
mainfile_contents_re=( | ||
r'^\s*<\?xml version="1\.0" encoding="ISO-8859-1"\?>\s*?\s*<modeling>?\s*' | ||
r'<generator>?\s*<i name="program" type="string">\s*vasp\s*</i>?|' | ||
r'^\svasp[\.\d]+.+?(?:\(build|complex)[\s\S]+?executed on' | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would put the HDF5 parser above xml in the matching priority
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which hdf5 parser?
mainfile_mime_re='(application/.*)|(text/.*)', | ||
mainfile_name_re='.*[^/]*xml[^/]*', | ||
mainfile_alternative=True, | ||
supported_compressions=['gz', 'bz2', 'xz'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the compression support be specified at a higher level?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is in the correct place, in MatchingParser
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please explain why annotations have to be removed in the pydocs.
From the code below, I take that it removes the old key. But could one simply not call that key, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we do not add then remove the added annotations every time we call parse, the annotations from the other parsers will be picked up and may override our intended annotation if the same key is used. added doc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is mapping to the old schema, correct?
You can merge this, but I'll have to redo it for the new schema
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i am still targeting this branch 100-moving-simulation-workflow-definitions-to-this-repo
please advise which is the latest so I can make the necessary changes
def get_data(self, source: dict[str, Any], **kwargs) -> Any: | ||
if source.get(self.value_key): | ||
return source[self.value_key] | ||
path = kwargs.get('path') | ||
if path is None: | ||
return | ||
|
||
parser = Path(path=path) | ||
return parser.get_data(source) | ||
|
||
def get_forces(self, source: dict[str, Any]) -> dict[str, Any]: | ||
value = self.get_data(source, path='.varray.v') | ||
if value is None: | ||
return {} | ||
return dict(forces=value, npoints=len(value), rank=[3]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we still using this older style for extracting forces? Can't we use the mapping annotation here too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a bug for the def of forces i think so i have to define the rank directly here.
No description provided.