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

DIGNEA / DIGNEApy / 26040537195

18 May 2026 02:40PM UTC coverage: 91.886% (-0.1%) from 91.988%
26040537195

push

github

amarrerod
All tests passing in local. Updating examples to new interfaces.

2 of 2 new or added lines in 2 files covered. (100.0%)

24 existing lines in 9 files now uncovered.

1778 of 1935 relevant lines covered (91.89%)

1.84 hits per line

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

96.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
2✔
14

15
import matplotlib
2✔
16

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

20
import matplotlib.pyplot as plt
2✔
21
import pandas as pd
2✔
22
import seaborn as sns
2✔
23

24

25
def map_elites_evolution_plot(logbook=None, filename: Optional[str | Path] = ""):
2✔
26
    df = pd.DataFrame(logbook.select("avg"), columns=["avg"])
2✔
27
    df["min"] = logbook.select("min")
2✔
28
    df["max"] = logbook.select("max")
2✔
29
    df["Generation"] = logbook.select("gen")
2✔
30
    # Plot configuration
31
    plt.rcParams["font.family"] = "serif"
2✔
32
    plt.rcParams["font.sans-serif"] = [
2✔
33
        "Tahoma",
34
        "DejaVu Sans",
35
        "Lucida Grande",
36
        "Verdana",
37
    ]
38
    plt.rcParams["font.size"] = 16
2✔
39
    plt.figure(figsize=(12, 8))
2✔
40
    for key, color in zip(["avg", "min", "max"], ["blue", "green", "red"]):
2✔
41
        sns.lineplot(data=df, x="Generation", y=key, color=color, label=key)
2✔
42
    plt.legend(loc="best")
2✔
43
    plt.title(r"Evolution of fitness in the Map-Elites generator")
2✔
44
    plt.ylabel("Fitness")
2✔
45
    if filename:
2✔
46
        plt.savefig(filename)
2✔
47
    else:
UNCOV
48
        plt.show()
×
49
    plt.close()
2✔
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