Coverage for src/python/ensembl/vep/config/sections/stats/stats.py: 100%
13 statements
« prev ^ index » next coverage.py v7.17.2, created at 2026-11-18 14:41 +0000
« 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"""Statistics and profiling options."""
16from __future__ import annotations
18from pathlib import Path
19from typing import ClassVar
21from attrs import define, field
23from ensembl.vep.config.option_spec import option
24from ensembl.vep.config.sections.base import ConfigSection
26__all__ = ["StatsConfig"]
29@define(frozen=True, kw_only=True, auto_attribs=True)
30class StatsConfig(ConfigSection):
31 """What ``vep stats`` reads and what it writes.
33 Attributes:
34 output_file (Path | None): Report path, or None for stdout.
35 output_format (str): Report format. Distinct from ``--format``, which is the input
36 format of the file it summarises.
37 profile (bool): Also collect the fact-level profile. This one genuinely costs -- it wraps
38 every fact's compute function -- so it is never on by default.
39 """
41 section_name: ClassVar[str] = "stats"
43 output_file: Path | None = field(default=None, metadata=option("report output file"))
44 output_format: str = field(
45 default="html", metadata=option("report format", choices=("html", "text", "json"))
46 )
47 profile: bool = field(default=False, metadata=option("collect fact-level profiling (slower)"))