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

Ruberhauptmann / quant-met / 14759532904

30 Apr 2025 04:31PM UTC coverage: 35.932% (-64.1%) from 100.0%
14759532904

Pull #121

github

web-flow
Merge 885831614 into df44f68e5
Pull Request #121: Start implementing sisl

4 of 44 branches covered (9.09%)

Branch coverage included in aggregate %.

61 of 166 new or added lines in 12 files covered. (36.75%)

31 existing lines in 3 files now uncovered.

102 of 251 relevant lines covered (40.64%)

1.22 hits per line

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

42.86
/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 .scf import scf
3✔
13

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

16

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

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

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

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

UNCOV
51
    match params.control.calculation:
×
UNCOV
52
        case "scf":
×
UNCOV
53
            logger.info("Starting SCF calculation.")
×
UNCOV
54
            scf(params)
×
UNCOV
55
        case _:
×
UNCOV
56
            logger.error("Calculation %s not found.", params.control.calculation)
×
UNCOV
57
            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