Skip to content

Commit

Permalink
int overflow error detection added
Browse files Browse the repository at this point in the history
  • Loading branch information
professorcode1 committed Jan 22, 2024
1 parent 221b8e4 commit 7b7730b
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions EventAnalysis/EventAnalysis/src/EventAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,10 @@ def __init__(self, event_df_:pd.DataFrame, device_Id:None|int = None, time_norma

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?"

# the rows are dates,and the columns are grid points.
# the ex array will be all the index's where there is an event
# (ex[0][i],ex[1][i]) => (grid index, date index) of event i
starting_date = date_index[0]
ending_date = date_index[-1]
self.T = ( ending_date - starting_date ).total_seconds() // self.time_normalization_factor
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'
self.number_of_grid_points = rain_event_matrix.shape[1]

self.grid_to_event_map, \
Expand Down
Binary file removed dist/event-analysis-1.1.1.tar.gz
Binary file not shown.
Binary file added dist/event-analysis-1.1.2.tar.gz
Binary file not shown.
Binary file removed dist/event_analysis-1.1.1-py3-none-any.whl
Binary file not shown.
Binary file added dist/event_analysis-1.1.2-py3-none-any.whl
Binary file not shown.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

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

0 comments on commit 7b7730b

Please sign in to comment.