Skip to content

Commit 507ca83

Browse files
authored
Use np.intp for 32-bit compatibility (#410) (#485)
Fixes a test failure on 32-bit platforms (e.g. i386) due to NumPy refusing to safely cast between int64 and int32 in the .repeat() call. Casting the number of intervals to np.intp ensures compatibility with the platform's expected integer size for indexing operations, preventing the TypeError observed on i386.
1 parent e171b1a commit 507ca83

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

exchange_calendars/calendar_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ def _create_index_for_sessions(
575575

576576
# evaluate number of indices for each session
577577
num_intervals = (end_nanos - start_nanos) / self.interval_nanos
578-
num_indices = np.ceil(num_intervals).astype("int64")
578+
num_indices = np.ceil(num_intervals).astype(np.intp)
579579

580580
if force_close:
581581
if self.closed_right:

0 commit comments

Comments
 (0)