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

Ruberhauptmann / quant-met / 16463103768

23 Jul 2025 06:19AM UTC coverage: 34.05% (-2.6%) from 36.605%
16463103768

Pull #125

github

web-flow
Merge dab4d24cf into b5a0f599e
Pull Request #125: Start q loop

3 of 70 branches covered (4.29%)

Branch coverage included in aggregate %.

85 of 221 new or added lines in 8 files covered. (38.46%)

40 existing lines in 4 files now uncovered.

203 of 535 relevant lines covered (37.94%)

1.14 hits per line

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

34.78
/src/quant_met/cli/crit_temp.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 h5py
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 crit_temp(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 T_C calculation.
23
    """
UNCOV
24
    result_path = Path(parameters.control.outdir)
×
UNCOV
25
    result_path.mkdir(exist_ok=True, parents=True)
×
26

27
    hamiltonian = sisl.get_sile(parameters.control.hamiltonian_file).read_hamiltonian()
×
28
    k_grid_obj = sisl.MonkhorstPack(
×
29
        hamiltonian.geometry, [parameters.k_points.nk1, parameters.k_points.nk2, 1]
30
    )
31

UNCOV
32
    delta_vs_temp, critical_temperatures, fit_fig = routines.search_crit_temp(
×
33
        hamiltonian=hamiltonian,
34
        kgrid=k_grid_obj,
35
        hubbard_int_orbital_basis=parameters.control.hubbard_int_orbital_basis,
36
        epsilon=parameters.control.conv_treshold,
37
        max_iter=parameters.control.max_iter,
38
        q=parameters.control.q,
39
        n_temp_points=parameters.control.n_temp_points,
40
    )
41

42
    logger.info("Search for T_C completed successfully.")
×
UNCOV
43
    logger.info("Obtained T_Cs: %s", critical_temperatures)
×
44

45
    fit_fig.savefig(
×
46
        result_path / f"{parameters.control.prefix}_critical_temperatures_fit.pdf",
47
        bbox_inches="tight",
48
    )
49

50
    result_file = result_path / f"{parameters.control.prefix}_critical_temperatures.hdf5"
×
UNCOV
51
    delta_vs_temp.to_hdf(result_file, key="delta_vs_temp")
×
52
    with h5py.File(result_file, mode="a") as file:
×
UNCOV
53
        for orbital, crit_temp_orbital in enumerate(critical_temperatures):
×
UNCOV
54
            file.attrs[f"T_C_{orbital}"] = crit_temp_orbital
×
55

UNCOV
56
    logger.info("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