Skip to content

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

@Ali-Tehrani

Description

@Ali-Tehrani

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions