Skip to content

Commit

Permalink
Update imports and seed.setter method
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusHolly committed Oct 15, 2024
1 parent 5d960a4 commit d7a0002
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions idaes/apps/grid_integration/multiperiod/price_taker_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
have_kn = True
try:
from sklearn.cluster import KMeans
except:
except ImportError:
have_skl = False
try:
from kneed import KneeLocator
except:
except ImportError:
have_kn = False

import matplotlib.pyplot as plt
Expand Down Expand Up @@ -77,9 +77,10 @@ def seed(self):

@seed.setter
def seed(self, value):
if not isinstance(value, int):
raise ValueError(f"seed must be an integer, but {value} is not an integer")
self._seed = value
try:
self._seed = value
except TypeError:
raise TypeError(f"seed must be an integer, but {value} is not an integer")

@property
def horizon_length(self):
Expand Down

0 comments on commit d7a0002

Please sign in to comment.