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

Ruberhauptmann / quant-met / 16489119678

24 Jul 2025 06:05AM UTC coverage: 34.768% (-1.8%) from 36.605%
16489119678

Pull #125

github

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

3 of 67 branches covered (4.48%)

Branch coverage included in aggregate %.

92 of 226 new or added lines in 11 files covered. (40.71%)

23 existing lines in 2 files now uncovered.

207 of 537 relevant lines covered (38.55%)

1.16 hits per line

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

34.88
/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_analysis import q_analysis
3✔
14
from .q_loop import q_loop
3✔
15
from .scf import scf
3✔
16

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

19

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

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

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

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

54
    match params.control.calculation:
×
55
        case "scf":
×
56
            logger.info("Starting SCF calculation.")
×
57
            scf(params)
×
58
        case "crit-temp":
×
59
            logger.info("Starting T_C calculation.")
×
60
            crit_temp(params)
×
NEW
61
        case "q-loop":
×
NEW
62
            logger.info("Starting q-loop calculation.")
×
NEW
63
            q_loop(params)
×
NEW
64
        case "q-analysis":
×
NEW
65
            logger.info("Starting analysis of q data.")
×
NEW
66
            q_analysis(params)
×
67
        case _:
×
68
            logger.error("Calculation %s not found.", params.control.calculation)
×
69
            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