From 6797d8a8d186c9e655f988033a1a3857661c935b Mon Sep 17 00:00:00 2001 From: Lein Matsumaru Date: Tue, 24 Jun 2025 08:17:20 +0000 Subject: [PATCH 1/3] python3Packages.ase: 3.25.0 -> 3.25.0-unstable-2025-06-24 --- pkgs/development/python-modules/ase/default.nix | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/ase/default.nix b/pkgs/development/python-modules/ase/default.nix index a512bc2ae135..09d2b92ffe7f 100644 --- a/pkgs/development/python-modules/ase/default.nix +++ b/pkgs/development/python-modules/ase/default.nix @@ -1,6 +1,7 @@ { lib, stdenv, + fetchFromGitLab, buildPythonPackage, isPy27, fetchPypi, @@ -28,14 +29,14 @@ buildPythonPackage rec { pname = "ase"; - version = "3.25.0"; + version = "3.25.0-unstable-2025-06-24"; pyproject = true; - disabled = isPy27; - - src = fetchPypi { - inherit pname version; - hash = "sha256-N0z4yp/liPBdboVto8nBfvJi3JaAJ7Ix1EkzQUDJYsI="; + src = fetchFromGitLab { + owner = "ase"; + repo = "ase"; + rev = "4e22dabfbe7ae2329e50260ca1b6f08a83527ac3"; + hash = "sha256-ehMyVtPxfTxT8T418VyLGnUEyYip4LPTTaGL0va7qgM="; }; build-system = [ setuptools ]; @@ -62,10 +63,6 @@ buildPythonPackage rec { ]; disabledTests = [ - # AssertionError: assert (1 != 0) == False - # TypeError: list indices must be integers or slices, not numpy.bool - "test_long" - "test_fundamental_params" "test_ase_bandstructure" "test_imports" From 9a9121b483985677221c605472542c82d4dc031e Mon Sep 17 00:00:00 2001 From: Lein Matsumaru Date: Tue, 1 Jul 2025 23:26:19 +0000 Subject: [PATCH 2/3] python3Packages.pymatgen: 2025.1.24 -> 2025.6.24 --- .../python-modules/pymatgen/default.nix | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pymatgen/default.nix b/pkgs/development/python-modules/pymatgen/default.nix index 2ddaebe899d3..adb87f41b992 100644 --- a/pkgs/development/python-modules/pymatgen/default.nix +++ b/pkgs/development/python-modules/pymatgen/default.nix @@ -13,11 +13,13 @@ glibcLocales, # dependencies + bibtexparser, joblib, matplotlib, monty, networkx, numpy, + orjson, palettable, pandas, plotly, @@ -50,7 +52,7 @@ buildPythonPackage rec { pname = "pymatgen"; - version = "2025.1.24"; + version = "2025.6.14"; pyproject = true; disabled = pythonAtLeast "3.13"; @@ -59,7 +61,7 @@ buildPythonPackage rec { owner = "materialsproject"; repo = "pymatgen"; tag = "v${version}"; - hash = "sha256-0P3/M6VI2RKPArMwXD95sjW7dYOTXxUeu4tOliN0IGk="; + hash = "sha256-HMYYhXT5k/EjG1sIBq/53K9ogeSk8ZEJQBrDHCgz+SA="; }; build-system = [ setuptools ]; @@ -70,11 +72,13 @@ buildPythonPackage rec { ]; dependencies = [ + bibtexparser joblib matplotlib monty networkx numpy + orjson palettable pandas plotly @@ -116,6 +120,11 @@ buildPythonPackage rec { pythonImportsCheck = [ "pymatgen" ]; + pytestFlagsArray = [ + # We have not packaged moyopy yet. + "--deselect=tests/analysis/test_prototypes.py::test_get_protostructure_label_from_moyopy" + ]; + nativeCheckInputs = [ addBinToPathHook pytestCheckHook @@ -158,6 +167,9 @@ buildPythonPackage rec { "test_proj_bandstructure_plot" "test_structure" "test_structure_environments" + + # attempt to insert nil object from objects[1] + "test_timer_10_2_7" ]; disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [ From 50044f22b7a9550089c33cc2922d5de81cab97c3 Mon Sep 17 00:00:00 2001 From: Lein Matsumaru Date: Thu, 26 Jun 2025 05:15:21 +0000 Subject: [PATCH 3/3] python3Packages.pyscf: fix build --- .../pyscf/coerce-numpy-to-int.patch | 19 ++++++++++++++++ .../python-modules/pyscf/default.nix | 22 ++++++++++++++++--- 2 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 pkgs/development/python-modules/pyscf/coerce-numpy-to-int.patch diff --git a/pkgs/development/python-modules/pyscf/coerce-numpy-to-int.patch b/pkgs/development/python-modules/pyscf/coerce-numpy-to-int.patch new file mode 100644 index 000000000000..140e6d77b1f0 --- /dev/null +++ b/pkgs/development/python-modules/pyscf/coerce-numpy-to-int.patch @@ -0,0 +1,19 @@ +commit 6df405512d33d432bb45553ddcffbc70edec51f6 +Author: Lein Matsumaru +Date: Sun Jun 29 12:59:57 2025 +0000 + + Coerce int + +diff --git a/pyscf/ci/gcisd.py b/pyscf/ci/gcisd.py +index d58e0364c..050f83962 100644 +--- a/pyscf/ci/gcisd.py ++++ b/pyscf/ci/gcisd.py +@@ -197,7 +197,7 @@ def from_fcivec(ci0, nelec, orbspin, frozen=None): + numpy.count_nonzero(orbspin[:nelec] == 1)) + ucisdvec = ucisd.from_fcivec(ci0, norb//2, nelec, frozen) + nocc = numpy.count_nonzero(~frozen_mask[:sum(nelec)]) +- return from_ucisdvec(ucisdvec, nocc, orbspin[~frozen_mask]) ++ return from_ucisdvec(ucisdvec, int(nocc), orbspin[~frozen_mask]) + + + def make_rdm1(myci, civec=None, nmo=None, nocc=None, ao_repr=False): diff --git a/pkgs/development/python-modules/pyscf/default.nix b/pkgs/development/python-modules/pyscf/default.nix index 919b5201df54..5818570a0030 100644 --- a/pkgs/development/python-modules/pyscf/default.nix +++ b/pkgs/development/python-modules/pyscf/default.nix @@ -2,15 +2,23 @@ buildPythonPackage, lib, fetchFromGitHub, + + # build-sysetm cmake, + + # build inputs blas, libcint, libxc, xcfun, + + # dependencies cppe, h5py, numpy, scipy, + + # tests pytestCheckHook, }: @@ -26,6 +34,12 @@ buildPythonPackage rec { hash = "sha256-UTeZXlNuSWDOcBRVbUUWJ3mQnZZQr17aTw6rRA5DRNI="; }; + patches = [ + # Converts numpy.int64 to int where necessary. + # Upstream issue: https://github.com/pyscf/pyscf/issues/2878 + ./coerce-numpy-to-int.patch + ]; + # setup.py calls Cmake and passes the arguments in CMAKE_CONFIGURE_ARGS to cmake. build-system = [ cmake ]; dontUseCmakeConfigure = true; @@ -60,6 +74,7 @@ buildPythonPackage rec { # Numerically slightly off tests disabledTests = [ + "test_rdm_trace" "test_tdhf_singlet" "test_ab_hf" "test_ea" @@ -99,14 +114,15 @@ buildPythonPackage rec { "--ignore-glob=pyscf/grad/test/test_casscf.py" ]; - meta = with lib; { + meta = { description = "Python-based simulations of chemistry framework"; homepage = "https://github.com/pyscf/pyscf"; - license = licenses.asl20; + license = lib.licenses.asl20; platforms = [ "x86_64-linux" "x86_64-darwin" + "aarch64-darwin" ]; - maintainers = [ maintainers.sheepforce ]; + maintainers = [ lib.maintainers.sheepforce ]; }; }