Skip to content

Commit

Permalink
Merge pull request #34 from ihmeuw/feature/terse_error_msg
Browse files Browse the repository at this point in the history
ENH: change error message that keeps cracking me up
  • Loading branch information
collijk committed Jun 28, 2018
2 parents afed1ea + 927f61f commit 8847437
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions vivarium/framework/population.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,7 @@ def get(self, index: pd.Index, query: str='', omit_missing_columns: bool=False)
return pop[columns].copy()
except KeyError:
non_existent_columns = set(columns) - set(pop.columns)
raise PopulationError('The columns requested do not exist in the population table. Specifically, you '
+ 'requested {}, which do(es) not exist in the '.format(non_existent_columns)
+ 'population table. Are you trying to read columns during simulant '
+ 'initialization? You may be able to lower the priority of your handler so '
+ 'that it happens after the component that creates the column you need.')
raise PopulationError(f'Requested column(s) {non_existent_columns} not in population table.')

def update(self, pop: Union[pd.DataFrame, pd.Series]):
"""Update the simulation's state to match ``pop``
Expand Down

0 comments on commit 8847437

Please sign in to comment.