Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

112 lines
2.2 KiB
Nix
Raw Permalink Normal View History

{
lib,
stdenv,
buildPythonPackage,
2025-02-16 01:41:18 +01:00
fetchFromGitHub,
# build-system
setuptools,
2025-02-16 01:41:18 +01:00
# dependencies
matplotlib,
2025-02-16 01:41:18 +01:00
numpy,
pandas,
requests,
2025-02-16 01:41:18 +01:00
scikit-learn,
scipy,
# tests
astropy,
coverage,
2025-02-16 01:41:18 +01:00
mock,
plotly,
pytest-cov-stub,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "neurokit2";
version = "0.2.10";
pyproject = true;
src = fetchFromGitHub {
owner = "neuropsychology";
repo = "NeuroKit";
tag = "v${version}";
hash = "sha256-e/B1JvO6uYZ6iVskFvxZLSSXi0cPep9bBZ0JXZTVS28=";
};
postPatch = ''
substituteInPlace setup.py \
2025-02-16 01:41:18 +01:00
--replace-fail '"pytest-runner", ' ""
'';
build-system = [
setuptools
];
dependencies = [
matplotlib
2025-02-16 01:41:18 +01:00
numpy
pandas
requests
2025-02-16 01:41:18 +01:00
scikit-learn
scipy
];
nativeCheckInputs = [
pytest-cov-stub
mock
plotly
astropy
coverage
pytestCheckHook
];
disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
# Crash in matplotlib (Fatal Python error: Aborted)
"test_events_plot"
];
disabledTestPaths = [
# Required dependencies not available in nixpkgs
"tests/tests_bio.py"
2025-02-16 01:41:18 +01:00
"tests/tests_complexity.py"
"tests/tests_data.py"
2025-02-16 01:41:18 +01:00
"tests/tests_ecg.py"
"tests/tests_ecg_delineate.py"
"tests/tests_ecg_findpeaks.py"
"tests/tests_eda.py"
2025-02-16 01:41:18 +01:00
"tests/tests_eeg.py"
"tests/tests_emg.py"
2025-02-16 01:41:18 +01:00
"tests/tests_eog.py"
"tests/tests_epochs.py"
"tests/tests_hrv.py"
"tests/tests_ppg.py"
2025-02-16 01:41:18 +01:00
"tests/tests_rsp.py"
"tests/tests_signal.py"
# Dependency is broken `mne-python`
"tests/tests_microstates.py"
];
pytestFlags = [
2025-02-16 01:41:18 +01:00
# Otherwise, test collection fails with:
# AttributeError: module 'scipy.ndimage._delegators' has no attribute '@py_builtins_signature'. Did you mean: 'grey_dilation_signature'?
# https://github.com/scipy/scipy/issues/22236
"--assert=plain"
];
pythonImportsCheck = [
"neurokit2"
];
meta = {
description = "Python Toolbox for Neurophysiological Signal Processing";
homepage = "https://github.com/neuropsychology/NeuroKit";
changelog = "https://github.com/neuropsychology/NeuroKit/releases/tag/v${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ genga898 ];
};
}