Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
runs-on: ${{ matrix.platform }}
strategy:
matrix:
platform: [ubuntu-latest, macos-latest] # windows-latest
python-version: ["3.8", "3.9", "3.10", "3.11"]
platform: [ubuntu-latest, macos-latest] # , windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v2
Expand Down
8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ def setup_package():
use_scm_version={'write_to': 'src/pyift/_version.py'},
setup_requires=build_requires,
install_requires=[
'numpy',
'numpy>=2',
'scipy',
],
python_requires=">=3.8",
python_requires=">=3.9",
package_dir={'': 'src'},
ext_modules=exts,
classifiers=[
Expand All @@ -76,9 +76,11 @@ def setup_package():
'Programming Language :: C',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Topic :: Scientific/Engineering',
'Topic :: Software Development :: Libraries :: Python Modules',
],
Expand Down
39 changes: 0 additions & 39 deletions src/libift/tags

This file was deleted.

12 changes: 8 additions & 4 deletions src/pyift/shortestpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
from typing import Optional, Tuple, Dict, Union


def seed_competition(seeds: np.ndarray, image: Optional[np.ndarray] = None, graph: Optional[sparse.csr_matrix] = None,
image_3d: bool = False) -> Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]:
def seed_competition(
seeds: np.ndarray,
image: Optional[np.ndarray] = None,
graph: Optional[Union[sparse.csr_matrix, sparse.csr_array]] = None,
image_3d: bool = False,
) -> Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]:
"""
Performs the shortest path classification from the `seeds` nodes
using the image foresting transform algorithm [1]_.
Expand Down Expand Up @@ -102,8 +106,8 @@ def seed_competition(seeds: np.ndarray, image: Optional[np.ndarray] = None, grap
return _pyift.seed_competition_grid(image, seeds)

# graph is provided
if not isinstance(graph, sparse.csr_matrix):
raise TypeError('`graph` must be a `csr_matrix`.')
if not isinstance(graph, (sparse.csr_matrix, sparse.csr_array)):
raise TypeError('`graph` must be a `csr_matrix` or `csr_array`.')

if graph.shape[0] != graph.shape[1]:
raise ValueError('`graph` must be a square adjacency matrix, current shape %r.' % graph.shape)
Expand Down
1 change: 1 addition & 0 deletions src/pyift_c_ext/_livewire.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ extern "C" {
#define NO_IMPORT_ARRAY
#define PY_ARRAY_UNIQUE_SYMBOL PYIFT_ARRAY_API
#include "numpy/arrayobject.h"
#include "numpy/npy_math.h"


typedef enum {
Expand Down
1 change: 1 addition & 0 deletions src/pyift_c_ext/_shortestpath.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ extern "C" {
#define NO_IMPORT_ARRAY
#define PY_ARRAY_UNIQUE_SYMBOL PYIFT_ARRAY_API
#include "numpy/arrayobject.h"
#include "numpy/npy_math.h"


PyObject *_seedCompetitionGrid(PyArrayObject *image, PyArrayObject *seeds);
Expand Down