diff --git a/pkgs/development/python-modules/arviz-base/default.nix b/pkgs/development/python-modules/arviz-base/default.nix new file mode 100644 index 000000000000..5ff4601940eb --- /dev/null +++ b/pkgs/development/python-modules/arviz-base/default.nix @@ -0,0 +1,120 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + flit-core, + + # dependencies + numpy, + typing-extensions, + xarray, + + # optional-dependencies + black, + build, + isort, + mypy, + pre-commit, + cloudpickle, + h5netcdf, + jupyter-sphinx, + myst-nb, + myst-parser, + numpydoc, + sphinx, + sphinx-book-theme, + sphinx-copybutton, + sphinx-design, + netcdf4, + pytest, + pytest-cov, + scipy, + zarr, + + # tests + pytestCheckHook, + writableTmpDirAsHomeHook, +}: + +buildPythonPackage (finalAttrs: { + pname = "arviz-base"; + version = "0.8.2"; + pyproject = true; + + src = fetchFromGitHub { + owner = "arviz-devs"; + repo = "arviz-base"; + tag = "v${finalAttrs.version}"; + hash = "sha256-g2DmhYqO9dgvDZwAXXSDFn5wHU0BvxXNgOzk6mmEmsw="; + }; + + build-system = [ + flit-core + ]; + + dependencies = [ + numpy + typing-extensions + xarray + ]; + + optional-dependencies = { + check = [ + black + build + # docstub + isort + mypy + pre-commit + ]; + ci = [ + cloudpickle + pre-commit + ]; + doc = [ + h5netcdf + jupyter-sphinx + myst-nb + myst-parser + numpydoc + sphinx + sphinx-book-theme + sphinx-copybutton + sphinx-design + ]; + h5netcdf = [ + h5netcdf + ]; + netcdf4 = [ + netcdf4 + ]; + test = [ + pytest + pytest-cov + scipy + xarray + ]; + zarr = [ + zarr + ]; + }; + + pythonImportsCheck = [ "arviz_base" ]; + + nativeCheckInputs = [ + h5netcdf + netcdf4 + pytestCheckHook + writableTmpDirAsHomeHook + ]; + + meta = { + description = "Base ArviZ features and converters"; + homepage = "https://github.com/arviz-devs/arviz-base"; + changelog = "https://github.com/arviz-devs/arviz-base/blob/${finalAttrs.src.tag}/CHANGELOG.md"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ GaetanLepage ]; + }; +}) diff --git a/pkgs/development/python-modules/arviz-plots/default.nix b/pkgs/development/python-modules/arviz-plots/default.nix new file mode 100644 index 000000000000..c0f2a3649117 --- /dev/null +++ b/pkgs/development/python-modules/arviz-plots/default.nix @@ -0,0 +1,121 @@ +{ + lib, + stdenv, + buildPythonPackage, + fetchFromGitHub, + + # build-system + flit-core, + + # dependencies + arviz-base, + arviz-stats, + + # optional-dependencies + # bokeh + bokeh, + # doc + h5netcdf, + jupyter-sphinx, + myst-nb, + myst-parser, + numpydoc, + plotly, + sphinx, + sphinx-book-theme, + sphinx-copybutton, + sphinx-design, + # matplotlib + matplotlib, + # plotly + webcolors, + # test + hypothesis, + kaleido, + pytest, + pytest-cov, + + # tests + pytestCheckHook, +}: + +buildPythonPackage (finalAttrs: { + pname = "arviz-plots"; + version = "0.8.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "arviz-devs"; + repo = "arviz-plots"; + tag = "v${finalAttrs.version}"; + hash = "sha256-x4UoUSKz+MAI082afnGhfoy2ad/hPK89Y1B2oEnxhsg="; + }; + + build-system = [ + flit-core + ]; + + dependencies = [ + arviz-base + arviz-stats + ] + # Otherwise, import fails with "ModuleNotFoundError: No module named 'xarray_einstats'" + ++ arviz-stats.optional-dependencies.xarray; + + optional-dependencies = { + bokeh = [ + bokeh + ]; + doc = [ + h5netcdf + jupyter-sphinx + myst-nb + myst-parser + numpydoc + plotly + sphinx + sphinx-book-theme + sphinx-copybutton + sphinx-design + ]; + matplotlib = [ + matplotlib + ]; + plotly = [ + plotly + webcolors + ]; + test = [ + h5netcdf + hypothesis + kaleido + pytest + pytest-cov + ]; + }; + + pythonImportsCheck = [ "arviz_plots" ]; + + env = lib.optionalAttrs stdenv.hostPlatform.isDarwin { + # Prevents 'Fatal Python error: Aborted' on darwin during checkPhase + MPLBACKEND = "Agg"; + }; + + nativeCheckInputs = [ + bokeh + h5netcdf + hypothesis + matplotlib + plotly + pytestCheckHook + webcolors + ]; + + meta = { + description = "ArviZ modular plotting"; + homepage = "https://github.com/arviz-devs/arviz-plots"; + changelog = "https://github.com/arviz-devs/arviz-plots/blob/${finalAttrs.src.tag}/CHANGELOG.md"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ GaetanLepage ]; + }; +}) diff --git a/pkgs/development/python-modules/arviz-stats/default.nix b/pkgs/development/python-modules/arviz-stats/default.nix new file mode 100644 index 000000000000..f3627df9b35d --- /dev/null +++ b/pkgs/development/python-modules/arviz-stats/default.nix @@ -0,0 +1,106 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + flit-core, + + # dependencies + numpy, + scipy, + + # optional-dependencies + # doc + h5netcdf, + jupyter-sphinx, + myst-nb, + myst-parser, + numpydoc, + sphinx, + sphinx-book-theme, + sphinx-copybutton, + sphinx-design, + # numba + numba, + xarray-einstats, + # test + pytest, + pytest-cov, + + # xarray + arviz-base, + xarray, + + # tests + pytestCheckHook, +}: + +buildPythonPackage (finalAttrs: { + pname = "arviz-stats"; + version = "0.8.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "arviz-devs"; + repo = "arviz-stats"; + tag = "v${finalAttrs.version}"; + hash = "sha256-FAZXnKxNb/DPkcpIRJRIzSbthS8Djf75hd5WMxegdhY="; + }; + + build-system = [ + flit-core + ]; + + dependencies = [ + numpy + scipy + ]; + + optional-dependencies = { + doc = [ + h5netcdf + jupyter-sphinx + myst-nb + myst-parser + numpydoc + sphinx + # sphinx-autosummary-accessors + sphinx-book-theme + sphinx-copybutton + sphinx-design + ]; + numba = [ + numba + xarray-einstats + ]; + test = [ + pytest + pytest-cov + ]; + test-xarray = [ + h5netcdf + pytest + pytest-cov + ]; + xarray = [ + arviz-base + xarray + xarray-einstats + ]; + }; + + pythonImportsCheck = [ "arviz_stats" ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + meta = { + description = "Statistical computation and diagnostics for ArviZ"; + homepage = "https://github.com/arviz-devs/arviz-stats"; + changelog = "https://github.com/arviz-devs/arviz-stats/blob/${finalAttrs.src.tag}/CHANGELOG.md"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ GaetanLepage ]; + }; +}) diff --git a/pkgs/development/python-modules/arviz/default.nix b/pkgs/development/python-modules/arviz/default.nix index c77a786b2cdd..02e9fbcd0593 100644 --- a/pkgs/development/python-modules/arviz/default.nix +++ b/pkgs/development/python-modules/arviz/default.nix @@ -39,16 +39,16 @@ zarr, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "arviz"; - version = "0.23.0"; + version = "0.23.1"; pyproject = true; src = fetchFromGitHub { owner = "arviz-devs"; repo = "arviz"; - tag = "v${version}"; - hash = "sha256-/Xz4hTKB1lh9cxHkVXAZY8NsZoqdadukI/V1/LRZu24="; + tag = "v${finalAttrs.version}"; + hash = "sha256-twAYCH8jsOnXVD3+sstOLEGG1Enbq8M8ZQWffFVzS48="; }; nativeBuildInputs = [ @@ -65,6 +65,7 @@ buildPythonPackage rec { dependencies = [ h5netcdf + h5py matplotlib numpy pandas @@ -79,7 +80,6 @@ buildPythonPackage rec { cloudpickle emcee ffmpeg - h5py jax jaxlib numba @@ -124,8 +124,8 @@ buildPythonPackage rec { meta = { description = "Library for exploratory analysis of Bayesian models"; homepage = "https://arviz-devs.github.io/arviz/"; - changelog = "https://github.com/arviz-devs/arviz/blob/v${version}/CHANGELOG.md"; + changelog = "https://github.com/arviz-devs/arviz/blob/${finalAttrs.src.tag}/CHANGELOG.md"; license = lib.licenses.asl20; maintainers = with lib.maintainers; [ omnipotententity ]; }; -} +}) diff --git a/pkgs/development/python-modules/bambi/default.nix b/pkgs/development/python-modules/bambi/default.nix index 8a947ff6ce9d..238901ec4cde 100644 --- a/pkgs/development/python-modules/bambi/default.nix +++ b/pkgs/development/python-modules/bambi/default.nix @@ -9,11 +9,13 @@ setuptools-scm, # dependencies - arviz, + arviz-plots, formulae, graphviz, + matplotlib, pandas, pymc, + sparse, # tests blackjax, @@ -22,16 +24,16 @@ writableTmpDirAsHomeHook, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "bambi"; - version = "0.16.0"; + version = "0.17.2"; pyproject = true; src = fetchFromGitHub { owner = "bambinos"; repo = "bambi"; - tag = version; - hash = "sha256-EKcURfC4IpLGzr5ibzVlUnRHIhwPP+kYYusW9Mk8R/s="; + tag = finalAttrs.version; + hash = "sha256-Vjv62cYDIuTLE7MxRt4Havy7DMOiMTyIixbs4LGFGGs="; }; build-system = [ @@ -40,11 +42,13 @@ buildPythonPackage rec { ]; dependencies = [ - arviz + arviz-plots formulae graphviz + matplotlib pandas pymc + sparse ]; optional-dependencies = { @@ -124,8 +128,8 @@ buildPythonPackage rec { meta = { description = "High-level Bayesian model-building interface"; homepage = "https://bambinos.github.io/bambi"; - changelog = "https://github.com/bambinos/bambi/releases/tag/${src.tag}"; + changelog = "https://github.com/bambinos/bambi/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ bcdarwin ]; }; -} +}) diff --git a/pkgs/development/python-modules/formulae/default.nix b/pkgs/development/python-modules/formulae/default.nix index b216d05bc19a..bcadd72de408 100644 --- a/pkgs/development/python-modules/formulae/default.nix +++ b/pkgs/development/python-modules/formulae/default.nix @@ -2,24 +2,31 @@ lib, buildPythonPackage, fetchFromGitHub, + + # build-system setuptools, setuptools-scm, - pytestCheckHook, + + # dependencies numpy, + packaging, pandas, scipy, + + # tests + pytestCheckHook, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "formulae"; - version = "0.5.4"; + version = "0.6.1"; pyproject = true; src = fetchFromGitHub { owner = "bambinos"; repo = "formulae"; - tag = version; - hash = "sha256-SSyQa7soIp+wSXX5wek9LG95q7J7K34mztzx01lPiWo="; + tag = finalAttrs.version; + hash = "sha256-RrG0jkQAGq04cQ1MY5W0j76++tu7NerLC/HHpVVa5xQ="; }; build-system = [ @@ -29,6 +36,7 @@ buildPythonPackage rec { dependencies = [ numpy + packaging pandas scipy ]; @@ -51,8 +59,8 @@ buildPythonPackage rec { meta = { homepage = "https://bambinos.github.io/formulae"; description = "Formulas for mixed-effects models in Python"; - changelog = "https://github.com/bambinos/formulae/releases/tag/${src.tag}"; + changelog = "https://github.com/bambinos/formulae/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ bcdarwin ]; }; -} +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 64bb66d3f9f1..a470c5d9cb20 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -962,6 +962,12 @@ self: super: with self; { arviz = callPackage ../development/python-modules/arviz { }; + arviz-base = callPackage ../development/python-modules/arviz-base { }; + + arviz-plots = callPackage ../development/python-modules/arviz-plots { }; + + arviz-stats = callPackage ../development/python-modules/arviz-stats { }; + arxiv = callPackage ../development/python-modules/arxiv { }; arxiv2bib = callPackage ../development/python-modules/arxiv2bib { };