Merge pull request #215867 from veprbl/pr/nnpdf_4_0_6

nnpdf: 4.0.4 -> 4.0.6, provide n3fit
This commit is contained in:
Dmitry Kalinkin 2023-02-13 12:58:38 -05:00 committed by GitHub
commit f032544122
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 55 additions and 11 deletions

View File

@ -1,7 +1,6 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, cmake
, pkg-config
, apfel
@ -16,22 +15,15 @@
stdenv.mkDerivation rec {
pname = "nnpdf";
version = "4.0.4";
version = "4.0.6";
src = fetchFromGitHub {
owner = "NNPDF";
repo = pname;
rev = version;
sha256 = "sha256-Alx4W0TkPzJBsnRXcKBrlEU6jWTnOjrji/IPk+dNCw0=";
hash = "sha256-mwOMNlYFhHZq/wakO1/HGwcxvKGKh5OyFa2D9d3Y3IA=";
};
patches = [
(fetchpatch {
url = "https://github.com/NNPDF/nnpdf/commit/7943b62a91d3a41fd4f6366b18881d50695f4b45.diff";
hash = "sha256-UXhTO7vZgJiY8h3bgjg7SQC0gMUQsYQ/V/PgtCEQ7VU=";
})
];
postPatch = ''
for file in CMakeLists.txt buildmaster/CMakeLists.txt; do
substituteInPlace $file \

View File

@ -0,0 +1,50 @@
{ lib
, buildPythonPackage
, hyperopt
, keras
, nnpdf
, psutil
, tensorflow
, validphys2
}:
buildPythonPackage rec {
pname = "n3fit";
version = "4.0";
format = "setuptools";
inherit (nnpdf) src;
prePatch = ''
cd n3fit
'';
postPatch = ''
substituteInPlace src/n3fit/version.py \
--replace '= __give_git()' '= "'$version'"'
'';
propagatedBuildInputs = [
hyperopt
keras
psutil
tensorflow
validphys2
];
postInstall = ''
for prog in "$out"/bin/*; do
wrapProgram "$prog" --set PYTHONPATH "$PYTHONPATH:$(toPythonPath "$out")"
done
'';
doCheck = false; # no tests
pythonImportsCheck = [ "n3fit" ];
meta = with lib; {
description = "NNPDF fitting framework";
homepage = "https://docs.nnpdf.science";
inherit (nnpdf.meta) license;
maintainers = with maintainers; [ veprbl ];
};
}

View File

@ -22,7 +22,7 @@ buildPythonPackage rec {
postPatch = ''
substituteInPlace src/validphys/version.py \
--replace '= __give_git()' '= "${version}"'
--replace '= __give_git()' '= "'$version'"'
'';
propagatedBuildInputs = [

View File

@ -6196,6 +6196,8 @@ self: super: with self; {
myst-parser = callPackage ../development/python-modules/myst-parser { };
n3fit = callPackage ../development/python-modules/n3fit { };
nad-receiver = callPackage ../development/python-modules/nad-receiver { };
nagiosplugin = callPackage ../development/python-modules/nagiosplugin { };