@@ -91,7 +91,7 @@ def test_compute_stats_from_redu_with_assigned_bias(self) -> None:
9191 )
9292
9393 def test_compute_stats_do_not_distinguish_types_intensive (self ) -> None :
94- """Test compute_stats_property function with intensive scenario."""
94+ """Test compute_stats_do_not_distinguish function with intensive scenario."""
9595 bias , std = compute_stats_do_not_distinguish_types (
9696 self .output_redu , self .natoms , intensive = True
9797 )
@@ -110,7 +110,7 @@ def test_compute_stats_do_not_distinguish_types_intensive(self) -> None:
110110 )
111111
112112 def test_compute_stats_do_not_distinguish_types_extensive (self ) -> None :
113- """Test compute_stats_property function with extensive scenario."""
113+ """Test compute_stats_do_not_distinguish function with extensive scenario."""
114114 bias , std = compute_stats_do_not_distinguish_types (
115115 self .output_redu , self .natoms
116116 )
@@ -142,6 +142,35 @@ def test_compute_stats_do_not_distinguish_types_extensive(self) -> None:
142142 rtol = 1e-7 ,
143143 )
144144
145+ def test_compute_stats_from_redu_intensive (self ) -> None :
146+ """Test compute_stats_from_redu function with intensive scenario."""
147+ bias , std = compute_stats_from_redu (
148+ self .output_redu , self .natoms , intensive = True ,
149+ )
150+ # Test shapes
151+ assert bias .shape == (len (self .mean ), self .output_redu .shape [1 ])
152+ assert std .shape == (self .output_redu .shape [1 ],)
153+
154+ # Test values
155+ np .testing .assert_allclose (
156+ bias ,
157+ np .array (
158+ [
159+ [8926338.68432182 , 8750110.71559034 , 2045325.12109175 , 1392024.84192495 , 6714978.25878314 ],
160+ [554163.59820041 , 5965821.3924394 , 2171555.69509784 , 8050760.64873761 , 5277414.78728998 ],
161+ [9180265.02004177 , 6836013.36530394 , 9121797.79540738 , 7801570.3259364 , 4095707.84597587 ]
162+ ]
163+ ),
164+ rtol = 1e-6 ,
165+ )
166+ np .testing .assert_allclose (
167+ std ,
168+ np .array (
169+ [0.01700638 , 0.01954897 , 0.02028186 , 0.01074124 , 0.02025821 ]
170+ ),
171+ rtol = 1e-6 ,
172+ )
173+
145174 def test_compute_stats_from_atomic (self ) -> None :
146175 bias , std = compute_stats_from_atomic (self .output , self .atype )
147176 np .testing .assert_allclose (bias , self .mean )
0 commit comments