• 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/_map_elites_evolution_plot.py
1
#!/usr/bin/env python
2
# -*-coding:utf-8 -*-
3
"""
4
@File    :   _map_elites_evolution_plot.py
5
@Time    :   2024/09/18 11:04:14
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

24
from digneapy import Logbook
×
25

26

27
def map_elites_evolution_plot(logbook: Logbook, filename: Optional[str | Path] = ""):
×
28
    generations = pl.Series("generation", values=logbook.select("gen"))
×
29
    avg = pl.Series(name="avg", values=logbook.select("avg"))
×
30
    max_values = pl.Series(name="max", values=logbook.select("max"))
×
31
    min_values = pl.Series(name="min", values=logbook.select("min"))
×
32
    df = pl.DataFrame([generations, min_values, avg, max_values])
×
33

34
    # Plot configuration
35
    plt.rcParams["font.family"] = "serif"
×
36
    plt.rcParams["font.sans-serif"] = [
×
37
        "Tahoma",
38
        "DejaVu Sans",
39
        "Lucida Grande",
40
        "Verdana",
41
    ]
42
    plt.rcParams["font.size"] = 16
×
43
    plt.figure(figsize=(12, 8))
×
44
    for key, color in zip(["avg", "min", "max"], ["blue", "green", "red"]):
×
45
        sns.lineplot(data=df, x="generation", y=key, color=color, label=key)
×
46
    plt.legend(loc="best")
×
47
    plt.title(r"Evolution of fitness in the Map-Elites generator")
×
48
    plt.ylabel("Fitness")
×
49
    if filename:
×
50
        plt.savefig(filename)
×
51
    else:  # pragma: no cover
52
        plt.show()
53
    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