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

Ruberhauptmann / quant-met / 16463103768

23 Jul 2025 06:19AM UTC coverage: 34.05% (-2.6%) from 36.605%
16463103768

Pull #125

github

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

3 of 70 branches covered (4.29%)

Branch coverage included in aggregate %.

85 of 221 new or added lines in 8 files covered. (38.46%)

40 existing lines in 4 files now uncovered.

203 of 535 relevant lines covered (37.94%)

1.14 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