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

DIGNEA / DIGNEApy / 26095718918

19 May 2026 11:59AM UTC coverage: 85.418% (-6.5%) from 91.886%
26095718918

push

github

amarrerod
Updates tests. Removes some parts from coverage.

9 of 15 new or added lines in 5 files covered. (60.0%)

189 existing lines in 11 files now uncovered.

1564 of 1831 relevant lines covered (85.42%)

0.85 hits per line

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

37.5
/digneapy/visualize/_evo_generator_evolution_plot.py
1
#!/usr/bin/env python
2
# -*-coding:utf-8 -*-
3
"""
4
@File    :   _evo_generator_evolution_plot.py
5
@Time    :   2024/09/18 11:03:49
6
@Author  :   Alejandro Marrero
7
@Version :   1.0
8
@Contact :   amarrerd@ull.edu.es
9
@License :   (C)Copyright 2024, Alejandro Marrero
10
@Desc    :   None
11
"""
12

13
from typing import Optional
1✔
14

15
import matplotlib
1✔
16

17
matplotlib.use("Agg")  # Non-interactive backend
1✔
18
from pathlib import Path
1✔
19

20
import matplotlib.pyplot as plt
1✔
21
import pandas as pd
1✔
22
import seaborn as sns
1✔
23
from matplotlib.lines import Line2D
1✔
24

25

26
def ea_generator_evolution_plot(logbook=None, filename: Optional[str | Path] = ""):
1✔
UNCOV
27
    df = pd.DataFrame(logbook.chapters["s"].select("avg"), columns=[r"$s$"])
×
UNCOV
28
    df[r"$p$"] = logbook.chapters["p"].select("avg")
×
UNCOV
29
    df["Generations"] = logbook.select("gen")
×
30

31
    # Plot configuration
UNCOV
32
    plt.rcParams["font.family"] = "serif"
×
UNCOV
33
    plt.rcParams["font.sans-serif"] = [
×
34
        "Tahoma",
35
        "DejaVu Sans",
36
        "Lucida Grande",
37
        "Verdana",
38
    ]
UNCOV
39
    plt.rcParams["font.size"] = 16
×
UNCOV
40
    plt.figure(figsize=(12, 8))
×
UNCOV
41
    ax = sns.lineplot(
×
42
        data=df,
43
        x="Generations",
44
        y=r"$s$",
45
        marker="o",
46
        color="blue",
47
        markersize=5,
48
        legend=False,
49
    )
50

UNCOV
51
    ax2 = plt.twinx()
×
UNCOV
52
    sns.lineplot(
×
53
        data=df,
54
        x="Generations",
55
        y=r"$p$",
56
        marker="X",
57
        markersize=5,
58
        color="red",
59
        legend=False,
60
        ax=ax2,
61
    )
UNCOV
62
    ax.legend(
×
63
        handles=[
64
            Line2D([], [], marker="o", color="blue", label=r"$s$"),
65
            Line2D([], [], marker="X", color="red", label=r"$p$"),
66
        ],
67
        loc="center right",
68
    )
69

UNCOV
70
    plt.title(r"Evolution of $s$ and $p$")
×
UNCOV
71
    if filename:
×
UNCOV
72
        plt.savefig(filename)
×
73
    else:  # pragma: no cover
74
        plt.show()
UNCOV
75
    plt.close()
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc