Informations générales

This commit is contained in:
Adrien Guatto
2025-09-11 14:37:42 +02:00
parent b69c6c52f2
commit 7b57d565fd
6 changed files with 270 additions and 2 deletions

26
tools/hept-plot Executable file
View File

@@ -0,0 +1,26 @@
#!/usr/bin/env python
import os, sys, tempfile
try:
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
except ImportError as e:
print("You need to install the Python packages matplotlib and pandas")
print("e.g., `pip install --user matplotlib pandas`")
sys.exit(1)
(_, tracefile) = tempfile.mkstemp(suffix = ".csv")
print("hept-plot: saving trace to {}".format(tracefile))
os.system("HEPT_TRACE=\"{}\" {}".format(tracefile, " ".join(sys.argv[1:])))
try:
trace = pd.read_csv(tracefile)
trace = trace.loc[:, ~trace.columns.str.contains('^Unnamed')]
trace.plot(kind = 'line')
plt.legend(loc = 'upper left')
plt.show()
except pd.errors.EmptyDataError:
print("hept-plot: nothing to plot")
sys.exit(0)