Skip to content

Commit

Permalink
Fix strange behaviour if primary key is given as Bus instead of string
Browse files Browse the repository at this point in the history
  • Loading branch information
henhuy committed Jun 6, 2024
1 parent d634ea6 commit 24b6358
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions oemof_industry/mimo_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,11 @@ class MIMO(MultiInputMultiOutputConverter, Facade):
tech: str

def __init__(self, **kwargs):
if "primary" in kwargs and not isinstance(kwargs["primary"], str):
raise TypeError(
"Primary key must be given as string, not as Bus component. "
"Eventually, you must remove field 'primary' from foreign keys in datapackage.json."
)
buses = {
key: value
for key, value in kwargs.items()
Expand Down

0 comments on commit 24b6358

Please sign in to comment.