summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/ax-platform/default.nix
blob: 6fea52b2f2d06d3ad914d237d153346f0c11fd12 (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
{
  lib,
  stdenv,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  setuptools,
  setuptools-scm,

  # dependencies
  botorch,
  ipywidgets,
  jinja2,
  markdown,
  pandas,
  plotly,
  pyre-extensions,
  scikit-learn,
  scipy,
  sympy,

  # tests
  pyfakefs,
  pytestCheckHook,
  sqlalchemy,
  tabulate,
}:

buildPythonPackage rec {
  pname = "ax-platform";
  version = "1.2.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "facebook";
    repo = "ax";
    tag = version;
    hash = "sha256-WjJhBSj5lKt1ygrJ2QdxUxEvCrfnanLY8yWs7qy/GIY=";
  };

  env.ALLOW_BOTORCH_LATEST = "1";

  build-system = [
    setuptools
    setuptools-scm
  ];

  dependencies = [
    botorch
    ipywidgets
    jinja2
    markdown
    pandas
    plotly
    pyre-extensions
    scikit-learn
    scipy
    sympy
  ]
  ++ botorch.optional-dependencies.pymoo;

  nativeCheckInputs = [
    pyfakefs
    pytestCheckHook
    sqlalchemy
    tabulate
  ];

  disabledTestPaths = [
    "ax/benchmark"
    "ax/runners/tests/test_torchx.py"

    # broken with sqlalchemy 2
    "ax/core/tests/test_experiment.py"
    "ax/service/tests/test_ax_client.py"
    "ax/service/tests/test_orchestrator.py"
    "ax/service/tests/test_with_db_settings_base.py"

    # Hangs forever
    "ax/analysis/plotly/tests/test_top_surfaces.py::TestTopSurfacesAnalysis::test_online"
  ];

  disabledTests = [
    # sqlalchemy.exc.ArgumentError: Strings are not accepted for attribute names in loader options; please use class-bound attributes directly.
    "SQAStoreUtilsTest"
    "SQAStoreTest"

    # ValueError: Expected dim to be an integer greater than or equal to 2. Found dim=1.
    "test_get_model"

    # ValueError: `db_settings` argument should be of type ax.storage.sqa_store
    "test_get_next_trials_with_db"

    # exact comparison of floating points
    "test_optimize_l0_homotopy"
    # AssertionError: 5 != 2
    "test_get_standard_plots_moo"
    # AssertionError: Expected 'warning' to be called once. Called 3 times
    "test_validate_kwarg_typing"
    # uses torch.equal
    "test_convert_observations"
    # broken with sqlalchemy 2
    "test_sql_storage"
  ]
  ++ lib.optionals stdenv.hostPlatform.isDarwin [
    # flaky on x86
    "test_gen_with_expanded_parameter_space"
  ];

  pythonImportsCheck = [ "ax" ];

  meta = {
    description = "Platform for understanding, managing, deploying, and automating adaptive experiments";
    homepage = "https://ax.dev/";
    changelog = "https://github.com/facebook/Ax/releases/tag/${version}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ veprbl ];
  };
}