Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions osier/models/dispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class DispatchModel():
penalty : float
The penalty applied to the objective function to eliminate
simultaneous charging and discharging. Users may need to tune
this parameter. Default is 1e-4.
this parameter. Default is 1e-10.
model_initialized : bool
Indicates whether :attr:`DispatchModel.model` has been populated
with equations yet. This is set to ``True`` after
Expand Down Expand Up @@ -205,7 +205,7 @@ def __init__(self,
oversupply=0.0,
undersupply=0.0,
verbosity=50,
penalty=1e-4,
penalty=1e-10,
power_units=MW,
curtailment=True,
allow_blackout=False,
Expand Down
4 changes: 2 additions & 2 deletions osier/models/logic_dispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def _format_results(self):
t.charge_history).to_ndarray()
data["Curtailment"] = np.array(
[v if v <= 0 else 0 for v in self.covered_demand])
data["Shortfall"] = np.array(
data["LoadLoss"] = np.array(
[v if v > 0 else 0 for v in self.covered_demand])
self.results = pd.DataFrame(data)
return
Expand Down Expand Up @@ -134,7 +134,7 @@ def solve(self):
if self.verbosity <= 20:
print(
('solve failed -- '
'too much overproduction '
'too much supply '
'(no curtailment allowed)'))
raise ValueError

Expand Down
5 changes: 1 addition & 4 deletions osier/models/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ def __init__(self,
else:
self.power_units = power_units

self.technology_list = synchronize_units(
technology_list,
unit_power=self.power_units,
unit_time=self.time_delta.units)
self.technology_list = technology_list

@property
def time_delta(self):
Expand Down
8 changes: 7 additions & 1 deletion osier/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,12 +562,18 @@ def n_mga(results_obj,
raise ValueError

pf = results_obj.F
xpf = results_obj.X
try:
n_inds, n_objs = pf.shape
except ValueError:
n_inds = pf.shape[0]
n_objs = 1

try:
n_inds, n_vars = xpf.shape
except ValueError:
n_vars = xpf.shape[0]

pop_size = results_obj.algorithm.pop_size
n_gen = results_obj.algorithm.n_gen - 1

Expand All @@ -576,7 +582,7 @@ def n_mga(results_obj,
sense=sense)

X_hist = np.array([hist.pop.get("X") for hist in results_obj.history]).reshape(
n_gen * pop_size, n_objs)
n_gen * pop_size, n_vars)
F_hist = np.array([hist.pop.get("F") for hist in results_obj.history]).reshape(
n_gen * pop_size, n_objs)
try:
Expand Down
Loading