Skip to content

Commit 7b7730b

Browse files
int overflow error detection added
1 parent 221b8e4 commit 7b7730b

File tree

6 files changed

+2
-4
lines changed

6 files changed

+2
-4
lines changed

EventAnalysis/EventAnalysis/src/EventAnalysis.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,10 @@ def __init__(self, event_df_:pd.DataFrame, device_Id:None|int = None, time_norma
2929

3030
assert rain_event_matrix.dtype == bool, "The rain event dataframe does not have bool as its internal type, are you sure you sent an event series and not a time series?"
3131

32-
# the rows are dates,and the columns are grid points.
33-
# the ex array will be all the index's where there is an event
34-
# (ex[0][i],ex[1][i]) => (grid index, date index) of event i
3532
starting_date = date_index[0]
3633
ending_date = date_index[-1]
3734
self.T = ( ending_date - starting_date ).total_seconds() // self.time_normalization_factor
35+
assert self.T <= np.iinfo(np.int32).max,f'the time span of data provided({self.T}) is over what a 32bit int can store {np.iinfo(np.int32).max}. Erroring now to prevent returning incorrect resuts'
3836
self.number_of_grid_points = rain_event_matrix.shape[1]
3937

4038
self.grid_to_event_map, \

dist/event-analysis-1.1.1.tar.gz

-13.2 KB
Binary file not shown.

dist/event-analysis-1.1.2.tar.gz

13.2 KB
Binary file not shown.
-15.4 KB
Binary file not shown.
15.5 KB
Binary file not shown.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name = "event-analysis",
8-
version = "1.1.1",
8+
version = "1.1.2",
99
description = "This package allows you to run Event Coincidence Analysis and Event Synchronization on your event series on the CPU and Nvidia-GPU",
1010
py_modules = [ "EventAnalysis" ],
1111
package_dir = { '' : "EventAnalysis" },

0 commit comments

Comments
 (0)