Skip to content

Commit 9fbf326

Browse files
committed
progress
1 parent f9d9cdf commit 9fbf326

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,5 +431,6 @@ fn arrayredox(m: &Bound<'_, PyModule>) -> PyResult<()> {
431431
m.add_function(wrap_pyfunction!(first_true_1d_e, m)?)?;
432432
// m.add_function(wrap_pyfunction!(first_true_1d_g, m)?)?;
433433
m.add_function(wrap_pyfunction!(first_true_1d, m)?)?;
434+
m.add_function(wrap_pyfunction!(first_true_2d, m)?)?;
434435
Ok(())
435436
}

tests/test_first_true_2d.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from arrayredox import first_true_2d
2+
import numpy as np
3+
4+
import pytest
5+
6+
#--------------------------------------------------------------------------
7+
def test_first_true_2d_a() -> None:
8+
a1 = np.arange(20).reshape(4, 5) % 3 == 0
9+
pos2 = first_true_2d(a1, 1)
10+
assert pos2.tolist() == [0, 1, 2, 0]
11+
12+
pos1 = first_true_2d(a1, 0)
13+
import ipdb; ipdb.set_trace()
14+
assert pos1.tolist() == [0, 1, 2, 0, 1]
15+
16+
17+
18+

0 commit comments

Comments
 (0)