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

Add zero-electron species to gaussian dataset #138

Merged
merged 3 commits into from
Mar 3, 2025
Merged

Conversation

msricher
Copy link
Collaborator

Can I get your opinions on this, and if it's OK, I will add it for the other datasets as well.
(Currently the new test fails because the .msg file is not in the atomdbdata repo.)

@gabrielasd
Copy link
Collaborator

gabrielasd commented Feb 8, 2025

Yes, this seems a good solution to me give that making the change at the level of the atomdb.load function isn't as simple as it seemed. Thanks @msricher

Btw, I've compiled the proton using the updated run script; let me know and I'll upload it here (under test folder) so the tests can be ran.

@marco-2023
Copy link
Collaborator

Looks good to me.

@gabrielasd
Copy link
Collaborator

Just one comment, when I tried running the promolecule test for LiH, it failed; my impression is that the problem was on the side of the promolecule module, not that the zero-electron species was being generated incorrectly.

I'll upload the $H^+$ species so that thais can be verified. Maybe the decision is still to merge this change, and fix separately the issue with promolecule (if there is one, I may be wrong where the problem is)

@gabrielasd
Copy link
Collaborator

@marco-2023 I just added the proton file

Also, I had to comment L150 on the gitignore file to track this file added under test/data/gaussian/db. Maybe be should keep this line as it used to be (atomdb/datasets/*/db/) so we can track changes to the test msg files?

An here is the error I get when running the promolecule test module:
`
# Check that spin number and multiplicity are recovered
if mults is not None:

      assert np.allclose(sum(np.sign(m) * (abs(m) - 1) for m in mults), promol.nspin(), rtol=1e-7)

E assert False
E + where False = <function allclose at 0x7f6c9e262830>(np.int64(1), 0.5, rtol=1e-07)
E + where <function allclose at 0x7f6c9e262830> = np.allclose
E + and np.int64(1) = sum(<generator object test_make_promolecule.. at 0x7f6c798ee740>)
E + and 0.5 = nspin()
E + where nspin = <atomdb.promolecule.Promolecule object at 0x7f6c798e95e0>.nspin

atomdb/test/test_promolecule.py:212: AssertionError

`

@msricher
Copy link
Collaborator Author

I added a special case for computing intensive properties where zero-electron species may be present. It just calls out to _intensive_property_exclude_zero(...) instead of _intensive_property(...).

@msricher
Copy link
Collaborator Author

Now only the nist_data tests fail, which don't concern this PR.

@marco-2023
Copy link
Collaborator

@msricher I think the fix is good.
Regarding the failing tests, I don't know why they are failing, all tests pass on my pc after the merge.

@@ -146,8 +146,10 @@ cython_debug/
.spyproject
.vscode/

# Raw data files
atomdb/datasets/*/db/
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it was best to only exclude the .msg files under datasets from being tracked; imo we do need the ones under the test module.

Aside from this I also agree with the changes in this PR.

@gabrielasd
Copy link
Collaborator

@marco-2023 @msricher
I'll open a separate issue for the NIST tests that fail; to me there seem to be two (possibly related) sources of error

  • a change in the value of some constants from scipy.constants module for python versions > 3.9. For the AMU variable we use, the difference between versions is in the order of $10^{-6}$, which is roughly the error in the assertions that fail.
  • what is being returned by the attribute atmass of the instance of Species? The value of Elements[element].mass or that from Species._data.atmass which is likely compiled with python 3.9?

@gabrielasd gabrielasd mentioned this pull request Feb 26, 2025
2 tasks
@PaulWAyers
Copy link
Member

@marco-2023 @msricher and @gabrielasd is this pull request ready to merge now?

@msricher msricher merged commit a557cb6 into master Mar 3, 2025
2 of 9 checks passed
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.

4 participants