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

Ruberhauptmann / quant-met / 15606655669

12 Jun 2025 09:20AM UTC coverage: 33.436% (-66.6%) from 100.0%
15606655669

Pull #121

github

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

3 of 44 branches covered (6.82%)

Branch coverage included in aggregate %.

65 of 180 new or added lines in 13 files covered. (36.11%)

36 existing lines in 3 files now uncovered.

106 of 282 relevant lines covered (37.59%)

1.13 hits per line

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

33.33
/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 sisl
3✔
7

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

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

13

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

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

NEW
27
    geometry: sisl.Geometry = sisl.io.get_sile(parameters.control.geometry_file).read_geometry()
×
NEW
28
    print(geometry)
×
29

NEW
30
    solved_gap = routines.self_consistency_loop(
×
31
        epsilon=parameters.control.conv_treshold,
32
        max_iter=parameters.control.max_iter,
33
    )
34

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

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

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

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

UNCOV
60
        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