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

Ruberhauptmann / quant-met / 16227982322

11 Jul 2025 07:18PM UTC coverage: 36.605% (+3.6%) from 33.046%
16227982322

push

github

web-flow
Implement crit-temp and test for Graphene (#124)

3 of 45 branches covered (6.67%)

Branch coverage included in aggregate %.

11 of 28 new or added lines in 3 files covered. (39.29%)

135 of 332 relevant lines covered (40.66%)

1.22 hits per line

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

39.39
/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 .scf import scf
3✔
14

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

17

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

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

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

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

52
    match params.control.calculation:
×
53
        case "scf":
×
54
            logger.info("Starting SCF calculation.")
×
55
            scf(params)
×
NEW
56
        case "crit-temp":
×
NEW
57
            logger.info("Starting T_C calculation.")
×
NEW
58
            crit_temp(params)
×
59
        case _:
×
60
            logger.error("Calculation %s not found.", params.control.calculation)
×
61
            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