about summary refs log tree commit diff
path: root/pkgs/development/python-modules/botorch/default.nix
blob: 7a860437c1b898ad6946e0e168d78a246b63b774 (plain) (blame)
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
67
68
69
70
71
72
73
74
75
{
  lib,
  stdenv,
  buildPythonPackage,
  fetchFromGitHub,
  gpytorch,
  linear-operator,
  multipledispatch,
  pyro-ppl,
  setuptools,
  setuptools-scm,
  torch,
  scipy,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "botorch";
  version = "0.11.3";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "pytorch";
    repo = "botorch";
    rev = "refs/tags/v${version}";
    hash = "sha256-AtRU5KC8KlkxMCU0OUAHDFK7BsPO3TbRmmzDGV7+yVk=";
  };

  build-system = [
    setuptools
    setuptools-scm
  ];

  dependencies = [
    gpytorch
    linear-operator
    multipledispatch
    pyro-ppl
    scipy
    torch
  ];

  pythonRelaxDeps = [
    "gpytorch"
    "linear-operator"
  ];

  nativeCheckInputs = [ pytestCheckHook ];

  pytestFlagsArray = [
    # tests tend to get stuck on busy hosts, increase verbosity to find out
    # which specific tests get stuck
    "-vvv"
  ];

  disabledTests =
    [ "test_all_cases_covered" ]
    ++ lib.optionals (stdenv.buildPlatform.system == "x86_64-linux") [
      # stuck tests on hydra
      "test_moo_predictive_entropy_search"
    ];

  pythonImportsCheck = [ "botorch" ];

  # needs lots of undisturbed CPU time or prone to getting stuck
  requiredSystemFeatures = [ "big-parallel" ];

  meta = with lib; {
    changelog = "https://github.com/pytorch/botorch/blob/${src.rev}/CHANGELOG.md";
    description = "Bayesian Optimization in PyTorch";
    homepage = "https://botorch.org";
    license = licenses.mit;
    maintainers = with maintainers; [ veprbl ];
  };
}