diff --git a/pkgs/development/python-modules/sweeps/default.nix b/pkgs/development/python-modules/sweeps/default.nix new file mode 100644 index 000000000000..5ceb3e7d2d06 --- /dev/null +++ b/pkgs/development/python-modules/sweeps/default.nix @@ -0,0 +1,93 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + setuptools, + + # dependencies + jsonref, + jsonschema, + numpy, + pydantic, + pyyaml, + scikit-learn, + scipy, + + # tests + pytest-xdist, + pytestCheckHook, + writableTmpDirAsHomeHook, +}: + +buildPythonPackage (finalAttrs: { + pname = "sweeps"; + version = "0.2.0"; + pyproject = true; + __structuredAttrs = true; + + src = fetchFromGitHub { + owner = "wandb"; + repo = "sweeps"; + tag = "v${finalAttrs.version}"; + hash = "sha256-QqtyYpPChPNFN+3Rlpp1x1H0FFgxHPO3zFGcY6Pl24A="; + }; + + # Requires unpackaged pytest-profiling + postPatch = '' + substituteInPlace pytest.ini \ + --replace-fail "--profile" "" + ''; + + build-system = [ + setuptools + ]; + + dependencies = [ + jsonref + jsonschema + numpy + pydantic + pyyaml + scikit-learn + scipy + ]; + + pythonImportsCheck = [ "sweeps" ]; + + nativeCheckInputs = [ + pytest-xdist + pytestCheckHook + writableTmpDirAsHomeHook + ]; + + disabledTests = [ + # AssertionError: assert [] == [SweepRun(nam...running=None)] + "test_5runs_band1_stop_2" + "test_5runs_band1_stop_2_1stnoband" + "test_eta_3" + "test_eta_3_max" + + # AssertionError: assert [] == [10, 6, 1] + "test_skipped_steps" + + # ValueError: Cannot extract metric loss from run + "test_runs_bayes_runs2" + + # KeyError: 'loss is not a summary metric of this run.' + "test_summary_metric_none" + + # AssertionError: Not equal to tolerance rtol=1e-07, atol=0.01 + "test_bayes_impute_best" + "test_bayes_impute_latest" + ]; + + meta = { + description = "W&B Hyperparameter Sweep Engine"; + homepage = "https://github.com/wandb/sweeps"; + changelog = "https://github.com/wandb/sweeps/releases/tag/${finalAttrs.src.tag}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ GaetanLepage ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 62a7c54cd3e5..c10ff4f33002 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -20150,6 +20150,8 @@ self: super: with self; { swcgeom = callPackage ../development/python-modules/swcgeom { }; + sweeps = callPackage ../development/python-modules/sweeps { }; + swh-auth = callPackage ../development/python-modules/swh-auth { }; swh-core = callPackage ../development/python-modules/swh-core { };