File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 22# pylint: disable=missing-docstring
33from unittest import TestCase
44
5+ import time
6+
7+ import numpy as np
8+
59from Orange .data import Table
610from Orange .statistics .basic_stats import DomainBasicStats , BasicStats
711
@@ -24,6 +28,15 @@ def test_domain_basic_stats(self):
2428 self .assertStatsEqual (domain_stats .stats ,
2529 attr_stats + class_var_stats + meta_stats )
2630
31+ def test_speed (self ):
32+ n , m = 10 , 10000
33+ data = Table .from_numpy (None , np .random .rand (n , m ))
34+ start = time .time ()
35+ for i in range (m ):
36+ BasicStats (data , i )
37+ elapsed = time .time () - start
38+ self .assertLess (elapsed , 10.0 )
39+
2740 def assertStatsEqual (self , stats1 , stats2 ):
2841 self .assertEqual (len (stats1 ), len (stats2 ))
2942 for stat1 , stat2 in zip (stats1 , stats2 ):
You can’t perform that action at this time.
0 commit comments