diff --git a/pkgs/development/python-modules/coffea/default.nix b/pkgs/development/python-modules/coffea/default.nix new file mode 100644 index 000000000000..ac0c293e29ab --- /dev/null +++ b/pkgs/development/python-modules/coffea/default.nix @@ -0,0 +1,97 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, hatchling +, hatch-vcs +, awkward +, uproot +, dask +, dask-awkward +, dask-histogram +, correctionlib +, pyarrow +, fsspec +, matplotlib +, numba +, numpy +, scipy +, tqdm +, lz4 +, cloudpickle +, toml +, mplhep +, packaging +, pandas +, hist +, cachetools +, distributed +, pyinstrument +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "coffea"; + version = "2023.6.0.rc1"; + format = "pyproject"; + + src = fetchFromGitHub { + owner = "CoffeaTeam"; + repo = pname; + rev = "refs/tags/v${version}"; + hash = "sha256-TEtQ2KnwcylQbprlRtgHv7HIFg7roDWD4TihrQE4icU="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace "numba>=0.57.0" "numba" + ''; + + nativeBuildInputs = [ + hatchling + hatch-vcs + ]; + + propagatedBuildInputs = [ + awkward + uproot + dask + dask.optional-dependencies.array + dask-awkward + dask-histogram + correctionlib + pyarrow + fsspec + matplotlib + numba + numpy + scipy + tqdm + lz4 + cloudpickle + toml + mplhep + packaging + pandas + hist + cachetools + ]; + + SETUPTOOLS_SCM_PRETEND_VERSION = version; + + nativeCheckInputs = [ + distributed + pyinstrument + pytestCheckHook + ]; + + pythonImportsCheck = [ + "coffea" + ]; + + meta = with lib; { + description = "Basic tools and wrappers for enabling not-too-alien syntax when running columnar Collider HEP analysis"; + homepage = "https://github.com/CoffeaTeam/coffea"; + license = with licenses; [ bsd3 ]; + maintainers = with maintainers; [ veprbl ]; + }; +} diff --git a/pkgs/development/python-modules/correctionlib/default.nix b/pkgs/development/python-modules/correctionlib/default.nix new file mode 100644 index 000000000000..41ac4a8f8f36 --- /dev/null +++ b/pkgs/development/python-modules/correctionlib/default.nix @@ -0,0 +1,64 @@ +{ lib +, buildPythonPackage +, fetchPypi +, cmake +, numpy +, scikit-build +, setuptools +, setuptools-scm +, pybind11 +, pydantic +, pytestCheckHook +, rich +, scipy +, zlib +}: + +buildPythonPackage rec { + pname = "correctionlib"; + version = "2.2.2"; + format = "pyproject"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-h3eggtPLSF/8ShQ5xzowZW1KSlcI/YBsPu3lsSyzHkw="; + }; + + nativeBuildInputs = [ + cmake + numpy + scikit-build + setuptools + setuptools-scm + pybind11 + ]; + + buildInputs = [ + zlib + ]; + + propagatedBuildInputs = [ + pydantic + rich + ]; + + dontUseCmakeConfigure = true; + + SETUPTOOLS_SCM_PRETEND_VERSION = version; + + nativeCheckInputs = [ + pytestCheckHook + scipy + ]; + + pythonImportsCheck = [ + "correctionlib" + ]; + + meta = with lib; { + description = "Provides a well-structured JSON data format for a wide variety of ad-hoc correction factors encountered in a typical HEP analysis"; + homepage = "https://cms-nanoaod.github.io/correctionlib/"; + license = with licenses; [ bsd3 ]; + maintainers = with maintainers; [ veprbl ]; + }; +} diff --git a/pkgs/development/python-modules/dask-histogram/default.nix b/pkgs/development/python-modules/dask-histogram/default.nix new file mode 100644 index 000000000000..6b2fbb01d270 --- /dev/null +++ b/pkgs/development/python-modules/dask-histogram/default.nix @@ -0,0 +1,49 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, boost-histogram +, dask +, hatchling +, hatch-vcs +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "dask-histogram"; + version = "2023.6.0"; + format = "pyproject"; + + src = fetchFromGitHub { + owner = "dask-contrib"; + repo = "dask-histogram"; + rev = "refs/tags/${version}"; + hash = "sha256-9b2+vrUH8lZYsEbJg+GmY5zHZ+7PyA9NV2h5VAN0J1s="; + }; + + nativeBuildInputs = [ + hatchling + hatch-vcs + ]; + + propagatedBuildInputs = [ + boost-histogram + dask + ]; + + SETUPTOOLS_SCM_PRETEND_VERSION = version; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "dask_histogram" + ]; + + meta = with lib; { + description = "Histograms with task scheduling"; + homepage = "https://dask-histogram.readthedocs.io/"; + license = with licenses; [ bsd3 ]; + maintainers = with maintainers; [ veprbl ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 36ef507e2ee2..eb51a01b6ce2 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1731,6 +1731,8 @@ self: super: with self; { cexprtk = callPackage ../development/python-modules/cexprtk { }; + coffea = callPackage ../development/python-modules/coffea { }; + cohere = callPackage ../development/python-modules/cohere { }; coincurve = callPackage ../development/python-modules/coincurve { @@ -1743,6 +1745,8 @@ self: super: with self; { connio = callPackage ../development/python-modules/connio { }; + correctionlib = callPackage ../development/python-modules/correctionlib { }; + coqpit = callPackage ../development/python-modules/coqpit { }; cepa = callPackage ../development/python-modules/cepa { }; @@ -2375,6 +2379,8 @@ self: super: with self; { dask-glm = callPackage ../development/python-modules/dask-glm { }; + dask-histogram = callPackage ../development/python-modules/dask-histogram { }; + dask-image = callPackage ../development/python-modules/dask-image { }; dask-jobqueue = callPackage ../development/python-modules/dask-jobqueue { };