at master 3.1 kB view raw
1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 6 # build-system 7 setuptools, 8 9 # dependencies 10 dill, 11 numpy, 12 pandas, 13 sortedcontainers, 14 typing-extensions, 15 16 # optional-dependencies 17 autograd, 18 botorch, 19 # configspace, 20 fastparquet, 21 h5py, 22 huggingface-hub, 23 matplotlib, 24 onnxruntime, 25 pymoo, 26 pyyaml, 27 scikit-learn, 28 scipy, 29 # smac, 30 statsmodels, 31 swig, 32 xgboost, 33 # yahpo-gym, 34 35 # tests 36 pytestCheckHook, 37 pytest-timeout, 38 ray, 39 writableTmpDirAsHomeHook, 40}: 41buildPythonPackage rec { 42 pname = "syne-tune"; 43 version = "0.14.2"; 44 pyproject = true; 45 46 src = fetchFromGitHub { 47 owner = "syne-tune"; 48 repo = "syne-tune"; 49 tag = "v${version}"; 50 hash = "sha256-51QyfJ0XOcXTeE95YOhtUmhat23joaEYvUnk7hYfksY="; 51 }; 52 53 postPatch = '' 54 substituteInPlace syne_tune/optimizer/schedulers/synchronous/hyperband.py \ 55 --replace-fail 'metric_val=np.NAN' 'metric_val=np.nan' 56 substituteInPlace syne_tune/optimizer/schedulers/synchronous/dehb.py \ 57 --replace-fail 'result_failed.metric_val = np.NAN' 'result_failed.metric_val = np.nan' 58 ''; 59 60 build-system = [ 61 setuptools 62 ]; 63 64 pythonRelaxDeps = [ 65 "numpy" 66 ]; 67 68 dependencies = [ 69 dill 70 numpy 71 pandas 72 sortedcontainers 73 typing-extensions 74 ]; 75 76 optional-dependencies = lib.fix (self: { 77 blackbox-repository = [ 78 fastparquet 79 h5py 80 huggingface-hub 81 numpy 82 pandas 83 scikit-learn 84 xgboost 85 ]; 86 bore = [ 87 scikit-learn 88 xgboost 89 ]; 90 botorch = [ botorch ]; 91 gpsearchers = [ 92 autograd 93 scipy 94 ]; 95 kde = [ statsmodels ]; 96 moo = [ 97 pymoo 98 scipy 99 ]; 100 sklearn = [ scikit-learn ]; 101 # smac = [ smac swig ]; # smac unavailable on nixpkgs 102 visual = [ matplotlib ]; 103 # yahpo = [ configspace onnxruntime pandas pyyaml yahpo-gym ]; # yahpo-gym unavailable on nixpkgs 104 }); 105 106 nativeCheckInputs = [ 107 pytestCheckHook 108 pytest-timeout 109 ray 110 writableTmpDirAsHomeHook 111 ] 112 ++ ray.optional-dependencies.tune 113 ++ optional-dependencies.blackbox-repository 114 ++ optional-dependencies.bore 115 ++ optional-dependencies.botorch 116 ++ optional-dependencies.gpsearchers 117 ++ optional-dependencies.kde 118 ++ optional-dependencies.sklearn; 119 120 disabledTests = [ 121 # NameError: name 'HV' is not defined 122 # these require pkg `pymoo` and adding `pymoo` raises: 123 # setuptools.errors.PackageDiscoveryError: Multiple top-level packages discovered in a flat-layout: ['cma', 'notebooks']. 124 "test_append_hypervolume_indicator" 125 "test_hypervolume" 126 "test_hypervolume_progress" 127 "test_hypervolume_simple" 128 ]; 129 130 disabledTestPaths = [ 131 # legacy test 132 "tst/schedulers/test_legacy_schedulers_api.py" 133 ]; 134 135 pythonImportsCheck = [ 136 "syne_tune" 137 ]; 138 139 meta = { 140 description = "Large scale asynchronous hyperparameter and architecture optimization library"; 141 homepage = "https://github.com/syne-tune/syne-tune"; 142 changelog = "https://github.com/syne-tune/syne-tune/releases/tag/${src.tag}"; 143 license = lib.licenses.asl20; 144 maintainers = with lib.maintainers; [ daspk04 ]; 145 }; 146}