Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 111 additions & 0 deletions pkgs/development/python-modules/netket/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools-scm,
hatchling,
hatch-vcs,
jax,
jaxlib,
numpy,
scipy,
tqdm,
numba,
igraph,
flax,
orjson,
optax,
beartype,
rich,
equinox,
plum-dispatch,
sparse,
einops,
pytestCheckHook,
pytest-xdist,
pytest-cov-stub,
pytest-json-report,
qutip,
networkx,
matplotlib,
pyscf,
tensorboardx,
h5py,
}:

buildPythonPackage (finalAttrs: {
pname = "netket";
version = "3.21.0";
pyproject = true;

src = fetchFromGitHub {
owner = "netket";
repo = "netket";
tag = "v${finalAttrs.version}";
hash = "sha256-jpF3OoVDkGvns2XU3kyfCSjh/Nkqj6R5GKAGqWchrTg=";
};

build-system = [
setuptools-scm
hatchling
hatch-vcs
];

dependencies = [
jax
jaxlib
numpy
scipy
tqdm
numba
igraph
flax
orjson
optax
beartype
rich
equinox
plum-dispatch
sparse
einops
];

optional-dependencies = {
pyscf = [ pyscf ];
extra = [
tensorboardx
#openfermion # not packaged yet
h5py
qutip
];
};

doCheck = false; # tests use up my ram, and they fail anyway

nativeCheckInputs = [
pytestCheckHook
pytest-xdist
pytest-cov-stub
pytest-json-report
networkx
matplotlib
];

# https://github.com/netket/netket/blob/v3.21.0/.github/workflows/CI.yml#L81-L83
env.NETKET_EXPERIMENTAL = "1";
pytestFlags = [
"--jax-cpu-disable-async-dispatch"
"--clear-cache-every"
"200"
];

pythonImportsCheck = [ "netket" ];

meta = {
homepage = "https://www.netket.org";
changelog = "https://github.com/netket/netket/blob/v${finalAttrs.version}/CHANGELOG.md";
description = "Machine-learning toolbox for quantum physics";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ ulysseszhan ];
};
})
65 changes: 65 additions & 0 deletions pkgs/development/python-modules/plum-dispatch/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
lib,
stdenv,
buildPythonPackage,
pythonAtLeast,
fetchPypi,
hatch,
hatch-vcs,
hatch-mypyc,
ipython,
numpy,
pytestCheckHook,
pytest-cov-stub,
sybil,
beartype,
typing-extensions,
rich,
}:

buildPythonPackage (finalAttrs: {
pname = "plum-dispatch";
version = "2.8.0";
pyproject = true;

src = fetchPypi {
pname = "plum_dispatch";
inherit (finalAttrs) version;
hash = "sha256-RT/HvGfSo5SSyDSwDJTYFocdFItaCl0/SeK78jkeJhk=";
};

# https://github.com/beartype/plum/pull/225
disabled = pythonAtLeast "3.14";

build-system = [
hatch
hatch-vcs
hatch-mypyc
];

dependencies = [
beartype
typing-extensions
rich
];

nativeCheckInputs = [
pytestCheckHook
ipython
numpy
pytest-cov-stub
sybil
];

disabledTests = lib.optional stdenv.hostPlatform.isDarwin "test_methodlist_repr";

pythonImportsCheck = [ "plum" ];

meta = {
homepage = "https://beartype.github.io/plum";
changelog = "https://github.com/beartype/plum/releases/tag/v${finalAttrs.version}";
description = "Multiple dispatch in Python";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ulysseszhan ];
};
})
4 changes: 4 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10990,6 +10990,8 @@ self: super: with self; {

netio = callPackage ../development/python-modules/netio { };

netket = callPackage ../development/python-modules/netket { };

netmap = callPackage ../development/python-modules/netmap { };

netmiko = callPackage ../development/python-modules/netmiko { };
Expand Down Expand Up @@ -12630,6 +12632,8 @@ self: super: with self; {

plugwise = callPackage ../development/python-modules/plugwise { };

plum-dispatch = callPackage ../development/python-modules/plum-dispatch { };

plum-py = callPackage ../development/python-modules/plum-py { };

plumbum = callPackage ../development/python-modules/plumbum { };
Expand Down
Loading