Skip to content
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

Merged
merged 18 commits into from
May 9, 2024

Conversation

YAY-C
Copy link
Contributor

@YAY-C 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

@YAY-C YAY-C requested a review from briling May 2, 2024 21:42
Copy link
Contributor

@briling briling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need tests!

@YAY-C
Copy link
Contributor Author

YAY-C commented May 3, 2024

I added test units for the developped features within test_spahm_a.py.

@YAY-C
Copy link
Contributor Author

YAY-C commented May 3, 2024

Sorry forgot to push the test-data, tests should be fine now

@YAY-C YAY-C requested a review from briling May 3, 2024 13:28
Copy link
Contributor

@briling briling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I don't get these lines:
        if valence_only:
            a_dm1[start:stop,start:stop] = 0
  1. if in test_water_single_element() remove only_z=['O'] the test still passes

@YAY-C
Copy link
Contributor Author

YAY-C commented May 6, 2024

  1. if in test_water_single_element() remove only_z=['O'] the test still passes

I explicitly check for the array shape within the test, that should fix the issue.

@briling
Copy link
Contributor

briling commented May 6, 2024

  1. if in test_water_single_element() remove only_z=['O'] the test still passes

I explicitly check for the array shape within the test, that should fix the issue.

cool thanks

@briling
Copy link
Contributor

briling commented May 6, 2024

maybe remove the wrong valence only and have it in another pr? if we even need it

@YAY-C YAY-C mentioned this pull request May 7, 2024
2 tasks
Copy link
Contributor Author

@YAY-C YAY-C left a 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?

@YAY-C YAY-C requested a review from briling May 7, 2024 08:30
@YAY-C
Copy link
Contributor Author

YAY-C commented May 7, 2024

I also added a few changes to get the ecp parameter from the CLI parser.

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 main() we should enforce and warn about the need for ecp argument when using minao with elements heavier than Y.
What do you think?

Copy link
Contributor

@briling briling May 7, 2024

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

Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahah sure! Done 👌

@briling
Copy link
Contributor

briling commented May 7, 2024

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 main() we should enforce and warn about the need for ecp argument when using minao with elements heavier than Y. What do you think?

yes to both! but yeah probably this ecp stuff should be separate

Copy link
Contributor

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

This reverts commit 811d0bf.
Moves to new issue (#48)
Copy link
Contributor Author

@YAY-C YAY-C left a 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]

@YAY-C YAY-C requested a review from briling May 8, 2024 16:21
@YAY-C YAY-C self-assigned this May 8, 2024
@briling
Copy link
Contributor

briling commented May 8, 2024

at this point there's so many commits and reverts that I'd squash and merge rather than merge

Copy link
Contributor Author

@YAY-C YAY-C left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sinlge-line code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahah sure! Done 👌

@YAY-C
Copy link
Contributor Author

YAY-C commented May 9, 2024

at this point there's so many commits and reverts that I'd squash and merge rather than merge

agreed, "17 commits" sounds too much for so few changes in the end!

I have never done it though, you wan to do it?

@YAY-C YAY-C merged commit ec1d48c into master May 9, 2024
2 checks passed
@YAY-C YAY-C deleted the update_rho-spahm branch May 9, 2024 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants