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

Ruberhauptmann / quant-met / 15260068409

26 May 2025 06:30PM UTC coverage: 35.599% (-64.4%) from 100.0%
15260068409

Pull #121

github

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

4 of 45 branches covered (8.89%)

Branch coverage included in aggregate %.

65 of 174 new or added lines in 12 files covered. (37.36%)

36 existing lines in 3 files now uncovered.

106 of 264 relevant lines covered (40.15%)

1.2 hits per line

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

38.1
/src/quant_met/cli/scf.py
1
"""Functions to run self-consistent calculation for the order parameter."""
2

3
import logging
3✔
4
from pathlib import Path
3✔
5

6
import numpy as np
3✔
7
import sisl
3✔
8

9
from quant_met import routines
3✔
10
from quant_met.parameters import Parameters
3✔
11

12
logger = logging.getLogger(__name__)
3✔
13

14

15
def scf(parameters: Parameters) -> None:
3✔
16
    """Self-consistent calculation for the order parameter.
17

18
    Parameters
19
    ----------
20
    parameters: Parameters
21
        An instance of Parameters containing control settings, the model,
22
        and k-point specifications for the self-consistency calculation.
23
    """
UNCOV
24
    result_path = Path(parameters.control.outdir)
×
UNCOV
25
    result_path.mkdir(exist_ok=True, parents=True)
×
NEW
26
    result_file = result_path / f"{parameters.control.prefix}.hdf5"
×
27

NEW
28
    sisl.io.get_sile(parameters.control.geometry_file).read_geometry()
×
29

NEW
30
    solved_gap = routines.self_consistency_loop(
×
31
        k_space_grid=np.array([1.0, 1.0]),
32
        epsilon=parameters.control.conv_treshold,
33
        max_iter=parameters.control.max_iter,
34
    )
35

UNCOV
36
    logger.info("Self-consistency loop completed successfully.")
×
NEW
37
    logger.debug("Obtained delta values: %s", solved_gap)
×
38

39
    # solved_h.save(filename=result_file)
UNCOV
40
    logger.info("Results saved to %s", result_file)
×
41

UNCOV
42
    if parameters.control.calculate_additional is True:
×
UNCOV
43
        logger.info("Calculating additional things.")
×
44
        # current = solved_h.calculate_current_density(k=k_space_grid)
45
        # sf_weight_conv, sf_weight_geom = solved_h.calculate_superfluid_weight(k=k_space_grid)
46

NEW
47
        """"
×
48
        with h5py.File(result_file, "a") as f:
49
            f.attrs["current_x"] = current[0]
50
            f.attrs["current_y"] = current[1]
51
            f.attrs["sf_weight_conv_xx"] = sf_weight_conv[0, 0]
52
            f.attrs["sf_weight_conv_xy"] = sf_weight_conv[0, 1]
53
            f.attrs["sf_weight_conv_yx"] = sf_weight_conv[1, 0]
54
            f.attrs["sf_weight_conv_yy"] = sf_weight_conv[1, 1]
55
            f.attrs["sf_weight_geom_xx"] = sf_weight_geom[0, 0]
56
            f.attrs["sf_weight_geom_xy"] = sf_weight_geom[0, 1]
57
            f.attrs["sf_weight_geom_yx"] = sf_weight_geom[1, 0]
58
            f.attrs["sf_weight_geom_yy"] = sf_weight_geom[1, 1]
59
        """
60

UNCOV
61
        logger.info("Additional results saved to %s", result_file)
×
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