Merge pull request #326141 from GaetanLepage/flowml

python311Packages.flowmc: init at 0.3.4
This commit is contained in:
OTABI Tomoya 2024-07-16 22:41:47 +09:00 committed by GitHub
commit d46ea5f4ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 256 additions and 0 deletions

View File

@ -0,0 +1,106 @@
{
lib,
buildPythonPackage,
pythonOlder,
fetchFromGitHub,
# build-system
setuptools,
setuptools-scm,
# dependencies
matplotlib,
# optional-dependencies
arviz,
ipython,
myst-nb,
pandoc,
sphinx,
sphinx-book-theme,
pytest,
scipy,
# checks
pytestCheckHook,
corner,
}:
buildPythonPackage rec {
pname = "corner";
version = "2.2.2";
pyproject = true;
disable = pythonOlder "3.9";
src = fetchFromGitHub {
owner = "dfm";
repo = "corner.py";
rev = "refs/tags/v${version}";
hash = "sha256-MYos01YCSUwivymSE2hbjV7eKXfaMqG89koD2CWZjcQ=";
};
build-system = [
setuptools
setuptools-scm
];
dependencies = [ matplotlib ];
optional-dependencies = {
arviz = [ arviz ];
docs = [
arviz
ipython
myst-nb
pandoc
sphinx
sphinx-book-theme
];
test = [
arviz
pytest
scipy
];
};
pythonImportsCheck = [ "corner" ];
nativeCheckInputs = [ pytestCheckHook ] ++ corner.passthru.optional-dependencies.test;
# matplotlib.testing.exceptions.ImageComparisonFailure: images not close
disabledTests = [
"test_arviz"
"test_basic"
"test_bins"
"test_bins_log"
"test_color"
"test_color_filled"
"test_extended_overplotting"
"test_hist_bin_factor"
"test_labels"
"test_lowNfilled"
"test_no_fill_contours"
"test_overplot_log"
"test_pandas"
"test_quantiles"
"test_range_fig_arg"
"test_reverse_overplotting"
"test_tight"
"test_title_quantiles"
"test_title_quantiles_default"
"test_title_quantiles_raises"
"test_titles1"
"test_titles2"
"test_top_ticks"
"test_truths"
];
meta = {
description = "Make some beautiful corner plots";
homepage = "https://github.com/dfm/corner.py";
changelog = "https://github.com/dfm/corner.py/releases/tag/v${version}";
license = lib.licenses.bsd2;
maintainers = with lib.maintainers; [ GaetanLepage ];
};
}

View File

@ -0,0 +1,84 @@
{
lib,
buildPythonPackage,
pythonOlder,
fetchFromGitHub,
# build-system
setuptools,
# dependencies
chex,
dotmap,
flax,
jax,
jaxlib,
matplotlib,
numpy,
pyyaml,
# checks
# brax, (unpackaged)
# gymnax, (unpackaged)
pytestCheckHook,
torch,
torchvision,
}:
buildPythonPackage rec {
pname = "evosax";
version = "0.1.6";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "RobertTLange";
repo = "evosax";
rev = "refs/tags/v.${version}";
hash = "sha256-v8wRiWZlJPF9pIXocQ6/caHl1W4QBNjkmuImJ6MAueo=";
};
build-system = [ setuptools ];
dependencies = [
chex
dotmap
flax
jax
jaxlib
matplotlib
numpy
pyyaml
];
pythonImportsCheck = [ "evosax" ];
preCheck = ''
export HOME=$(mktemp -d)
'';
nativeCheckInputs = [
# brax
# gymnax
pytestCheckHook
torch
torchvision
];
disabledTests = [
# Requires unpackaged gymnax
"test_env_ffw_rollout"
# Tries to download a data set from the internet
"test_vision_fitness"
];
meta = {
description = "Evolution Strategies in JAX";
homepage = "https://github.com/RobertTLange/evosax";
changelog = "https://github.com/RobertTLange/evosax/blob/${src.rev}/CHANGELOG.md";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ GaetanLepage ];
};
}

View File

@ -0,0 +1,60 @@
{
lib,
buildPythonPackage,
pythonOlder,
fetchFromGitHub,
# build-system
setuptools,
# dependencies
corner,
equinox,
evosax,
jax,
jaxlib,
optax,
tqdm,
# checks
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "flowmc";
version = "0.3.4";
pyproject = true;
disabled = pythonOlder "3.10";
src = fetchFromGitHub {
owner = "kazewong";
repo = "flowMC";
rev = "refs/tags/flowMC-${version}";
hash = "sha256-unvbNs0AOzW4OI+9y6KxoBC5yEjEz+q0PZblQLXCC/Y=";
};
build-system = [ setuptools ];
dependencies = [
corner
equinox
evosax
jax
jaxlib
optax
tqdm
];
pythonImportsCheck = [ "flowMC" ];
nativeCheckInputs = [ pytestCheckHook ];
meta = {
description = "Normalizing-flow enhanced sampling package for probabilistic inference in Jax";
homepage = "https://github.com/kazewong/flowMC";
changelog = "https://github.com/kazewong/flowMC/releases/tag/flowMC-${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ GaetanLepage ];
};
}

View File

@ -2523,6 +2523,8 @@ self: super: with self; {
coreschema = callPackage ../development/python-modules/coreschema { };
corner = callPackage ../development/python-modules/corner { };
cornice = callPackage ../development/python-modules/cornice { };
corsair-scan = callPackage ../development/python-modules/corsair-scan { };
@ -4026,6 +4028,8 @@ self: super: with self; {
evohome-async = callPackage ../development/python-modules/evohome-async { };
evosax = callPackage ../development/python-modules/evosax { };
evtx = callPackage ../development/python-modules/evtx { };
ewmh = callPackage ../development/python-modules/ewmh { };
@ -4504,6 +4508,8 @@ self: super: with self; {
flowlogs-reader = callPackage ../development/python-modules/flowlogs-reader { };
flowmc = callPackage ../development/python-modules/flowmc { };
fluent-logger = callPackage ../development/python-modules/fluent-logger { };
flufl-bounce = callPackage ../development/python-modules/flufl/bounce.nix { };