summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/uncertainties/default.nix
blob: d03fa46dab1733b817303e4be3b3f5e7132fbd2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  fetchpatch,

  # build-system
  setuptools,
  setuptools-scm,

  # optional-dependencies
  numpy,

  # tests
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "uncertainties";
  version = "3.2.3";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "lmfit";
    repo = "uncertainties";
    tag = version;
    hash = "sha256-YapujmwTlmUfTQwHsuh01V+jqsBbTd0Q9adGNiE8Go0=";
  };

  patches = [
    (fetchpatch {
      # python 3.14 compat
      url = "https://github.com/lmfit/uncertainties/commit/633da70494ae6570cc69a910e1f6231538acf374.patch";
      hash = "sha256-P1LiIqA2p58bjupJaf18A6YxBeu+PNpueHACry24OwQ=";
    })
  ];

  build-system = [
    setuptools
    setuptools-scm
  ];

  optional-dependencies.arrays = [ numpy ];

  nativeCheckInputs = [
    pytestCheckHook
  ]
  ++ optional-dependencies.arrays;

  disabledTests = [
    # Flaky tests, see: https://github.com/lmfit/uncertainties/issues/343
    "test_repeated_summation_complexity"
  ];

  pythonImportsCheck = [ "uncertainties" ];

  meta = {
    homepage = "https://uncertainties.readthedocs.io/";
    description = "Transparent calculations with uncertainties on the quantities involved (aka error propagation)";
    maintainers = with lib.maintainers; [
      rnhmjoj
      doronbehar
    ];
    license = lib.licenses.bsd3;
  };
}