Skip to content

Commit

Permalink
Move error to single line
Browse files Browse the repository at this point in the history
  • Loading branch information
craigmaloney committed Feb 26, 2021
1 parent 1233448 commit 01850ae
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions thermostat/importers.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,13 +375,13 @@ def get_single_thermostat(thermostat_id, zipcode,
enough_heat_runtime = _enough_daily_runtime(heat_runtime_daily)

if not(enough_cool_runtime and enough_heat_runtime):
message = "Not enough runtime for thermostat %s\n" % thermostat_id
message = "Not enough runtime for thermostat %s: " % thermostat_id
if not enough_heat_runtime:
message += "Heat runtime has over 5% missing data."
message += " (have {days} days.)\n".format(days=len(heat_runtime_daily.dropna()))
message += "Heat runtime has over 5% missing data"
message += " (have {days} days.) ".format(days=len(heat_runtime_daily.dropna()))
if not enough_cool_runtime:
message += "Cool runtime has over 5% missing data."
message += " (have {days} days.)\n".format(days=len(cool_runtime_daily.dropna()))
message += "Cool runtime has over 5% missing data"
message += " (have {days} days.) ".format(days=len(cool_runtime_daily.dropna()))
raise ValueError(message)

# create thermostat instance
Expand Down

0 comments on commit 01850ae

Please sign in to comment.