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

[BUG] Python 3.9, Python 3.10 nan result on test_compute_differential_operator_integrals_multiarray #154

Closed
Ali-Tehrani opened this issue Jan 11, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Ali-Tehrani
Copy link
Collaborator

Ali-Tehrani commented Jan 11, 2024

Describe the bug

While I'm trying to set up github actions to use pytest. I've came across an error on ubuntu systems for only python 3.9, python 3.10, python=3.11 and for windows system, python=3.9,3.10,3.11. It passes on my own system and python=3.7

The test is test_compute_differential_operator_integrals_multiarray in test_diff_operator_int.

It seems that they both return nans. Note this requires to fix the test as done in #151
Python=3.7, I'll get the following value: order, angmom_a, angmom_b:
[3 0 0] [2 1 0] [2 0 0] -0.0007958223786576885
Python-3.10, I'm getting this array to be all infinity and nans

The error comes from teh normalization factor calculated in

norm_a = np.prod(

which comes from the factorial2

To Reproduce

conda create -n py310 python=3.10
conda activate py310
pip install .
pytest -v .

Expected behaviour

Screenshots

See the run: https://github.com/theochem/gbasis/actions/runs/7491475696/job/20392775547?pr=151

         for i, single_order in enumerate(orders_diff):
            for j, angmom_a in enumerate(angmoms_a):
                for k, angmom_b in enumerate(angmoms_b):
>                   assert np.allclose(
                        _compute_differential_operator_integrals(
                            np.array([single_order]),
                            coord_a,
                            np.array([angmom_a]),
                            exps_a,
                            coeffs_a,
                            norm_a,
                            coord_b,
                            np.array([angmom_b]),
                            exps_b,
                            coeffs_b,
                            norm_b,
                        )[0, 0, j, 0, k],
                        test[i, 0, j, 0, k]
                    )
E                   assert False
E                    +  where False = <function allclose at 0x7fe17171d4b0>(nan, nan)
E                    +    where <function allclose at 0x7fe17171d4b0> = np.allclose

System Information:

  • OS:
  • Python version:
  • NumPy version:
  • SciPy version:

Additional context

@Ali-Tehrani Ali-Tehrani added the bug Something isn't working label Jan 11, 2024
@Ali-Tehrani
Copy link
Collaborator Author

Fixed the bug, the factorial2 from gbasis.utils wasn't being used. So it is the same problem as before

@PaulWAyers
Copy link
Member

I'll close the issue, as it seems OK. Good to remember as there seems to be some (not entirely relevant, it seems, though) recent progress on scipy.special.factorial2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants