Skip to content

Commit 75feea1

Browse files
author
Your Name
committed
fix: updated int ctypes in windows cython code
1 parent 3645d0a commit 75feea1

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

penaltyblog/models/loss.pyx

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ from .utils cimport (
2525
@cython.cdivision(True)
2626
@cython.nonecheck(False)
2727
@cython.initializedcheck(False)
28-
def poisson_loss_function(np.int64_t[:] goals_home,
29-
np.int64_t[:] goals_away,
28+
def poisson_loss_function(long[:] goals_home,
29+
long[:] goals_away,
3030
np.float64_t[:] weights,
31-
np.int64_t[:] home_indices,
32-
np.int64_t[:] away_indices,
31+
long[:] home_indices,
32+
long[:] away_indices,
3333
np.float64_t[:] attack,
3434
np.float64_t[:] defence,
3535
double hfa) -> double:
@@ -79,11 +79,11 @@ def poisson_loss_function(np.int64_t[:] goals_home,
7979
@cython.cdivision(True)
8080
@cython.nonecheck(False)
8181
@cython.initializedcheck(False)
82-
cpdef double dixon_coles_loss_function(np.int64_t[:] goals_home,
83-
np.int64_t[:] goals_away,
82+
cpdef double dixon_coles_loss_function(long[:] goals_home,
83+
long[:] goals_away,
8484
np.float64_t[:] weights,
85-
np.int64_t[:] home_indices,
86-
np.int64_t[:] away_indices,
85+
long[:] home_indices,
86+
long[:] away_indices,
8787
np.float64_t[:] attack,
8888
np.float64_t[:] defence,
8989
double hfa,
@@ -144,11 +144,11 @@ cpdef double dixon_coles_loss_function(np.int64_t[:] goals_home,
144144
@cython.cdivision(True)
145145
@cython.nonecheck(False)
146146
@cython.initializedcheck(False)
147-
cpdef double compute_negative_binomial_loss(np.int64_t[:] goals_home,
148-
np.int64_t[:] goals_away,
147+
cpdef double compute_negative_binomial_loss(long[:] goals_home,
148+
long[:] goals_away,
149149
np.float64_t[:] weights,
150-
np.int64_t[:] home_indices,
151-
np.int64_t[:] away_indices,
150+
long[:] home_indices,
151+
long[:] away_indices,
152152
np.float64_t[:] attack,
153153
np.float64_t[:] defence,
154154
double hfa,
@@ -207,11 +207,11 @@ cpdef double compute_negative_binomial_loss(np.int64_t[:] goals_home,
207207
@cython.cdivision(True)
208208
@cython.nonecheck(False)
209209
@cython.initializedcheck(False)
210-
cpdef double compute_zero_inflated_poisson_loss(np.int64_t[:] goals_home,
211-
np.int64_t[:] goals_away,
210+
cpdef double compute_zero_inflated_poisson_loss(long[:] goals_home,
211+
long[:] goals_away,
212212
np.float64_t[:] weights,
213-
np.int64_t[:] home_indices,
214-
np.int64_t[:] away_indices,
213+
long[:] home_indices,
214+
long[:] away_indices,
215215
np.float64_t[:] attack,
216216
np.float64_t[:] defence,
217217
double hfa,
@@ -269,11 +269,11 @@ cpdef double compute_zero_inflated_poisson_loss(np.int64_t[:] goals_home,
269269
@cython.cdivision(True)
270270
@cython.nonecheck(False)
271271
@cython.initializedcheck(False)
272-
cpdef double compute_bivariate_poisson_loss(np.int64_t[:] goals_home,
273-
np.int64_t[:] goals_away,
272+
cpdef double compute_bivariate_poisson_loss(long[:] goals_home,
273+
long[:] goals_away,
274274
np.float64_t[:] weights,
275-
np.int64_t[:] home_indices,
276-
np.int64_t[:] away_indices,
275+
long[:] home_indices,
276+
long[:] away_indices,
277277
np.float64_t[:] attack,
278278
np.float64_t[:] defence,
279279
double hfa,
@@ -356,11 +356,11 @@ cpdef double compute_bivariate_poisson_loss(np.int64_t[:] goals_home,
356356
@cython.cdivision(True)
357357
@cython.nonecheck(False)
358358
@cython.initializedcheck(False)
359-
cpdef double compute_weibull_copula_loss(np.int64_t[:] goals_home,
360-
np.int64_t[:] goals_away,
359+
cpdef double compute_weibull_copula_loss(long[:] goals_home,
360+
long[:] goals_away,
361361
np.float64_t[:] weights,
362-
np.int64_t[:] home_indices,
363-
np.int64_t[:] away_indices,
362+
long[:] home_indices,
363+
long[:] away_indices,
364364
np.float64_t[:] attack,
365365
np.float64_t[:] defence,
366366
double hfa,

penaltyblog/models/utils.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ cdef inline double zip_poisson_pmf(int k, double lam, double zi):
3333
return (1 - zi) * poisson_pmf(k, lam)
3434

3535

36-
cdef inline int compute_max_goal(np.int64_t[:] goalsHome, np.int64_t[:] goalsAway, int nMatches):
36+
cdef inline int compute_max_goal(long[:] goalsHome, long[:] goalsAway, int nMatches):
3737
cdef int i, max_val = 0, temp
3838
for i in range(nMatches):
3939
temp = goalsHome[i]

0 commit comments

Comments
 (0)