Skip to content

Commit

Permalink
allow input checker aux files to be parquet (#851)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpn-- committed Apr 22, 2024
1 parent 652883a commit 514ed03
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions activitysim/abm/models/input_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,13 @@ def create_table_store(state, input_checker_settings):
break

else:
table = pd.read_csv(
state.filesystem.get_data_file_path(
table_name, alternative_suffixes=[".csv"]
)
table_file = state.filesystem.get_data_file_path(
table_name, alternative_suffixes=[".csv", ".csv.gz", ".parquet"]
)
if table_file.suffix == ".parquet":
table = pd.read_parquet(table_file)
else:
table = pd.read_csv(table_file)
if table is None:
raise FileNotFoundError(
f"Input table {table_name} could not be found" + f"\nPath: {path}"
Expand Down Expand Up @@ -405,11 +407,9 @@ def input_checker(state: workflow.State):
create_table_store(state, input_checker_settings)

# import the input checker code after the TABLE_STORE is initialized so functions have access to the variable
prior_dir = os.getcwd()
if state.filesystem.working_dir:
os.chdir(state.filesystem.working_dir)
sys.path.insert(0, os.path.dirname(input_checker_file_full))
input_checker = __import__(os.path.splitext(input_checker_file)[0])
os.chdir(prior_dir)
sys.path.pop(0)

# intializing data objects for errors, warnings, and pydantic data
v_errors = {}
Expand Down

0 comments on commit 514ed03

Please sign in to comment.