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

Ruberhauptmann / quant-met / 13719467866

07 Mar 2025 11:12AM UTC coverage: 86.915% (-13.1%) from 100.0%
13719467866

Pull #93

github

web-flow
Merge 1eff8e237 into 17b683f9d
Pull Request #93: Add DMFT

87 of 100 branches covered (87.0%)

Branch coverage included in aggregate %.

44 of 182 new or added lines in 7 files covered. (24.18%)

916 of 1054 relevant lines covered (86.91%)

0.87 hits per line

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

94.74
/src/quant_met/cli/main.py
1
# SPDX-FileCopyrightText: 2024 Tjark Sievers
2
#
3
# SPDX-License-Identifier: MIT
4

5
"""Command line interface."""
6

7
import logging
1✔
8
import sys
1✔
9
from typing import TextIO
1✔
10

11
import click
1✔
12
import yaml
1✔
13

14
from quant_met.parameters import Parameters
1✔
15

16
from .crit_temp import crit_temp
1✔
17
from .dmft import dmft_scf
1✔
18
from .scf import scf
1✔
19

20
logger = logging.getLogger(__name__)
1✔
21

22

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

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

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

54
    params = Parameters(**yaml.safe_load(input_file))
1✔
55
    logger.info("Loaded parameters successfully.")
1✔
56

57
    match params.control.calculation:
1✔
58
        case "scf":
1✔
59
            logger.info("Starting SCF calculation.")
1✔
60
            scf(params)
1✔
61
        case "crit-temp":
1✔
62
            logger.info("Starting T_C calculation.")
1✔
63
            crit_temp(params)
1✔
64
        case "dmft-scf":
1✔
NEW
65
            logger.info("Starting DMFT SCF calculation.")
×
NEW
66
            dmft_scf(params)
×
67
        case _:
1✔
68
            logger.error("Calculation %s not found.", params.control.calculation)
1✔
69
            sys.exit(1)
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