Skip to content

Commit

Permalink
Merge pull request #14 from MatthewSZhang/dev
Browse files Browse the repository at this point in the history
MNT Cython remove unnecessary memset of mask
  • Loading branch information
MatthewSZhang authored Oct 18, 2024
2 parents aae8c9d + adec944 commit 589fa3e
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 50 deletions.
1 change: 0 additions & 1 deletion fastcan/_cancorr_fast.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ cpdef int _forward_search(
int index = -1

memset(&r2[0], 0, n_features * sizeof(floating))
memset(&mask[0], False, n_features * sizeof(bint))

for i in range(t):
if i == 0:
Expand Down
2 changes: 1 addition & 1 deletion fastcan/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def ols(X, y, t=1):
w = X / np.linalg.norm(X, axis=0)
v = y / np.linalg.norm(y)
mask = np.zeros(n_features, dtype=bool)
r2 = np.zeros(n_features)
r2 = np.zeros(n_features, dtype=float)
indices = np.zeros(t, dtype=int)
scores = np.zeros(t, dtype=float)

Expand Down
94 changes: 46 additions & 48 deletions pixi.lock
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ environments:
- conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.0.2-pyhd8ed1ab_0.conda
- conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.12.2-pyha770c72_0.conda
- conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2024b-hc8b5060_0.conda
- conda: https://conda.anaconda.org/conda-forge/linux-64/uv-0.4.22-h0f3a69f_0.conda
- conda: https://conda.anaconda.org/conda-forge/linux-64/uv-0.4.23-h0f3a69f_0.conda
- conda: https://conda.anaconda.org/conda-forge/linux-64/xz-5.2.6-h166bdaf_0.tar.bz2
- conda: https://conda.anaconda.org/conda-forge/noarch/zipp-3.20.2-pyhd8ed1ab_0.conda
- pypi: https://files.pythonhosted.org/packages/7e/b3/6b4067be973ae96ba0d615946e314c5ae35f9f993eca561b356540bb0c2b/alabaster-1.0.0-py3-none-any.whl
Expand Down Expand Up @@ -166,7 +166,7 @@ environments:
- conda: https://conda.anaconda.org/conda-forge/osx-64/libsqlite-3.46.1-h4b8f8c9_0.conda
- conda: https://conda.anaconda.org/conda-forge/osx-64/libxml2-2.12.7-heaf3512_4.conda
- conda: https://conda.anaconda.org/conda-forge/osx-64/libzlib-1.3.1-hd23fc13_2.conda
- conda: https://conda.anaconda.org/conda-forge/osx-64/llvm-openmp-19.1.1-hf78d878_1.conda
- conda: https://conda.anaconda.org/conda-forge/osx-64/llvm-openmp-19.1.2-hf78d878_0.conda
- conda: https://conda.anaconda.org/conda-forge/osx-64/llvm-tools-17.0.6-hbedff68_1.conda
- conda: https://conda.anaconda.org/conda-forge/noarch/meson-1.5.2-pyhd8ed1ab_0.conda
- conda: https://conda.anaconda.org/conda-forge/noarch/meson-python-0.16.0-pyh0c530f3_0.conda
Expand Down Expand Up @@ -205,7 +205,7 @@ environments:
- conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.0.2-pyhd8ed1ab_0.conda
- conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.12.2-pyha770c72_0.conda
- conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2024b-hc8b5060_0.conda
- conda: https://conda.anaconda.org/conda-forge/osx-64/uv-0.4.22-h3a35632_0.conda
- conda: https://conda.anaconda.org/conda-forge/osx-64/uv-0.4.23-h3a35632_0.conda
- conda: https://conda.anaconda.org/conda-forge/osx-64/xz-5.2.6-h775f41a_0.tar.bz2
- conda: https://conda.anaconda.org/conda-forge/noarch/zipp-3.20.2-pyhd8ed1ab_0.conda
- conda: https://conda.anaconda.org/conda-forge/osx-64/zlib-1.3.1-hd23fc13_2.conda
Expand Down Expand Up @@ -299,7 +299,7 @@ environments:
- conda: https://conda.anaconda.org/conda-forge/osx-arm64/libsqlite-3.46.1-hc14010f_0.conda
- conda: https://conda.anaconda.org/conda-forge/osx-arm64/libxml2-2.12.7-h01dff8b_4.conda
- conda: https://conda.anaconda.org/conda-forge/osx-arm64/libzlib-1.3.1-h8359307_2.conda
- conda: https://conda.anaconda.org/conda-forge/osx-arm64/llvm-openmp-19.1.1-hb52a8e5_1.conda
- conda: https://conda.anaconda.org/conda-forge/osx-arm64/llvm-openmp-19.1.2-hb52a8e5_0.conda
- conda: https://conda.anaconda.org/conda-forge/osx-arm64/llvm-tools-17.0.6-h5090b49_2.conda
- conda: https://conda.anaconda.org/conda-forge/noarch/meson-1.5.2-pyhd8ed1ab_0.conda
- conda: https://conda.anaconda.org/conda-forge/noarch/meson-python-0.16.0-pyh0c530f3_0.conda
Expand Down Expand Up @@ -338,7 +338,7 @@ environments:
- conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.0.2-pyhd8ed1ab_0.conda
- conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.12.2-pyha770c72_0.conda
- conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2024b-hc8b5060_0.conda
- conda: https://conda.anaconda.org/conda-forge/osx-arm64/uv-0.4.22-h41fe3af_0.conda
- conda: https://conda.anaconda.org/conda-forge/osx-arm64/uv-0.4.23-h41fe3af_0.conda
- conda: https://conda.anaconda.org/conda-forge/osx-arm64/xz-5.2.6-h57fd34a_0.tar.bz2
- conda: https://conda.anaconda.org/conda-forge/noarch/zipp-3.20.2-pyhd8ed1ab_0.conda
- conda: https://conda.anaconda.org/conda-forge/osx-arm64/zlib-1.3.1-h8359307_2.conda
Expand Down Expand Up @@ -438,7 +438,7 @@ environments:
- conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.12.2-pyha770c72_0.conda
- conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2024b-hc8b5060_0.conda
- conda: https://conda.anaconda.org/conda-forge/win-64/ucrt-10.0.22621.0-h57928b3_1.conda
- conda: https://conda.anaconda.org/conda-forge/win-64/uv-0.4.22-ha08ef0e_0.conda
- conda: https://conda.anaconda.org/conda-forge/win-64/uv-0.4.23-ha08ef0e_0.conda
- conda: https://conda.anaconda.org/conda-forge/win-64/vc-14.3-ha32ba9b_22.conda
- conda: https://conda.anaconda.org/conda-forge/win-64/vc14_runtime-14.40.33810-hcc2c482_22.conda
- conda: https://conda.anaconda.org/conda-forge/win-64/vs2015_runtime-14.40.33810-h3bf8584_22.conda
Expand Down Expand Up @@ -3472,40 +3472,38 @@ packages:
timestamp: 1727963183990
- kind: conda
name: llvm-openmp
version: 19.1.1
build: hb52a8e5_1
build_number: 1
version: 19.1.2
build: hb52a8e5_0
subdir: osx-arm64
url: https://conda.anaconda.org/conda-forge/osx-arm64/llvm-openmp-19.1.1-hb52a8e5_1.conda
sha256: bac90d68cd6a1b5f0ae21e900715d425b02a3be8f6199a5e2dbcb126d8525a6e
md5: 6eab363cb011e739cf6f3bb92b763525
url: https://conda.anaconda.org/conda-forge/osx-arm64/llvm-openmp-19.1.2-hb52a8e5_0.conda
sha256: a1836fa9eddf8b3fa2209db4a3423b13fdff93a8eacc9fe8360a6867e7f440d0
md5: 7ad59f95f091ed6a99a7cbcd6f201be0
depends:
- __osx >=11.0
constrains:
- openmp 19.1.1|19.1.1.*
- openmp 19.1.2|19.1.2.*
license: Apache-2.0 WITH LLVM-exception
license_family: APACHE
purls: []
size: 280001
timestamp: 1728961638301
size: 280737
timestamp: 1729145191646
- kind: conda
name: llvm-openmp
version: 19.1.1
build: hf78d878_1
build_number: 1
version: 19.1.2
build: hf78d878_0
subdir: osx-64
url: https://conda.anaconda.org/conda-forge/osx-64/llvm-openmp-19.1.1-hf78d878_1.conda
sha256: b5800c43c3031095dbfd0e1d0bce39369a450ea60e3e64457b60ae3d8f207757
md5: d22a59378882a4985d7c0d9b821739a7
url: https://conda.anaconda.org/conda-forge/osx-64/llvm-openmp-19.1.2-hf78d878_0.conda
sha256: 92231d391886bca0c0dabb42f02a37e7acb8ea84399843173fe8c294814735dd
md5: ca5f963676a9ad5383b7441368e1d107
depends:
- __osx >=10.13
constrains:
- openmp 19.1.1|19.1.1.*
- openmp 19.1.2|19.1.2.*
license: Apache-2.0 WITH LLVM-exception
license_family: APACHE
purls: []
size: 305033
timestamp: 1728961695895
size: 305589
timestamp: 1729145249496
- kind: conda
name: llvm-tools
version: 17.0.6
Expand Down Expand Up @@ -5625,12 +5623,12 @@ packages:
requires_python: '>=3.8'
- kind: conda
name: uv
version: 0.4.22
version: 0.4.23
build: h0f3a69f_0
subdir: linux-64
url: https://conda.anaconda.org/conda-forge/linux-64/uv-0.4.22-h0f3a69f_0.conda
sha256: 339327e0f5f0261010a9bee30c81b6d7d3c75055c1f6622e4bb236cc647c49a3
md5: 097cb08694453152fda7b72c2bb79d7f
url: https://conda.anaconda.org/conda-forge/linux-64/uv-0.4.23-h0f3a69f_0.conda
sha256: 67a11d890b77642226589587014efcda99e08489b6dcb331a7620b3614f07938
md5: dfb74ada24086849e6fdb24e2de1fa78
depends:
- __glibc >=2.17,<3.0.a0
- libgcc >=13
Expand All @@ -5639,58 +5637,58 @@ packages:
- __glibc >=2.17
license: Apache-2.0 OR MIT
purls: []
size: 9387060
timestamp: 1729051218653
size: 9559775
timestamp: 1729195157336
- kind: conda
name: uv
version: 0.4.22
version: 0.4.23
build: h3a35632_0
subdir: osx-64
url: https://conda.anaconda.org/conda-forge/osx-64/uv-0.4.22-h3a35632_0.conda
sha256: a1a82a1a183f7a3a03b4df9de8671777e7f40c27d26009c9368e4ae54452426b
md5: 981b475a4b9a94e2327e1b584eaa1db0
url: https://conda.anaconda.org/conda-forge/osx-64/uv-0.4.23-h3a35632_0.conda
sha256: aa9045bf209c4f887fbdcf7c7677d5f3aab96551f605f199f20d6b9509c22b98
md5: c648a589e1b001be6e334355a18b10b4
depends:
- __osx >=10.13
- libcxx >=17
constrains:
- __osx >=10.13
license: Apache-2.0 OR MIT
purls: []
size: 9005118
timestamp: 1729051593194
size: 9141915
timestamp: 1729196160659
- kind: conda
name: uv
version: 0.4.22
version: 0.4.23
build: h41fe3af_0
subdir: osx-arm64
url: https://conda.anaconda.org/conda-forge/osx-arm64/uv-0.4.22-h41fe3af_0.conda
sha256: 67d65f73599830394ae616a024326c35463eb42f6afe83dbbb242617d50eefa2
md5: 8c7a35eb435d5c7b763ae6ed0f86bdaa
url: https://conda.anaconda.org/conda-forge/osx-arm64/uv-0.4.23-h41fe3af_0.conda
sha256: f2ce5f829bcaca9b0f575165e1554666c3c96130b726a434cba30cd74aae0ed6
md5: 8836f533658714e30d67ae756c20c970
depends:
- __osx >=11.0
- libcxx >=17
constrains:
- __osx >=11.0
license: Apache-2.0 OR MIT
purls: []
size: 8363263
timestamp: 1729051811270
size: 8416923
timestamp: 1729196042397
- kind: conda
name: uv
version: 0.4.22
version: 0.4.23
build: ha08ef0e_0
subdir: win-64
url: https://conda.anaconda.org/conda-forge/win-64/uv-0.4.22-ha08ef0e_0.conda
sha256: 3fa9294017348bd74beb2796aca034a6762c18bc55e681676d83f0f65e00c941
md5: cd98dc93e1550bcaee800a1f7cf34de6
url: https://conda.anaconda.org/conda-forge/win-64/uv-0.4.23-ha08ef0e_0.conda
sha256: 00868444a749f3eae616175ef8c539d27b6ccc7f89fca1ad91cb17655da59542
md5: 53b914a7eb73a4783cecd0c586fd5b87
depends:
- ucrt >=10.0.20348.0
- vc >=14.2,<15
- vc14_runtime >=14.29.30139
license: Apache-2.0 OR MIT
purls: []
size: 10142417
timestamp: 1729052284268
size: 10215776
timestamp: 1729197131798
- kind: conda
name: vc
version: '14.3'
Expand Down

0 comments on commit 589fa3e

Please sign in to comment.