-
Notifications
You must be signed in to change notification settings - Fork 3
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
Refactoring by p #72
Refactoring by p #72
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.
There is a missing file.
I really like the Enum adaptation of the level of theory.
Currently the branch doesn't pass most of the actions so it need some fixes.
@@ -61,7 +48,7 @@ def data_types(self): | |||
} | |||
|
|||
def __getitem__(self, idx: int): | |||
shift = IsolatedAtomEnergyFactory.max_charge | |||
shift = MAX_CHARGE |
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.
For the interaction dataset we don't really need the Isolated Atom Energies so we can rework the getitem method in case
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.
the code just give zeros isolated atom energies for all the interaction methods
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 all the Enums should be in a standalone python file enums.py
openqdc/methods/__init__.py
Outdated
|
||
|
||
class PotentialMethod(QmMethod): #SPLIT FOR INTERACTIO ENERGIES AND FIX MD17 | ||
B1LYP_VWN5_DZP = Functional.B1LYP_VWN5, BasisSet.DZP, 0 |
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.
While we can do more analysis on the cost of the methods, we can just have already a scale of cost with 0 being a SE, 1 DFT, 2 CCSD etc
openqdc/methods/__init__.py
Outdated
B3LYP_VWN5 = "b3lyp(vwn5)" | ||
B3LYP_S_VWN5 = "b3lyp*(vwn5)" | ||
B3LYPD = "b3lyp-d" | ||
B3LYP_D3_BJ = "b3lyp-d3(bj)" |
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.
As we are adding more structure I think we should separate the corrections from the functionals?
Example:
B3LYP_D3_BJ is a B3LYP functional with a dispersion correction (d3) + Becke Johnson damping (bj) correction
openqdc/methods/atom_energies.py
Outdated
with open(os.path.join(os.path.dirname(__file__), "atom_energies.txt")) as fd: | ||
atom_energy_collection = ast.literal_eval(fd.read()) | ||
atom_energy_collection = {k.lower():v for k, v in atom_energy_collection.items()} |
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.
"atom_energies.txt" file is currently missing.
Also, maybe json is easier to extend with new values?
# def test_is_at_factory(): | ||
# res = IsolatedAtomEnergyFactory.get("mp2/cc-pvdz") | ||
# assert len(res) == len(ISOLATED_ATOM_ENERGIES["mp2"]["cc-pvdz"]) | ||
# res = IsolatedAtomEnergyFactory.get("PM6") | ||
# assert len(res) == len(ISOLATED_ATOM_ENERGIES["pm6"]) | ||
# assert isinstance(res[("H", 0)], float) |
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.
The tests shouldn't be disabled but adapted
openqdc/methods/__init__.py
Outdated
from openqdc.methods.atom_energies import atom_energy_collection, to_e_matrix | ||
|
||
|
||
class QmType(StrEnum): |
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.
Where are we planning to use this Enum?
openqdc/methods/__init__.py
Outdated
|
||
|
||
class QmType(StrEnum): | ||
FF = "Empirical Force Field" |
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.
Just Force Field is enough
Just ran the pre-commit in my previous commit. @prtos If you push the |
# "sapt0/jun-cc-pV(D+d)Z_unscaled", #TODO: we need to pick the unscaled version only here | ||
# "sapt0/jun-cc-pV(D+d)Z_es_unscaled", | ||
# "sapt0/jun-cc-pV(D+d)Z_ex_unscaled", | ||
# "sapt0/jun-cc-pV(D+d)Z_ind_unscaled", | ||
# "sapt0/jun-cc-pV(D+d)Z_disp_unscaled", | ||
# "sapt0/jun-cc-pV(D+d)Z_scaled", | ||
# "sapt0/jun-cc-pV(D+d)Z_es_scaled", | ||
# "sapt0/jun-cc-pV(D+d)Z_ex_scaled", | ||
# "sapt0/jun-cc-pV(D+d)Z_ind_scaled", | ||
# "sapt0/jun-cc-pV(D+d)Z_disp_scaled", | ||
# "sapt0/aug-cc-pV(D+d)Z_unscaled", | ||
# "sapt0/aug-cc-pV(D+d)Z_es_unscaled", | ||
# "sapt0/aug-cc-pV(D+d)Z_ex_unscaled", | ||
# "sapt0/aug-cc-pV(D+d)Z_ind_unscaled", | ||
# "sapt0/aug-cc-pV(D+d)Z_disp_unscaled", | ||
# "sapt0/aug-cc-pV(D+d)Z_scaled", | ||
# "sapt0/aug-cc-pV(D+d)Z_es_scaled", | ||
# "sapt0/aug-cc-pV(D+d)Z_ex_scaled", | ||
# "sapt0/aug-cc-pV(D+d)Z_ind_scaled", | ||
# "sapt0/aug-cc-pV(D+d)Z_disp_scaled", |
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.
Can we get rid of these comments if there energy values aren't being used.
openqdc/methods/__init__.py
Outdated
from openqdc.methods.atom_energies import atom_energy_collection, to_e_matrix | ||
|
||
|
||
class QmType(StrEnum): |
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 QmType
the right word for this Enum? Given that there are Force Fields, Semi-Empirical keys under this.
openqdc/methods/__init__.py
Outdated
if __name__ == "__main__": | ||
for method in PotentialMethod: | ||
(str(method), len(method.atom_energies_dict)) |
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 suggest not having this __main__
code here, maybe you added this for testing. We can have a separate test for iterating through potential method?
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.
Minor comments, should be go to go if (necessary) tests are added and all tests pass. Just make sure to run pre-commit before you commit.
Just a 1 time cost,
pre-commit install
(to setup)pre-commit run --all-files
The next time you add and try to commit, this will automatically run.
…ry/openQDC into refactoring_by_P
py3.8 compatibility, manual fixes to atom energies, pkgutils + fixes on gh action tests
Fixes #65.
Checklist: