Skip to content

Commit

Permalink
chore: mutually exclusive if/else, print duplicates for ease of use
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Hagg committed Jan 6, 2021
1 parent f80b92a commit 79383c9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions powersimdata/data_access/scenario_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,12 @@ def err_message(text):
scenario = table.loc[matches, :]
if scenario.shape[0] == 0:
err_message("SCENARIO NOT FOUND")
if scenario.shape[0] > 1:
elif scenario.shape[0] > 1:
err_message("MULTIPLE SCENARIO FOUND")
dupes = ",".join(str(i) for i in scenario.index)
print(f"Duplicate ids: {dupes}")
print("Use id to access scenario")
elif scenario.shape[0] == 1:
else:
return scenario.to_dict("records", into=OrderedDict)[0]

def add_entry(self, scenario_info):
Expand Down

0 comments on commit 79383c9

Please sign in to comment.