Skip to content

Commit 073ffc2

Browse files
committed
plotting: check compatibility of shapes
1 parent 2e438e7 commit 073ffc2

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

spinetoolbox/plotting.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ def check_dimensions(dfs: Iterable[pd.DataFrame], _raise: bool = False) -> bool:
141141
142142
"""
143143

144+
# check if shapes match
145+
shapes = [d.shape for d in dfs]
146+
if not functools.reduce(lambda i, j: i if i == j else False, shapes):
147+
raise PlottingError(f"incompatible shapes: {shapes}")
148+
144149
# check if column types match
145150
def _get_type(i) -> str:
146151
if isinstance(i, pd.CategoricalDtype):

0 commit comments

Comments
 (0)