File tree Expand file tree Collapse file tree 3 files changed +7
-9
lines changed
Expand file tree Collapse file tree 3 files changed +7
-9
lines changed Original file line number Diff line number Diff line change 1010from activitysim .core import expressions , tracing , workflow
1111from activitysim .core .configuration import PydanticReadable
1212from activitysim .core .configuration .base import PreprocessorSettings
13+ from activitysim .core .exceptions import InputTableError
1314from activitysim .core .input import read_input_table
14- from activitysim .core .exceptions import InputPopulationError
1515
1616logger = logging .getLogger (__name__ )
1717
@@ -141,9 +141,7 @@ def initialize_tours(
141141 f"{ tours_without_persons .sum ()} tours out of { len (persons )} without persons\n "
142142 f"{ pd .Series ({'person_id' : tours_without_persons .index .values })} "
143143 )
144- raise InputPopulationError (
145- f"{ tours_without_persons .sum ()} tours with bad person_id"
146- )
144+ raise InputTableError (f"{ tours_without_persons .sum ()} tours with bad person_id" )
147145
148146 if trace_hh_id :
149147 state .tracing .trace_df (tours , label = "initialize_tours" , warn_if_empty = True )
Original file line number Diff line number Diff line change 99
1010from activitysim .abm .tables .util import simple_table_join
1111from activitysim .core import workflow
12+ from activitysim .core .exceptions import InputTableError
1213from activitysim .core .input import read_input_table
13- from activitysim .core .exceptions import InputPopulationError
1414
1515logger = logging .getLogger (__name__ )
1616
@@ -56,7 +56,7 @@ def persons(state: workflow.State) -> pd.DataFrame:
5656 f"{ persons_without_households .sum ()} persons out of { len (df )} without households\n "
5757 f"{ pd .Series ({'person_id' : persons_without_households .index .values })} "
5858 )
59- raise InputPopulationError (
59+ raise InputTableError (
6060 f"{ persons_without_households .sum ()} persons with bad household_id"
6161 )
6262
@@ -68,7 +68,7 @@ def persons(state: workflow.State) -> pd.DataFrame:
6868 f"{ households_without_persons .sum ()} households out of { len (households .index )} without persons\n "
6969 f"{ pd .Series ({'household_id' : households_without_persons .index .values })} "
7070 )
71- raise InputPopulationError (
71+ raise InputTableError (
7272 f"{ households_without_persons .sum ()} households with no persons"
7373 )
7474
@@ -108,5 +108,5 @@ def persons_merged(
108108 left_on = "person_id" ,
109109 )
110110 if n_persons != len (persons ):
111- raise InputPopulationError ("number of persons changed" )
111+ raise InputTableError ("number of persons changed" )
112112 return persons
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ class TableSlicingError(RuntimeError):
7474 """An error occurred trying to slice a table."""
7575
7676
77- class InputPopulationError (RuntimeError ):
77+ class InputTableError (RuntimeError ):
7878 """An issue with the input population was found."""
7979
8080
You can’t perform that action at this time.
0 commit comments