Remove try:... for plots to free memory
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
from uuid import uuid4
|
||||
from path import Path
|
||||
import logging
|
||||
import matplotlib.pyplot as plt
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
def includegraphics(fig_ax, document_path="./", fig_path="fig/",
|
||||
@@ -34,6 +35,7 @@ def includegraphics(fig_ax, document_path="./", fig_path="fig/",
|
||||
fig.tight_layout()
|
||||
fig.savefig(path_to_file/filename)
|
||||
logger.info("Graphique {} sauvé à {}".format(filename, path_to_file))
|
||||
plt.close(fig)
|
||||
return "\includegraphics[scale={sc}]{{{f}}}".format(sc = scale,
|
||||
f=Path(fig_path)/filename)
|
||||
|
||||
|
||||
@@ -50,9 +50,12 @@ Compétences
|
||||
|
||||
|
||||
\vfill
|
||||
\Var{e.pies_on_competence | includegraphics(document_path=directory, scale=0.3)}
|
||||
|
||||
\Var{e.pies_on_domaine | includegraphics(document_path=directory, scale=0.3)}
|
||||
\Var{e.heatmap_on_competence | includegraphics(document_path=directory, scale=0.6)}
|
||||
|
||||
\Var{e.heatmap_on_domain | includegraphics(document_path=directory, scale=0.6)}
|
||||
%# \Var{e.pies_on_competence | includegraphics(document_path=directory, scale=0.3)}
|
||||
%# \Var{e.pies_on_domaine | includegraphics(document_path=directory, scale=0.3)}
|
||||
|
||||
|
||||
%#\Var{conn_df}
|
||||
|
||||
Reference in New Issue
Block a user