Skip to content

Commit

Permalink
MNT lint cython
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewSZhang committed Aug 20, 2024
1 parent 2c3cdf4 commit 778ea77
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ name: CI
on:
workflow_call:
push:
branches: [main]
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
test:
Expand Down
7 changes: 7 additions & 0 deletions fastcan/_cancorr_fast.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ from sklearn.utils._cython_blas cimport ColMajor, NoTrans
from sklearn.utils._cython_blas cimport _dot, _scal, _nrm2, _gemm, _axpy
from sklearn.utils._typedefs cimport int32_t


@final
cdef unsigned int _bsum(
bint* x,
Expand All @@ -24,6 +25,7 @@ cdef unsigned int _bsum(
total += x[i]
return total


@final
cdef int _iamax(
int n,
Expand All @@ -40,6 +42,7 @@ cdef int _iamax(
else:
return idamax(&n, <double *> x, &incx) - 1


@final
cdef bint _normv(
floating[::1] x, # IN/OUT
Expand All @@ -61,6 +64,7 @@ cdef bint _normv(
_scal(n_samples, x_norm, &x[0], 1)
return False


@final
cdef void _normm(
floating[::1, :] X, # IN/OUT
Expand Down Expand Up @@ -88,6 +92,7 @@ cdef void _normm(
x_norm = 1.0/x_norm
_scal(n_samples, x_norm, &X[0, j], 1)


@final
cdef floating _sscvm(
const floating[::1] w, # IN
Expand Down Expand Up @@ -118,6 +123,7 @@ cdef floating _sscvm(
free(r)
return r2


@final
cdef void _mgsvv(
const floating[::1] w, # IN
Expand All @@ -138,6 +144,7 @@ cdef void _mgsvv(
# x = x - w*r
_axpy(n_samples, -r, &w[0], 1, &x[0], 1)


@final
cpdef int _forward_search(
floating[::1, :] X, # IN/OUT
Expand Down

0 comments on commit 778ea77

Please sign in to comment.