diff --git a/science/Makefile b/science/Makefile index 6f18214e8d88..01fecd2c2f02 100644 --- a/science/Makefile +++ b/science/Makefile @@ -1,544 +1,545 @@ COMMENT = Scientific ports SUBDIR += 2d-rewriter SUBDIR += ALPSCore SUBDIR += ChipmunkPhysics SUBDIR += InsightToolkit SUBDIR += InsightToolkit501 SUBDIR += PETSc SUBDIR += R-cran-DCluster SUBDIR += R-cran-Epi SUBDIR += R-cran-FAdist SUBDIR += R-cran-bayesm SUBDIR += R-cran-cmprsk SUBDIR += R-cran-e1071 SUBDIR += R-cran-epicalc SUBDIR += R-cran-etm SUBDIR += R-cran-fastICA SUBDIR += R-cran-kernlab SUBDIR += R-cran-ks SUBDIR += R-cran-snow SUBDIR += R-cran-som SUBDIR += R-cran-udunits2 SUBDIR += abinit SUBDIR += acados SUBDIR += afni SUBDIR += agrum SUBDIR += aircraft-datcom SUBDIR += antioch SUBDIR += apbs SUBDIR += arbor SUBDIR += ascent SUBDIR += atompaw SUBDIR += avogadro2 SUBDIR += avogadrolibs SUBDIR += axom SUBDIR += bagel SUBDIR += bddsolve SUBDIR += berkeleygw SUBDIR += bodr SUBDIR += bout++ SUBDIR += bout++-merging-filaments SUBDIR += buddy SUBDIR += cantera SUBDIR += cardioid SUBDIR += cdf SUBDIR += cdk SUBDIR += cdo SUBDIR += cgnslib SUBDIR += cgribex SUBDIR += checkmol SUBDIR += chemical-mime-data SUBDIR += chemicalfun SUBDIR += chemps2 SUBDIR += chemtool SUBDIR += chemtool-devel SUBDIR += chimes-calculator SUBDIR += chrono SUBDIR += cif-tools SUBDIR += clhep SUBDIR += clipper SUBDIR += code_saturne SUBDIR += conduit SUBDIR += coordgenlibs SUBDIR += cp2k SUBDIR += cp2k-data SUBDIR += cpcmx SUBDIR += csvtk SUBDIR += dakota SUBDIR += dalton SUBDIR += dd_package SUBDIR += devisor SUBDIR += dftbplus SUBDIR += dftd3 SUBDIR += dftd4 SUBDIR += dimod SUBDIR += dirac SUBDIR += dkh SUBDIR += dlib-cpp SUBDIR += drawxtl SUBDIR += dssp SUBDIR += dwave-preprocessing SUBDIR += dynare SUBDIR += eccodes SUBDIR += elk SUBDIR += elmerfem SUBDIR += epte SUBDIR += erd SUBDIR += ergo SUBDIR += erkale SUBDIR += erkale-pseudopotentials SUBDIR += fastcap SUBDIR += fasthenry SUBDIR += fastjet SUBDIR += feff10 SUBDIR += fleur SUBDIR += frontistr SUBDIR += fsom SUBDIR += fvcom SUBDIR += fvcom-mpi SUBDIR += gabedit SUBDIR += gamess-us SUBDIR += gbtolib SUBDIR += gchemutils SUBDIR += gcp SUBDIR += gdma SUBDIR += geant4 SUBDIR += gemmi SUBDIR += getdp SUBDIR += ghemical SUBDIR += ghmm SUBDIR += gnudatalanguage SUBDIR += gpaw-setups SUBDIR += gramps SUBDIR += gromacs SUBDIR += gsmc SUBDIR += h5utils SUBDIR += h5z-zfp SUBDIR += harminv SUBDIR += hdf SUBDIR += hdf5 SUBDIR += hdf5-110 SUBDIR += hdf5-18 SUBDIR += hdf5-21 SUBDIR += healpix SUBDIR += helfem SUBDIR += hepmc3 SUBDIR += highfive SUBDIR += hypre SUBDIR += iboview SUBDIR += isaac-cfd SUBDIR += jdftx SUBDIR += jmol SUBDIR += jstrack SUBDIR += kalzium SUBDIR += kim-api SUBDIR += kplib SUBDIR += kst SUBDIR += lammps SUBDIR += lamprop SUBDIR += latte SUBDIR += libaec SUBDIR += libccp4 SUBDIR += libcifpp SUBDIR += libcint SUBDIR += libctl SUBDIR += libecpint SUBDIR += libefp SUBDIR += libgetar SUBDIR += libghemical SUBDIR += libgridxc SUBDIR += libint SUBDIR += libint2 SUBDIR += libint2-psi4 SUBDIR += libkml SUBDIR += liblinear SUBDIR += libmbd SUBDIR += libminc SUBDIR += libmsym SUBDIR += libnegf SUBDIR += liboglappth SUBDIR += libpsml SUBDIR += libquantum SUBDIR += libssm SUBDIR += libsvm SUBDIR += libsvm-python SUBDIR += libvdwxc SUBDIR += libxc SUBDIR += liggghts SUBDIR += linearelasticity SUBDIR += linux-ai-ml-env SUBDIR += linux-zotero SUBDIR += luscus SUBDIR += m-aneos SUBDIR += madness SUBDIR += maeparser SUBDIR += massxpert SUBDIR += mbdyn SUBDIR += mcpl SUBDIR += mcstas SUBDIR += mcstas-comps SUBDIR += mctc-lib SUBDIR += mcxtrace SUBDIR += mcxtrace-comps SUBDIR += mdynamix SUBDIR += medit SUBDIR += meep SUBDIR += metaphysicl SUBDIR += minc-tools SUBDIR += mmdb2 SUBDIR += mmg SUBDIR += mmtf-cpp SUBDIR += mol2ps SUBDIR += molgif SUBDIR += molscript SUBDIR += molsketch SUBDIR += moltui SUBDIR += mopac SUBDIR += mp2d SUBDIR += mpb SUBDIR += mpqc SUBDIR += mrchem SUBDIR += mrcpp SUBDIR += msms SUBDIR += mstore SUBDIR += multicharge SUBDIR += multiwfn SUBDIR += mutationpp SUBDIR += namd SUBDIR += ncrystal SUBDIR += neko SUBDIR += nest SUBDIR += netcdf SUBDIR += netcdf-cxx SUBDIR += netcdf-fortran SUBDIR += nifticlib SUBDIR += nlcglib SUBDIR += numsa SUBDIR += nwchem SUBDIR += nwchem-data SUBDIR += ocean SUBDIR += octopus SUBDIR += openbabel SUBDIR += openems SUBDIR += openkim-models SUBDIR += openmc SUBDIR += openmodelica SUBDIR += openmolcas SUBDIR += openmx SUBDIR += opensim-core SUBDIR += opensph SUBDIR += opsin SUBDIR += optench SUBDIR += orthanc SUBDIR += orthanc-dicomweb SUBDIR += orthanc-mysql SUBDIR += orthanc-postgresql SUBDIR += orthanc-webviewer SUBDIR += p5-Chemistry-3DBuilder SUBDIR += p5-Chemistry-Bond-Find SUBDIR += p5-Chemistry-Canonicalize SUBDIR += p5-Chemistry-Elements SUBDIR += p5-Chemistry-File-MDLMol SUBDIR += p5-Chemistry-File-Mopac SUBDIR += p5-Chemistry-File-PDB SUBDIR += p5-Chemistry-File-SLN SUBDIR += p5-Chemistry-File-SMARTS SUBDIR += p5-Chemistry-File-SMILES SUBDIR += p5-Chemistry-File-VRML SUBDIR += p5-Chemistry-File-XYZ SUBDIR += p5-Chemistry-FormulaPattern SUBDIR += p5-Chemistry-InternalCoords SUBDIR += p5-Chemistry-Isotope SUBDIR += p5-Chemistry-MacroMol SUBDIR += p5-Chemistry-MidasPattern SUBDIR += p5-Chemistry-Mok SUBDIR += p5-Chemistry-Mol SUBDIR += p5-Chemistry-OpenSMILES SUBDIR += p5-Chemistry-Pattern SUBDIR += p5-Chemistry-Reaction SUBDIR += p5-Chemistry-Ring SUBDIR += p5-Geo-BUFR SUBDIR += p5-Geo-Calc SUBDIR += p5-Geo-Coordinates-Converter SUBDIR += p5-Geo-Coordinates-Converter-iArea SUBDIR += p5-Geo-Coordinates-Transform SUBDIR += p5-Geo-WebService-Elevation-USGS SUBDIR += p5-Mcstas-Tools SUBDIR += p5-PerlMol SUBDIR += p5-Physics-Unit SUBDIR += packmol SUBDIR += pagmo2 SUBDIR += paje SUBDIR += paraview SUBDIR += parthenon SUBDIR += pastix SUBDIR += pcmsolver SUBDIR += phonopy SUBDIR += plumed SUBDIR += pnetcdf SUBDIR += polytope SUBDIR += precice SUBDIR += psi4 SUBDIR += pulseview SUBDIR += py-GPy SUBDIR += py-GPyOpt SUBDIR += py-HepMC3 SUBDIR += py-HofstadterTools SUBDIR += py-MDAnalysis SUBDIR += py-MDAnalysisTests SUBDIR += py-OpenFermion SUBDIR += py-OpenFermion-Dirac SUBDIR += py-OpenFermion-PySCF SUBDIR += py-OpenMC SUBDIR += py-PubChemPy SUBDIR += py-PyFR SUBDIR += py-PyNE SUBDIR += py-SimpleSpectral SUBDIR += py-abipy SUBDIR += py-access SUBDIR += py-arbor SUBDIR += py-arch SUBDIR += py-asap3 SUBDIR += py-asdf SUBDIR += py-asdf-standard SUBDIR += py-asdf-transform-schemas SUBDIR += py-ase SUBDIR += py-atomium SUBDIR += py-avogadrolibs SUBDIR += py-boutdata SUBDIR += py-boututils SUBDIR += py-cdo SUBDIR += py-cfgrib SUBDIR += py-chainer SUBDIR += py-chainer-chemistry SUBDIR += py-chempy SUBDIR += py-cirq-aqt SUBDIR += py-cirq-core SUBDIR += py-cirq-google SUBDIR += py-cirq-ionq SUBDIR += py-cirq-pasqal SUBDIR += py-cirq-web SUBDIR += py-coards SUBDIR += py-corner SUBDIR += py-dftbplus SUBDIR += py-dftd4 SUBDIR += py-dimod SUBDIR += py-dipy SUBDIR += py-dlib SUBDIR += py-dwave-cloud-client SUBDIR += py-dwave-gate SUBDIR += py-dwave-greedy SUBDIR += py-dwave-hybrid SUBDIR += py-dwave-inspector SUBDIR += py-dwave-neal SUBDIR += py-dwave-networkx SUBDIR += py-dwave-ocean-sdk SUBDIR += py-dwave-optimization SUBDIR += py-dwave-preprocessing SUBDIR += py-dwave-samplers SUBDIR += py-dwave-system SUBDIR += py-dwave-tabu SUBDIR += py-dwavebinarycsp SUBDIR += py-earthpy SUBDIR += py-eccodes SUBDIR += py-emmet-core SUBDIR += py-esda SUBDIR += py-fresnel SUBDIR += py-gemmi SUBDIR += py-geolinks SUBDIR += py-geomet SUBDIR += py-geometer SUBDIR += py-geometric SUBDIR += py-gpaw SUBDIR += py-gsd SUBDIR += py-gwlearn SUBDIR += py-h5json SUBDIR += py-h5netcdf SUBDIR += py-h5py SUBDIR += py-h5pyd SUBDIR += py-hiPhive SUBDIR += py-hoomd-blue SUBDIR += py-icet SUBDIR += py-inequality SUBDIR += py-ipygany SUBDIR += py-jupyter_jsmol SUBDIR += py-kim-query SUBDIR += py-kimpy SUBDIR += py-kinematics SUBDIR += py-kliff + SUBDIR += py-klusta SUBDIR += py-kpLib SUBDIR += py-liac-arff SUBDIR += py-libgetar SUBDIR += py-libpysal SUBDIR += py-lifelines SUBDIR += py-mdp SUBDIR += py-mercantile SUBDIR += py-meshio SUBDIR += py-mmcif SUBDIR += py-mmtf-python SUBDIR += py-mne SUBDIR += py-molmod SUBDIR += py-morphio SUBDIR += py-mp-api SUBDIR += py-mpcontribs-client SUBDIR += py-mplhep SUBDIR += py-mplhep-data SUBDIR += py-mrchem SUBDIR += py-ncrystal SUBDIR += py-neo SUBDIR += py-netCDF4 SUBDIR += py-netcdf-flattener SUBDIR += py-nglview SUBDIR += py-nibabel SUBDIR += py-obspy SUBDIR += py-oddt SUBDIR += py-openEMS SUBDIR += py-openbabel SUBDIR += py-openpiv SUBDIR += py-optking SUBDIR += py-paida SUBDIR += py-paramz SUBDIR += py-penaltymodel SUBDIR += py-periodictable SUBDIR += py-phono3py SUBDIR += py-phonopy SUBDIR += py-plumed SUBDIR += py-pnetcdf SUBDIR += py-probeinterface SUBDIR += py-pupynere SUBDIR += py-py3Dmol SUBDIR += py-pyaixi SUBDIR += py-pyberny SUBDIR += py-pycsw SUBDIR += py-pydicom SUBDIR += py-pydoe SUBDIR += py-pygeodesy SUBDIR += py-pygeometa SUBDIR += py-pygmo2 SUBDIR += py-pyked SUBDIR += py-pymatgen SUBDIR += py-pymatgen-analysis-alloys SUBDIR += py-pymatgen-core SUBDIR += py-pymbd SUBDIR += py-pymol SUBDIR += py-pynrrd SUBDIR += py-pyosf SUBDIR += py-pyphot SUBDIR += py-pyprecice SUBDIR += py-pyqubo SUBDIR += py-pysal SUBDIR += py-pyscf SUBDIR += py-pyteomics SUBDIR += py-qcelemental SUBDIR += py-qcengine SUBDIR += py-qcmanybody SUBDIR += py-qiskit SUBDIR += py-qspin SUBDIR += py-quantities SUBDIR += py-rmf SUBDIR += py-rmsd SUBDIR += py-ruffus SUBDIR += py-sarpy SUBDIR += py-scikit-fuzzy SUBDIR += py-scikit-learn SUBDIR += py-scikit-optimize SUBDIR += py-scikit-sparse SUBDIR += py-scimath SUBDIR += py-scipy SUBDIR += py-scoria SUBDIR += py-sdf SUBDIR += py-seekpath SUBDIR += py-segregation SUBDIR += py-segyio SUBDIR += py-signac SUBDIR += py-sklearn-pandas SUBDIR += py-skrebate SUBDIR += py-spaghetti SUBDIR += py-spglib SUBDIR += py-symfc SUBDIR += py-tensorflow SUBDIR += py-thewalrus SUBDIR += py-tobler SUBDIR += py-trainstation SUBDIR += py-trx-python SUBDIR += py-tweedledum SUBDIR += py-vedo SUBDIR += py-veusz SUBDIR += py-xbout SUBDIR += pybrain SUBDIR += pynn SUBDIR += q SUBDIR += qbox SUBDIR += qcl SUBDIR += qiskit-aer SUBDIR += qmcpack SUBDIR += qt6-quick3dphysics SUBDIR += quantum-espresso SUBDIR += quantum-espresso-pseudopotentials SUBDIR += quantum-jet SUBDIR += qwalk SUBDIR += rdkit SUBDIR += rmf SUBDIR += rubygem-ai4r SUBDIR += rubygem-cdo SUBDIR += rubygem-rgeo SUBDIR += rubygem-rgeo-geojson SUBDIR += rubygem-rgeo-proj4 SUBDIR += rubygem-rgeo-shapefile SUBDIR += rubygem-ruby-netcdf SUBDIR += salome-configuration SUBDIR += salome-kernel SUBDIR += scidavis SUBDIR += sciplot SUBDIR += seacas SUBDIR += segyio SUBDIR += serac SUBDIR += shelxle SUBDIR += siconos SUBDIR += siesta SUBDIR += sigrok-cli SUBDIR += sigrok-firmware SUBDIR += sigrok-firmware-fx2lafw SUBDIR += sigrok-firmware-utils SUBDIR += silo SUBDIR += simbody SUBDIR += simgrid SUBDIR += simint SUBDIR += simlib SUBDIR += simple-dftd3 SUBDIR += simsmith SUBDIR += sirius SUBDIR += smoldyn SUBDIR += sparta SUBDIR += spglib SUBDIR += spheral SUBDIR += step SUBDIR += sz3 SUBDIR += tblite SUBDIR += teem SUBDIR += tfel SUBDIR += tfel-edf SUBDIR += thermofun SUBDIR += tinker SUBDIR += trilinos SUBDIR += ttk SUBDIR += tweedledum SUBDIR += udunits SUBDIR += ukrmol+ SUBDIR += v_sim SUBDIR += vipster SUBDIR += vmd SUBDIR += voro++ SUBDIR += votca SUBDIR += wannier90 SUBDIR += wwplot SUBDIR += wxmacmolplt SUBDIR += xcfun SUBDIR += xcrysden SUBDIR += xdrawchem SUBDIR += xtb SUBDIR += yoda SUBDIR += zotero .include diff --git a/science/py-klusta/Makefile b/science/py-klusta/Makefile new file mode 100644 index 000000000000..9f601641b35c --- /dev/null +++ b/science/py-klusta/Makefile @@ -0,0 +1,34 @@ +PORTNAME= klusta +DISTVERSION= 3.0.16 +CATEGORIES= science python +MASTER_SITES= PYPI +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= yuri@FreeBSD.org +COMMENT= Spike detection and automatic clustering for spike sorting +WWW= https://github.com/kwikteam/klusta + +LICENSE= BSD3CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools>0:devel/py-setuptools@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR} +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}numpy>0:math/py-numpy@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}requests>0:www/py-requests@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}scipy>0:science/py-scipy@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}six>0:devel/py-six@${PY_FLAVOR} +TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}responses>0:devel/py-responses@${PY_FLAVOR} + +USES= python +USE_PYTHON= pep517 concurrent autoplist pytest +TEST_ARGS= -p no:relaxed --ignore=build +PYTEST_IGNORED_TESTS= test_klustakwik \ + test_sparsify_features_masks \ + test_launch_shanks \ + test_launch_real + +NO_ARCH= yes + +# tests as of 3.0.16: 92 passed, 4 deselected, 13 warnings in 2.51s + +.include diff --git a/science/py-klusta/distinfo b/science/py-klusta/distinfo new file mode 100644 index 000000000000..eb3ca0fa3135 --- /dev/null +++ b/science/py-klusta/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1782557086 +SHA256 (klusta-3.0.16.tar.gz) = 544e7c68467206198a9896910060f74ea73a6278447e2606d4a02cce80f041a1 +SIZE (klusta-3.0.16.tar.gz) = 69775 diff --git a/science/py-klusta/files/patch-klusta_kwik_h5.py b/science/py-klusta/files/patch-klusta_kwik_h5.py new file mode 100644 index 000000000000..fd3bf0917b3b --- /dev/null +++ b/science/py-klusta/files/patch-klusta_kwik_h5.py @@ -0,0 +1,13 @@ +-- Replace deprecated ndarray.tostring() with ndarray.tobytes() for NumPy 2.0+ compatibility. +-- ndarray.tostring() was removed in NumPy 2.0. +--- klusta/kwik/h5.py.orig 2026-06-27 16:21:19 UTC ++++ klusta/kwik/h5.py +@@ -193,7 +193,7 @@ class File(object): + out = attrs[attr_name] + if (isinstance(out, (np.ndarray, np.generic)) and + out.dtype.kind == 'S'): +- out = out.tostring().decode('UTF-8') ++ out = out.tobytes().decode('UTF-8') + out = out.replace('\x00', '') + return out + except (TypeError, IOError): diff --git a/science/py-klusta/files/patch-klusta_tests_test__datasets.py b/science/py-klusta/files/patch-klusta_tests_test__datasets.py new file mode 100644 index 000000000000..fc68f541af6a --- /dev/null +++ b/science/py-klusta/files/patch-klusta_tests_test__datasets.py @@ -0,0 +1,66 @@ +-- Replace deprecated ndarray.tostring() with ndarray.tobytes() and +-- np.fromstring() with np.frombuffer() for NumPy 2.0+ compatibility. +-- Both were removed in NumPy 2.0. +--- klusta/tests/test_datasets.py.orig 2016-06-23 11:22:30 UTC ++++ klusta/tests/test_datasets.py +@@ -44,7 +44,7 @@ def mock_url(): + + @yield_fixture + def mock_url(): +- _add_mock_response(_URL, _DATA.tostring()) ++ _add_mock_response(_URL, _DATA.tobytes()) + _add_mock_response(_URL + '.md5', _CHECKSUM + ' ' + op.basename(_URL)) + yield + responses.reset() +@@ -52,7 +52,7 @@ def mock_urls(request): + + @yield_fixture(params=product((True, False), repeat=4)) + def mock_urls(request): +- data = _DATA.tostring() ++ data = _DATA.tobytes() + checksum = _CHECKSUM + url_data = _URL + url_checksum = _URL + '.md5' +@@ -84,7 +84,7 @@ def _check(data): + + + def _check(data): +- ae(np.fromstring(data, np.float32), _DATA) ++ ae(np.frombuffer(data, np.float32), _DATA) + + + #------------------------------------------------------------------------------ +@@ -122,7 +122,7 @@ def test_download_already_exists_valid(tempdir, mock_u + path = op.join(tempdir, 'test') + # Create valid file. + with open(path, 'ab') as f: +- f.write(_DATA.tostring()) ++ f.write(_DATA.tobytes()) + _check(_dl(path)) + + +@@ -154,13 +154,13 @@ def test_download_sample_data(tempdir): + name = 'hybrid_10sec.dat' + url = _BASE_URL['cortexlab'] + name + +- _add_mock_response(url, _DATA.tostring()) ++ _add_mock_response(url, _DATA.tobytes()) + _add_mock_response(url + '.md5', _CHECKSUM) + + download_sample_data(name, tempdir) + with open(op.join(tempdir, name), 'rb') as f: + data = f.read() +- ae(np.fromstring(data, np.float32), _DATA) ++ ae(np.frombuffer(data, np.float32), _DATA) + + responses.reset() + +@@ -171,7 +171,7 @@ def test_dat_file(tempdir): + low=-100, high=100).astype(np.int16) + fn = 'test-4ch-1s.dat' + _add_mock_response(_BASE_URL['github'] + 'test/' + fn, +- data.tostring()) ++ data.tobytes()) + + path = download_test_data(fn, tempdir) + with open(path, 'rb') as f: diff --git a/science/py-klusta/files/patch-klusta_traces_spikedetekt.py b/science/py-klusta/files/patch-klusta_traces_spikedetekt.py new file mode 100644 index 000000000000..c6e7ec908054 --- /dev/null +++ b/science/py-klusta/files/patch-klusta_traces_spikedetekt.py @@ -0,0 +1,26 @@ +-- Replace deprecated np.object with builtin object for NumPy 1.24+ compatibility. +-- np.object was removed in NumPy 1.24. +--- klusta/traces/spikedetekt.py.orig 2026-06-27 16:21:19 UTC ++++ klusta/traces/spikedetekt.py +@@ -69,7 +69,7 @@ def _array_list(arrs): + + + def _array_list(arrs): +- out = np.empty((len(arrs),), dtype=np.object) ++ out = np.empty((len(arrs),), dtype=object) + out[:] = arrs + return out + +@@ -385,10 +385,10 @@ class SpikeDetekt(object): + # groups). + waveforms = _array_list(waveforms) + assert waveforms.shape == (n_spikes,) +- assert waveforms.dtype == np.object ++ assert waveforms.dtype == object + + masks = _array_list(masks) +- assert masks.dtype == np.object ++ assert masks.dtype == object + assert masks.shape == (n_spikes,) + + # Reorder the spikes. diff --git a/science/py-klusta/files/patch-klusta_traces_store.py b/science/py-klusta/files/patch-klusta_traces_store.py new file mode 100644 index 000000000000..e35880f02f3f --- /dev/null +++ b/science/py-klusta/files/patch-klusta_traces_store.py @@ -0,0 +1,13 @@ +-- Replace deprecated np.object with builtin object for NumPy 1.24+ compatibility. +-- np.object was removed in NumPy 1.24. +--- klusta/traces/store.py.orig 2026-06-27 16:21:19 UTC ++++ klusta/traces/store.py +@@ -97,7 +97,7 @@ class ArrayStore(object): + dtype = data.dtype + if not data.size: + return +- assert dtype != np.object ++ assert dtype != object + np.save(path, data) + # debug("Store {}.".format(path)) + diff --git a/science/py-klusta/files/patch-klusta_traces_tests_test__filter.py b/science/py-klusta/files/patch-klusta_traces_tests_test__filter.py new file mode 100644 index 000000000000..a568b5ed595e --- /dev/null +++ b/science/py-klusta/files/patch-klusta_traces_tests_test__filter.py @@ -0,0 +1,13 @@ +-- Fix np.linspace() call: the 'num' parameter must be an integer in NumPy 2.x. +-- The test used rate=10000. (float) which causes TypeError in NumPy 2.x. +--- klusta/traces/tests/test_filter.py.orig 2026-06-27 16:23:43 UTC ++++ klusta/traces/tests/test_filter.py +@@ -20,7 +20,7 @@ def test_apply_filter(): + def test_apply_filter(): + """Test bandpass filtering on a combination of two sinusoids.""" + +- rate = 10000. ++ rate = 10000 + low, high = 100., 200. + + # Create a signal with small and high frequencies. diff --git a/science/py-klusta/files/patch-klusta_traces_tests_test__spikedetekt.py b/science/py-klusta/files/patch-klusta_traces_tests_test__spikedetekt.py new file mode 100644 index 000000000000..b1c2da812033 --- /dev/null +++ b/science/py-klusta/files/patch-klusta_traces_tests_test__spikedetekt.py @@ -0,0 +1,13 @@ +-- Replace deprecated np.int with builtin int for NumPy 1.24+ compatibility. +-- np.int was removed in NumPy 1.24. +--- klusta/traces/tests/test_spikedetekt.py.orig 2026-06-27 16:21:19 UTC ++++ klusta/traces/tests/test_spikedetekt.py +@@ -46,7 +46,7 @@ def test_split_spikes(): + + + def test_split_spikes(): +- groups = np.zeros(10, dtype=np.int) ++ groups = np.zeros(10, dtype=int) + groups[1::2] = 1 + + idx = np.ones(10, dtype=np.bool) diff --git a/science/py-klusta/files/patch-klusta_utils.py b/science/py-klusta/files/patch-klusta_utils.py new file mode 100644 index 000000000000..51fb244e9c5c --- /dev/null +++ b/science/py-klusta/files/patch-klusta_utils.py @@ -0,0 +1,13 @@ +-- Replace deprecated np.int with builtin int for NumPy 1.24+ compatibility. +-- np.int was removed in NumPy 1.24. +--- klusta/utils.py.orig 2026-06-27 16:21:19 UTC ++++ klusta/utils.py +@@ -75,7 +75,7 @@ def _index_of(arr, lookup): + # values + lookup = np.asarray(lookup, dtype=np.int32) + m = (lookup.max() if len(lookup) else 0) + 1 +- tmp = np.zeros(m + 1, dtype=np.int) ++ tmp = np.zeros(m + 1, dtype=int) + # Ensure that -1 values are kept. + tmp[-1] = -1 + if len(lookup): diff --git a/science/py-klusta/pkg-descr b/science/py-klusta/pkg-descr new file mode 100644 index 000000000000..a3559df7e48b --- /dev/null +++ b/science/py-klusta/pkg-descr @@ -0,0 +1,4 @@ +Klusta is an open source package for automatic spike sorting of multielectrode +neurophysiological recordings. It implements spike detection, automatic +clustering, and manual curation interfaces for analyzing electrophysiology data +from probes containing up to a few dozen recording sites.