From e8144af44f70b15880c1b12ea651180d44d7c9d1 Mon Sep 17 00:00:00 2001 From: David Hensle Date: Fri, 15 Dec 2023 17:59:19 -0800 Subject: [PATCH] comments allowed in stop freq spec --- activitysim/estimation/larch/stop_frequency.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/activitysim/estimation/larch/stop_frequency.py b/activitysim/estimation/larch/stop_frequency.py index c572af5e8..e580491e0 100644 --- a/activitysim/estimation/larch/stop_frequency.py +++ b/activitysim/estimation/larch/stop_frequency.py @@ -42,8 +42,7 @@ def stop_frequency_data( seg_purpose = seg_["primary_purpose"] seg_subdir = Path(os.path.join(edb_directory, seg_purpose)) segment_coef[seg_["primary_purpose"]] = pd.read_csv( - seg_subdir / seg_["COEFFICIENTS"], - index_col="coefficient_name", + seg_subdir / seg_["COEFFICIENTS"], index_col="coefficient_name", comment="#" ) for seg in segments: @@ -89,13 +88,13 @@ def stop_frequency_data( seg_purpose = seg["primary_purpose"] seg_subdir = Path(os.path.join(edb_directory, seg_purpose)) coeffs_ = pd.read_csv( - seg_subdir / seg["COEFFICIENTS"], index_col="coefficient_name" + seg_subdir / seg["COEFFICIENTS"], index_col="coefficient_name", comment="#" ) coeffs_.index = pd.Index( [f"{i}_{seg_purpose}" for i in coeffs_.index], name="coefficient_name" ) seg_coefficients.append(coeffs_) - spec = pd.read_csv(seg_subdir / "stop_frequency_SPEC_.csv") + spec = pd.read_csv(seg_subdir / "stop_frequency_SPEC_.csv", comment="#") spec = remove_apostrophes(spec, ["Label"]) # spec.iloc[:, 3:] = spec.iloc[:, 3:].applymap(lambda x: f"{x}_{seg_purpose}" if not pd.isna(x) else x) seg_spec.append(spec)