Coverage for src/python/ensembl/vep/config/sections/bench/oracle.py: 100%

14 statements  

« prev     ^ index     » next       coverage.py v7.17.2, created at 2026-11-18 14:41 +0000

1# See the NOTICE file distributed with this work for additional information 

2# regarding copyright ownership. 

3# 

4# Licensed under the Apache License, Version 2.0 (the "License"); 

5# you may not use this file except in compliance with the License. 

6# You may obtain a copy of the License at 

7# http://www.apache.org/licenses/LICENSE-2.0 

8# 

9# Unless required by applicable law or agreed to in writing, software 

10# distributed under the License is distributed on an "AS IS" BASIS, 

11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 

12# See the License for the specific language governing permissions and 

13# limitations under the License. 

14"""Options for comparing against the Perl ``VariationEffect.pm`` oracle.""" 

15 

16from __future__ import annotations 

17 

18from pathlib import Path 

19from typing import ClassVar 

20 

21from attrs import define, field 

22 

23from ensembl.vep.config.option_spec import option 

24from ensembl.vep.config.sections.base import ConfigSection 

25 

26__all__ = ["BenchOracleConfig"] 

27 

28 

29@define(frozen=True, kw_only=True, auto_attribs=True) 

30class BenchOracleConfig(ConfigSection): 

31 """Where the Perl oracle lives, and what to compare against it. 

32 

33 Attributes: 

34 perl_modules (Path | None): ensembl-variation's ``modules`` directory. Without it the 

35 Python strategies are still compared against each other, and the Perl side is skipped 

36 with the reason. 

37 perl_oracle_script (Path): The oracle script. 

38 strategies (tuple[str, ...]): Strategies to compare, or empty for ``consequence.linear`` 

39 and, when built, ``consequence.columnar-kernels``. 

40 oracle_number (int): Workload executions per timed repeat. 

41 """ 

42 

43 section_name: ClassVar[str] = "bench_oracle" 

44 

45 perl_modules: Path | None = field(default=None, metadata=option("ensembl-variation modules directory")) 

46 perl_oracle_script: Path = field( 

47 default=Path("bench/variation_effect.pl"), metadata=option("the Perl oracle script") 

48 ) 

49 strategies: tuple[str, ...] = field( 

50 default=(), 

51 metadata=option("strategies to compare (default: linear and the kernels)", metavar="NAME,..."), 

52 ) 

53 oracle_number: int = field( 

54 default=200, metadata=option("workload executions per timed repeat", metavar="N") 

55 )