• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Ruberhauptmann / quant-met / 16403228399

20 Jul 2025 07:02PM UTC coverage: 37.347% (+0.7%) from 36.605%
16403228399

Pull #125

github

web-flow
Merge 17cb98f37 into b5a0f599e
Pull Request #125: Start q loop

3 of 55 branches covered (5.45%)

Branch coverage included in aggregate %.

62 of 120 new or added lines in 7 files covered. (51.67%)

45 existing lines in 5 files now uncovered.

180 of 435 relevant lines covered (41.38%)

1.24 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

36.84
/src/quant_met/cli/main.py
1
"""Command line interface."""
2

3
import logging
3✔
4
import sys
3✔
5
from typing import TextIO
3✔
6

7
import click
3✔
8
import yaml
3✔
9

10
from quant_met.parameters import Parameters
3✔
11

12
from .crit_temp import crit_temp
3✔
13
from .q_loop import q_loop
3✔
14
from .scf import scf
3✔
15

16
logger = logging.getLogger(__name__)
3✔
17

18

19
@click.command()
3✔
20
@click.argument("input-file", type=click.File("r"))
3✔
21
@click.option("--debug", is_flag=True, help="Enable debug logging.")
3✔
22
def cli(input_file: TextIO, *, debug: bool) -> None:
3✔
23
    """Command line interface for quant-met.
24

25
    Parameters
26
    ----------
27
    input_file: TextIO
28
        A file object containing YAML formatted parameters for the simulation.
29
    debug : bool
30
        If set, enables debug logging instead of the default info logging.
31

32
    This command reads the parameters from the specified file and runs the
33
    desired calculation based on the provided parameters.
34
    """
UNCOV
35
    if debug:
×
36
        logging.basicConfig(
×
37
            level=logging.DEBUG,
38
            format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
39
            stream=sys.stdout,
40
        )
UNCOV
41
        logger.setLevel(logging.DEBUG)
×
42
        logger.info("Debug logging is enabled.")
×
43
    else:
UNCOV
44
        logging.basicConfig(
×
45
            level=logging.INFO,
46
            format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
47
            stream=sys.stdout,
48
        )
49

UNCOV
50
    params = Parameters(**yaml.safe_load(input_file))
×
51
    logger.info("Loaded parameters successfully.")
×
52

UNCOV
53
    match params.control.calculation:
×
54
        case "scf":
×
55
            logger.info("Starting SCF calculation.")
×
56
            scf(params)
×
57
        case "crit-temp":
×
58
            logger.info("Starting T_C calculation.")
×
59
            crit_temp(params)
×
NEW
60
        case "q-loop":
×
NEW
61
            logger.info("Starting q-loop calculation.")
×
NEW
62
            q_loop(params)
×
63
        case _:
×
64
            logger.error("Calculation %s not found.", params.control.calculation)
×
65
            sys.exit(1)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc