@@ -45,8 +45,8 @@ def test_numerical_hf_data_h():
4545 sp = load ("H" , 0 , 2 , dataset = "numeric" , datapath = TEST_DATAPATH )
4646
4747 # check shape radial grid and total density arrays
48- assert sp ._data .rs . shape == ( 1000 , )
49- assert sp ._data .dens_tot .shape == sp . _data . rs . shape
48+ npoints = len ( sp ._data .rs )
49+ assert sp ._data .dens_tot .shape == ( npoints ,)
5050
5151 # check radial grid and total density arrays values
5252 assert all (sp ._data .rs >= 0.0 )
@@ -81,8 +81,8 @@ def test_numerical_hf_data_h_anion():
8181 assert_almost_equal (sp .energy , - 0.487929734301232 , decimal = 10 )
8282
8383 # check shape radial grid and total density arrays
84- assert sp ._data .rs . shape == ( 1000 , )
85- assert sp ._data .dens_tot .shape == sp . _data . rs . shape
84+ npoints = len ( sp ._data .rs )
85+ assert sp ._data .dens_tot .shape == ( npoints ,)
8686
8787 # reference radial values sample and corresponding indices
8888 ref_rs = np .array (
@@ -135,7 +135,7 @@ def test_numerical_hf_energy_especies(atom, mult, energy):
135135
136136
137137@pytest .mark .parametrize (
138- "atom, mult, npoints, nelec" , [("Be" , 1 , 1000 , 4.0 ), ("Cl" , 2 , 1000 , 17.0 ), ("Ne" , 1 , 1000 , 10.0 )]
138+ "atom, mult, npoints, nelec" , [("Be" , 1 , 146 , 4.0 ), ("Cl" , 2 , 164 , 17.0 ), ("Ne" , 1 , 151 , 10.0 )]
139139)
140140def test_numerical_hf_atomic_density (atom , mult , npoints , nelec ):
141141 # load atomic and density data
@@ -230,6 +230,7 @@ def test_numerical_hf_density_laplacian(atom, charge, mult):
230230 ref_lapl = np .load (f"{ TEST_DATAPATH } /numeric/db/{ fname } " )
231231
232232 # check interpolated Laplacian of density values against reference values
233- assert np .allclose (laplacian_dens , ref_lapl , atol = 1e-10 )
233+ meaningful_length = len (ref_lapl )
234+ assert np .allclose (laplacian_dens [:meaningful_length ], ref_lapl , atol = 1e-10 )
234235 # for r=0, the Laplacian function in not well defined and is set to zero
235236 assert np .allclose (laplacian_dens [0 ], [0.0 ], atol = 1e-10 )
0 commit comments