Skip to content

Commit

Permalink
Merge branch 'main' into rjf/remove-eval
Browse files Browse the repository at this point in the history
  • Loading branch information
robfitzgerald committed Oct 2, 2023
2 parents 4033b3b + ad61d89 commit dd16f29
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,14 @@ def __init__(
self.step_size_seconds = data["step_size_seconds"] # seconds

if self.energy_type is None:
pt = data.get("power_type")
if pt is None:
pt_msg = "no power_type argument"
else:
pt_msg = f"invalid energy type '{data['power_type']}'"
raise AttributeError(
f"TabularPowercurve initialized with invalid energy type {self.energy_type}"
f"TabularPowercurve configuration has {pt_msg}; "
f"should be one of {{electric, gasoline}} "
)

charging_model = sorted(data["power_curve"], key=lambda x: x["energy_kwh"])
Expand Down

0 comments on commit dd16f29

Please sign in to comment.