Unverified Commit 960f1669 authored by Gaétan Lepage's avatar Gaétan Lepage Committed by GitHub
Browse files

python3Packages.syne-tune: init at 0.14.2 (#438533)

parents c14b05ac 036b471c
Loading
Loading
Loading
Loading
+146 −0
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  setuptools,

  # dependencies
  dill,
  numpy,
  pandas,
  sortedcontainers,
  typing-extensions,

  # optional-dependencies
  autograd,
  botorch,
  # configspace,
  fastparquet,
  h5py,
  huggingface-hub,
  matplotlib,
  onnxruntime,
  pymoo,
  pyyaml,
  scikit-learn,
  scipy,
  # smac,
  statsmodels,
  swig,
  xgboost,
  # yahpo-gym,

  # tests
  pytestCheckHook,
  pytest-timeout,
  ray,
  writableTmpDirAsHomeHook,
}:
buildPythonPackage rec {
  pname = "syne-tune";
  version = "0.14.2";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "syne-tune";
    repo = "syne-tune";
    tag = "v${version}";
    hash = "sha256-51QyfJ0XOcXTeE95YOhtUmhat23joaEYvUnk7hYfksY=";
  };

  postPatch = ''
    substituteInPlace syne_tune/optimizer/schedulers/synchronous/hyperband.py \
     --replace-fail 'metric_val=np.NAN' 'metric_val=np.nan'
    substituteInPlace syne_tune/optimizer/schedulers/synchronous/dehb.py \
     --replace-fail 'result_failed.metric_val = np.NAN' 'result_failed.metric_val = np.nan'
  '';

  build-system = [
    setuptools
  ];

  pythonRelaxDeps = [
    "numpy"
  ];

  dependencies = [
    dill
    numpy
    pandas
    sortedcontainers
    typing-extensions
  ];

  optional-dependencies = lib.fix (self: {
    blackbox-repository = [
      fastparquet
      h5py
      huggingface-hub
      numpy
      pandas
      scikit-learn
      xgboost
    ];
    bore = [
      scikit-learn
      xgboost
    ];
    botorch = [ botorch ];
    gpsearchers = [
      autograd
      scipy
    ];
    kde = [ statsmodels ];
    moo = [
      pymoo
      scipy
    ];
    sklearn = [ scikit-learn ];
    # smac = [ smac swig ]; # smac unavailable on nixpkgs
    visual = [ matplotlib ];
    # yahpo = [ configspace onnxruntime pandas pyyaml yahpo-gym ]; # yahpo-gym unavailable on nixpkgs
  });

  nativeCheckInputs = [
    pytestCheckHook
    pytest-timeout
    ray
    writableTmpDirAsHomeHook
  ]
  ++ ray.optional-dependencies.tune
  ++ optional-dependencies.blackbox-repository
  ++ optional-dependencies.bore
  ++ optional-dependencies.botorch
  ++ optional-dependencies.gpsearchers
  ++ optional-dependencies.kde
  ++ optional-dependencies.sklearn;

  disabledTests = [
    # NameError: name 'HV' is not defined
    # these require pkg `pymoo` and adding `pymoo` raises:
    # setuptools.errors.PackageDiscoveryError: Multiple top-level packages discovered in a flat-layout: ['cma', 'notebooks'].
    "test_append_hypervolume_indicator"
    "test_hypervolume"
    "test_hypervolume_progress"
    "test_hypervolume_simple"
  ];

  disabledTestPaths = [
    # legacy test
    "tst/schedulers/test_legacy_schedulers_api.py"
  ];

  pythonImportsCheck = [
    "syne_tune"
  ];

  meta = {
    description = "Large scale asynchronous hyperparameter and architecture optimization library";
    homepage = "https://github.com/syne-tune/syne-tune";
    changelog = "https://github.com/syne-tune/syne-tune/releases/tag/${src.tag}";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ daspk04 ];
  };
}
+2 −0
Original line number Diff line number Diff line
@@ -17790,6 +17790,8 @@ self: super: with self; {
    }
  );
  syne-tune = callPackage ../development/python-modules/syne-tune { };
  synergy = callPackage ../development/python-modules/synergy { };
  synology-srm = callPackage ../development/python-modules/synology-srm { };