1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 setuptools,
8 setuptools-git-versioning,
9
10 # dependencies
11 ezyrb,
12 future,
13 h5netcdf,
14 matplotlib,
15 numpy,
16 scipy,
17 xarray,
18
19 # tests
20 pytest-mock,
21 pytestCheckHook,
22}:
23
24buildPythonPackage rec {
25 pname = "pydmd";
26 version = "2025.08.01";
27 pyproject = true;
28
29 src = fetchFromGitHub {
30 owner = "PyDMD";
31 repo = "PyDMD";
32 tag = version;
33 hash = "sha256-u8dW90FZSZaVbPNeILeZyOwAU0WOAeTAMCHpe7n4Bi4=";
34 };
35
36 postPatch = ''
37 substituteInPlace pyproject.toml \
38 --replace-fail "setuptools-git-versioning>=2.0,<3" "setuptools-git-versioning"
39 '';
40
41 build-system = [
42 setuptools
43 setuptools-git-versioning
44 ];
45
46 dependencies = [
47 ezyrb
48 future
49 h5netcdf
50 matplotlib
51 numpy
52 scipy
53 xarray
54 ];
55
56 pythonImportsCheck = [ "pydmd" ];
57
58 nativeCheckInputs = [
59 pytest-mock
60 pytestCheckHook
61 ];
62
63 meta = {
64 description = "Python Dynamic Mode Decomposition";
65 homepage = "https://pydmd.github.io/PyDMD/";
66 changelog = "https://github.com/PyDMD/PyDMD/releases/tag/${src.tag}";
67 license = lib.licenses.mit;
68 maintainers = with lib.maintainers; [ yl3dy ];
69 };
70}