File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-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 numpy as np
6+ import time
7+
58from Orange .data import Table
69from Orange .statistics .basic_stats import DomainBasicStats , BasicStats
710
@@ -24,6 +27,15 @@ def test_domain_basic_stats(self):
2427 self .assertStatsEqual (domain_stats .stats ,
2528 attr_stats + class_var_stats + meta_stats )
2629
30+ def test_speed (self ):
31+ n , m = 10 , 10000
32+ data = Table .from_numpy (None , np .random .rand (n , m ))
33+ start = time .time ()
34+ for i in range (m ):
35+ s = data ._compute_basic_stats ([i ])
36+ elapsed = time .time () - start
37+ self .assertLess (elapsed , 10.0 )
38+
2739 def assertStatsEqual (self , stats1 , stats2 ):
2840 self .assertEqual (len (stats1 ), len (stats2 ))
2941 for stat1 , stat2 in zip (stats1 , stats2 ):
You can’t perform that action at this time.
0 commit comments