-
Notifications
You must be signed in to change notification settings - Fork 5
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
Implemented atomic representation for a single element type and valence electron only representation #39
Conversation
YAY-C
commented
May 2, 2024
- Fix element types ordering (moved to func)
- Fix output name for singlet open-shell
- implemented single atom type rep generation
- Implemented valence-onyl atom density rep
- Fixed argument passing
- Refix argument-passing bug in 5653500
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 need tests!
I added test units for the developped features within |
Sorry forgot to push the test-data, tests should be fine now |
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 get these lines:
if valence_only:
a_dm1[start:stop,start:stop] = 0
- if in
test_water_single_element()
removeonly_z=['O']
the test still passes
I explicitly check for the array |
cool thanks |
maybe remove the wrong valence only and have it in another pr? if we even need it |
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.
maybe remove the wrong valence only and have it in another pr? if we even need it
I moved all the changes for the valence stuff (now in #44),
and kept the single-element stuff in here.
I also added a few changes to get the ecp
parameter from the CLI parser
.
Should it be in a different PR?
I just realized I should do the same for spahm-b, let me know if you want both in a new PR! And I was thinking maybe in the |
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.
maybe this
for j,i in enumerate(only_i):
q = mol.elements[i]
v = rep[j]
can be replaced with this
for q, v in zip(mol.elements[only_i], rep):
which is easier to read and more similar to the previous version
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.
maybe even a one liner
mrep = [np.array((q, v), dtype=object) for q, v in zip(mol.elements[only_i], rep)]
but not sure about readability
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 liked the one line. but it doesn't work cause mol.elements
is a list
and not a numpy.array
so you can not subscript it with a list of integers.
the intermediate option does not work neither then!
I can create a copy of mol.elements
in a numpy.array
and go for the oneliner, but it feels a bit like an overhead.
what do you think?
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'd put zip(np.array(mol.elements)[only_i], rep)]
lol
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 just don't like j,i
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.
ahah sure! Done 👌
yes to both! but yeah probably this ecp stuff should be separate |
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.
maybe even a one liner
mrep = [np.array((q, v), dtype=object) for q, v in zip(mol.elements[only_i], rep)]
but not sure about readability
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.
- feels like less trouble to leave it like this:
for j,i in enumerate(only_i):
q = mol.elements[i]
v = rep[j]
- and I moved the ECP changes to a new issue/branch Add ecp arguments to main() function and CLI parser #48
at this point there's so many commits and reverts that I'd squash and merge rather than merge |
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.
sinlge-line code
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.
ahah sure! Done 👌
agreed, "17 commits" sounds too much for so few changes in the end! I have never done it though, you wan to do it? |