Skip to content

Commit

Permalink
python312Packages.optimistix: init at 0.0.8 (#345449)
Browse files Browse the repository at this point in the history
  • Loading branch information
natsukium committed Sep 30, 2024
2 parents 9cd3398 + 06e0592 commit 4a12d21
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 0 deletions.
66 changes: 66 additions & 0 deletions pkgs/development/python-modules/lineax/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,

# build-system
hatchling,

# dependencies
equinox,
jax,
jaxtyping,
typing-extensions,

# tests
beartype,
pytest,
python,
}:

buildPythonPackage rec {
pname = "lineax";
version = "0.0.6";
pyproject = true;

src = fetchFromGitHub {
owner = "patrick-kidger";
repo = "lineax";
rev = "refs/tags/v${version}";
hash = "sha256-rM3H+q75F98eEIJkEszWgxD5C5vGK5RlYtVv8GD/VC0=";
};

build-system = [ hatchling ];

dependencies = [
equinox
jax
jaxtyping
typing-extensions
];

pythonImportsCheck = [ "lineax" ];

nativeCheckInputs = [
beartype
pytest
];

# Intentionaly not using pytest directly as it leads to JAX out-of-memory'ing
# https://github.com/patrick-kidger/lineax/blob/1909d190c1963d5f2d991508c1b2714f2266048b/tests/README.md
checkPhase = ''
runHook preCheck
${python.interpreter} -m tests
runHook postCheck
'';

meta = {
description = "Linear solvers in JAX and Equinox";
homepage = "https://github.com/patrick-kidger/lineax";
changelog = "https://github.com/patrick-kidger/lineax/releases/tag/v${version}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ GaetanLepage ];
};
}
63 changes: 63 additions & 0 deletions pkgs/development/python-modules/optimistix/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,

# build-system
hatchling,

# dependencies
equinox,
jax,
jaxtyping,
lineax,
typing-extensions,

# checks
beartype,
jaxlib,
optax,
pytestCheckHook,
pytest-xdist,
}:

buildPythonPackage rec {
pname = "optimistix";
version = "0.0.8";
pyproject = true;

src = fetchFromGitHub {
owner = "patrick-kidger";
repo = "optimistix";
rev = "refs/tags/v${version}";
hash = "sha256-0ehNApiBoiAb8LFBW81ZCRPsjTVQG8zRTVSAp7oHF8w=";
};

build-system = [ hatchling ];

dependencies = [
equinox
jax
jaxtyping
lineax
typing-extensions
];

pythonImportsCheck = [ "optimistix" ];

nativeCheckInputs = [
beartype
jaxlib
optax
pytestCheckHook
pytest-xdist
];

meta = {
description = "Nonlinear optimisation (root-finding, least squares, ...) in JAX+Equinox";
homepage = "https://github.com/patrick-kidger/optimistix";
changelog = "https://github.com/patrick-kidger/optimistix/releases/tag/v${version}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ GaetanLepage ];
};
}
4 changes: 4 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7230,6 +7230,8 @@ self: super: with self; {

linear-operator = callPackage ../development/python-modules/linear-operator { };

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

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

lineedit = callPackage ../development/python-modules/lineedit { };
Expand Down Expand Up @@ -9414,6 +9416,8 @@ self: super: with self; {

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

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

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

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

0 comments on commit 4a12d21

Please sign in to comment.