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

DIGNEA / DIGNEApy / 27765193716

18 Jun 2026 02:04PM UTC coverage: 0.0% (-89.1%) from 89.085%
27765193716

push

github

amarrerod
Fixes coveralls action

0 of 2254 relevant lines covered (0.0%)

0.0 hits per line

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

0.0
/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
×
14

15
import matplotlib
×
16

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

20
import matplotlib.pyplot as plt
×
21
import polars as pl
×
22
import seaborn as sns
×
23
from matplotlib.lines import Line2D
×
24

25
from digneapy import Logbook
×
26

27

28
def ea_generator_evolution_plot(logbook: Logbook, filename: Optional[str | Path] = ""):
×
29
    generations = pl.Series("generation", values=logbook.select("gen"))
×
30
    mean_novelty = pl.Series(
×
31
        name="novelty", values=logbook.chapters["novelty"].select("avg")
32
    )
33
    mean_perf_bias = pl.Series(
×
34
        name="performance_bias",
35
        values=logbook.chapters["performance_bias"].select("avg"),
36
    )
37

38
    df = pl.DataFrame([generations, mean_novelty, mean_perf_bias])
×
39

40
    # Plot configuration
41
    plt.rcParams["font.family"] = "serif"
×
42
    plt.rcParams["font.sans-serif"] = [
×
43
        "Tahoma",
44
        "DejaVu Sans",
45
        "Lucida Grande",
46
        "Verdana",
47
    ]
48
    plt.rcParams["font.size"] = 16
×
49
    plt.figure(figsize=(12, 8))
×
50
    ax = sns.lineplot(
×
51
        data=df,
52
        x="generation",
53
        y="novelty",
54
        marker="o",
55
        color="blue",
56
        markersize=5,
57
        legend=False,
58
    )
59

60
    ax2 = plt.twinx()
×
61
    sns.lineplot(
×
62
        data=df,
63
        x="generation",
64
        y="performance_bias",
65
        marker="X",
66
        markersize=5,
67
        color="red",
68
        legend=False,
69
        ax=ax2,
70
    )
71
    ax.legend(
×
72
        handles=[
73
            Line2D([], [], marker="o", color="blue", label="novelty"),
74
            Line2D([], [], marker="X", color="red", label="performance bias"),
75
        ],
76
        loc="center right",
77
    )
78

79
    plt.title(r"Evolution of novelty and performance bias")
×
80
    if filename:
×
81
        plt.savefig(filename)
×
82
    else:  # pragma: no cover
83
        plt.show()
84
    plt.close()
×
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