-
Notifications
You must be signed in to change notification settings - Fork 32
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
Fix missing stress unit conversion (kBar->eV/A^3) in json_to_extxyz.py
#61
Conversation
import col names from matbench_discovery.preds
for more information, see https://pre-commit.ci
…batch and run_train.py into train_mace.py and avoid shell scripts where possible. what about setup.sh?
remove dict deepcopy
9fad2fe
to
7ffaf4e
Compare
70fc8b3
to
7879647
Compare
bf61c88
to
627c705
Compare
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.
@chiang-yuan Thanks for noticing and submitting fix! 👍
models/mace/json_to_extxyz.py
Outdated
|
||
block = json_data[material_id][trajectory_id] | ||
for trajectory_id in json_data[material_id]: | ||
block = copy.deepcopy(json_data[material_id][trajectory_id]) |
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.
Is copy.deepcopy
really needed? This might slow down the conversion substantially. Is it to avoid errors on processing twice? Maybe better to keep a dict
that maps processed IDs to processed results. That way you can check in constant time whether you should skip an ID.
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.
since I use dict.pop the error will raise if size of dictionary changes within a for loop. copy will avoid that. The speed is doable for now it is roughly one hour processing time
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.
Always good to leave why comments in the code. Why are you doing something (if it's not obvious).
2nd question: Why are you using pop
? What's wrong with get
?
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.
we don’t want repeated forces, stress, magmoms, energy show up in atoms.info
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 don't follow. get
also returns None
?
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.
Yes, but get
will not remove the key value pair from the dictionary and those will all go into atoms.info
matbench-discovery/models/mace/json_to_extxyz.py
Lines 60 to 61 in af1d7ad
for key, value in block.items(): | |
atoms.info[key] = value |
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 see. Let's just use set
arithmetic to exempt those keys from double processing then.
json_to_extxyz.py
json_to_extxyz.py
No description provided.