From 8d94fd2016892530855a98ba03daaf5f16434c96 Mon Sep 17 00:00:00 2001 From: Samuel Letellier-Duchesne Date: Fri, 19 Jan 2024 15:48:47 -0500 Subject: [PATCH] returned figure should be closed and return value a string (#499) --- archetypal/schedule.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/archetypal/schedule.py b/archetypal/schedule.py index d4de8826..97eb0fcd 100644 --- a/archetypal/schedule.py +++ b/archetypal/schedule.py @@ -7,6 +7,7 @@ from itertools import groupby from typing import FrozenSet, List, Union +import matplotlib.pyplot as plt import numpy as np import pandas as pd from energy_pandas import EnergySeries @@ -1571,7 +1572,8 @@ def _repr_svg_(self): ) f = io.BytesIO() fig.savefig(f, format="svg") - return f.getvalue() + plt.close(fig) + return f.getvalue().decode() def combine(self, other, weights=None, quantity=None): """Combine two schedule objects together.