File: bench_variable.py

package info (click to toggle)
orange3 3.40.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 15,908 kB
  • sloc: python: 162,745; ansic: 622; makefile: 322; sh: 93; cpp: 77
file content (19 lines) | stat: -rw-r--r-- 488 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from Orange.data import ContinuousVariable
from .base import Benchmark, benchmark


class BenchContinuous(Benchmark):

    # pylint: disable=no-self-use
    @benchmark()
    def bench_str_val_decimals(self):
        a = ContinuousVariable("a", 4)
        for _ in range(1000):
            a.str_val(1.23456)

    # pylint: disable=no-self-use
    @benchmark()
    def bench_str_val_g(self):
        a = ContinuousVariable("a")
        for _ in range(1000):
            a.str_val(1.23456)