Open MuellerSeb opened 2 months ago
I had to revert the fix for #13 since the tests were failing with it and the buk
variables were not declared.
CI workflow can be seen here for example: https://github.com/MuellerSeb/cell_tree2d/actions/runs/8839642612
The PyPI publishing stage relies on API tokens: https://pypi.org/help/#apitoken
But it seems that this approach is outdated and one should use trusted publishers
Either way, this is up to you, since this would require some work from you. I can just say it is very convenient and I use it for all my projects.
I'd like to use gridded and would like to see pypi releases of it and I noted, that this dependency is probably the reason it is not on pypi. I updated the repo accordingly to be able to build wheels with github actions.
This PR updates the whole package in the following way:
pyproject.toml
to define build-time dependencies (including numpy 2rc1 (like scipy does) and cython 3)_version.py
file now generated from git tags with setuptools_scm (.git_archival.txt
and.gitattributes
added to get meaningful version when installing from archive)Issues:
Click to expand the test log
``` tests/test_cell_tree2d.py::test_init PASSED [ 8%] tests/test_cell_tree2d.py::test_lists PASSED [ 16%] tests/test_cell_tree2d.py::test_types PASSED [ 25%] tests/test_cell_tree2d.py::test_shape_error PASSED [ 33%] tests/test_cell_tree2d.py::test_bounds_errors PASSED [ 41%] tests/test_cell_tree2d.py::test_triangle_lookup PASSED [ 50%] tests/test_cell_tree2d.py::test_poly_lookup PASSED [ 58%] tests/test_cell_tree2d.py::test_multi_poly_lookup FAILED [ 66%] tests/test_cell_tree2d.py::test_multi_poly_1D_lookup FAILED [ 75%] tests/test_cell_tree2d.py::test_edge_cases PASSED [ 83%] tests/test_cell_tree2d.py::test_multipoint FAILED [ 91%] tests/test_quad_grid.py::test_build_tree_from_coords FAILED [100%] =========================================================================================================== FAILURES ============================================================================================================ ____________________________________________________________________________________________________ test_multi_poly_lookup _____________________________________________________________________________________________________ def test_multi_poly_lookup(): # A simple quad grid nodes = np.array([[0.0, 0.0], #0 [0.0, 2.0], #1 [2.0, 0.0], #2 [2.0, 2.0], #3 [4.0, 0.0], #4 [4.0, 2.0], #5 [6.0, 0.0], #6 [6.0, 2.0], #7 [0.0,4.0], #8 [2.0,4.0], #9 [4.0,4.0], #10 [6.0,4.0] #11 ]) faces = np.array([[0, 8, 9, 5, 2], [9, 11, 7, 5, -1], [4, 7 ,6, -1, -1] ], dtype=np.intc) tree = CellTree(nodes, faces, num_buckets = 2, cells_per_leaf = 1) point = np.array([1., 1.]) # in POLY 1 result = tree.locate(point) > assert result == 0 E assert array([-1], dtype=int32) == 0 tests/test_cell_tree2d.py:229: AssertionError ___________________________________________________________________________________________________ test_multi_poly_1D_lookup ___________________________________________________________________________________________________ def test_multi_poly_1D_lookup(): # A simple quad grid nodes = np.array([[0.0, 0.0], #0 [0.0, 2.0], #1 [2.0, 0.0], #2 [2.0, 2.0], #3 [4.0, 0.0], #4 [4.0, 2.0], #5 [6.0, 0.0], #6 [6.0, 2.0], #7 [0.0,4.0], #8 [2.0,4.0], #9 [4.0,4.0], #10 [6.0,4.0] #11 ]) faces = np.array([0, 8, 9, 5, 2, 9, 11, 7, 5, 4, 7, 6] , dtype=np.intc) n_verts_arr = np.array([5,4,3],dtype=np.ubyte) tree = CellTree(nodes, faces, len_arr = n_verts_arr, num_buckets = 2, cells_per_leaf = 1) point = np.array([1., 1.]) # in POLY 1 result = tree.locate(point) > assert result == 0 E assert array([-1], dtype=int32) == 0 tests/test_cell_tree2d.py:265: AssertionError ________________________________________________________________________________________________________ test_multipoint ________________________________________________________________________________________________________ def test_multipoint(): tree = CellTree(nodes21, faces21) points = [(4.2, 3.0), (7.7, 13.5), (3.4, 7.000000001), (7.0, 5.0), # out of bounds points (8.66, 10.99), (7.3, 0.74), (2.5, 5.5), (9.8, 12.3), ] correct_indexes = (1, 20, 7, -1, -1, -1, -1, -1) ind = tree.locate(points) > assert np.array_equal(ind, correct_indexes) E assert False E + where False =