From 327d97b0ecae61960dbb9cadfe60ae1340bf8686 Mon Sep 17 00:00:00 2001 From: Jeff Newman Date: Thu, 30 Nov 2023 22:47:51 -0600 Subject: [PATCH] omg windows --- activitysim/core/los.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/activitysim/core/los.py b/activitysim/core/los.py index 3992a5abc..8586a3018 100644 --- a/activitysim/core/los.py +++ b/activitysim/core/los.py @@ -773,7 +773,14 @@ def get_mazpairs(self, omaz, dmaz, attribute): # how="left")[attribute] # synthetic index method i : omaz_dmaz - i = np.asanyarray(omaz) * self.maz_ceiling + np.asanyarray(dmaz) + if self.maz_ceiling > 32767: + # too many MAZs, or un-recoded MAZ ID's that are too large + # will overflow a 32-bit index, so upgrade to 64bit. + i = np.asanyarray(omaz, dtype=np.int64) * np.int64( + self.maz_ceiling + ) + np.asanyarray(dmaz, dtype=np.int64) + else: + i = np.asanyarray(omaz) * self.maz_ceiling + np.asanyarray(dmaz) s = util.quick_loc_df(i, self.maz_to_maz_df, attribute) # FIXME - no point in returning series?