Skip to content

Commit

Permalink
returned figure should be closed and return value a string (#499)
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelduchesne authored Jan 19, 2024
1 parent ccb5ac6 commit 8d94fd2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion archetypal/schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 8d94fd2

Please sign in to comment.