mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-25 17:55:21 +00:00
Merge pull request #44752 from costrouc/costrouc/lammps-update
material science packages (init and update): lammps, python - ase, pymatgen-lammps, lammps-cython, dftfit
This commit is contained in:
36
pkgs/development/python-modules/ase/default.nix
Normal file
36
pkgs/development/python-modules/ase/default.nix
Normal file
@@ -0,0 +1,36 @@
|
||||
{ lib
|
||||
, fetchurl
|
||||
, buildPythonPackage
|
||||
, numpy
|
||||
, scipy
|
||||
, matplotlib
|
||||
, flask
|
||||
, pillow
|
||||
, psycopg2
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
version = "3.16.2";
|
||||
pname = "ase";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://gitlab.com/${pname}/${pname}/-/archive/${version}/${pname}-${version}.tar.gz";
|
||||
sha256 = "171j3f4a261cfnqjq98px5fldxql65i3jgf60wc945xvh0mbc8ds";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ numpy scipy matplotlib flask pillow psycopg2 ];
|
||||
|
||||
checkPhase = ''
|
||||
$out/bin/ase test
|
||||
'';
|
||||
|
||||
# tests just hang most likely due to something with subprocesses and cli
|
||||
doCheck = false;
|
||||
|
||||
meta = {
|
||||
description = "Atomic Simulation Environment";
|
||||
homepage = https://wiki.fysik.dtu.dk/ase/;
|
||||
license = lib.licenses.lgpl21Plus;
|
||||
maintainers = with lib.maintainers; [ costrouc ];
|
||||
};
|
||||
}
|
||||
47
pkgs/development/python-modules/dftfit/default.nix
Normal file
47
pkgs/development/python-modules/dftfit/default.nix
Normal file
@@ -0,0 +1,47 @@
|
||||
{ lib
|
||||
, fetchPypi
|
||||
, buildPythonPackage
|
||||
, pymatgen
|
||||
, marshmallow
|
||||
, pyyaml
|
||||
, pygmo
|
||||
, pandas
|
||||
, scipy
|
||||
, numpy
|
||||
, scikitlearn
|
||||
, lammps-cython
|
||||
, pymatgen-lammps
|
||||
, pytestrunner
|
||||
, pytest
|
||||
, pytestcov
|
||||
, pytest-benchmark
|
||||
, isPy3k
|
||||
, openssh
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "dftfit";
|
||||
version = "0.4.11";
|
||||
disabled = (!isPy3k);
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "c6e36a793f9f94746bb8a04fb8316404aeacfa918704de07b15e1b4b8b62242d";
|
||||
};
|
||||
|
||||
buildInputs = [ pytestrunner ];
|
||||
checkInputs = [ pytest pytestcov pytest-benchmark openssh ];
|
||||
propagatedBuildInputs = [ pymatgen marshmallow pyyaml pygmo
|
||||
pandas scipy numpy scikitlearn
|
||||
lammps-cython pymatgen-lammps ];
|
||||
|
||||
# tests require git lfs download. and is quite large so skip tests
|
||||
doCheck = false;
|
||||
|
||||
meta = {
|
||||
description = "Ab-Initio Molecular Dynamics Potential Development";
|
||||
homepage = https://gitlab.com/costrouc/dftfit;
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ costrouc ];
|
||||
};
|
||||
}
|
||||
35
pkgs/development/python-modules/docutils/default.nix
Normal file
35
pkgs/development/python-modules/docutils/default.nix
Normal file
@@ -0,0 +1,35 @@
|
||||
{ lib
|
||||
, fetchurl
|
||||
, buildPythonPackage
|
||||
, isPy3k
|
||||
, python
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "docutils";
|
||||
version = "0.14";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/docutils/${pname}.tar.gz";
|
||||
sha256 = "0x22fs3pdmr42kvz6c654756wja305qv6cx1zbhwlagvxgr4xrji";
|
||||
};
|
||||
|
||||
checkPhase = if isPy3k then ''
|
||||
${python.interpreter} test3/alltests.py
|
||||
'' else ''
|
||||
${python.interpreter} test/alltests.py
|
||||
'';
|
||||
|
||||
# Create symlinks lacking a ".py" suffix, many programs depend on these names
|
||||
postFixup = ''
|
||||
(cd $out/bin && for f in *.py; do
|
||||
ln -s $f $(echo $f | sed -e 's/\.py$//')
|
||||
done)
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Docutils -- Python Documentation Utilities";
|
||||
homepage = http://docutils.sourceforge.net/;
|
||||
maintainers = with lib.maintainers; [ garbas AndersonTorres ];
|
||||
};
|
||||
}
|
||||
53
pkgs/development/python-modules/lammps-cython/default.nix
Normal file
53
pkgs/development/python-modules/lammps-cython/default.nix
Normal file
@@ -0,0 +1,53 @@
|
||||
{ lib
|
||||
, fetchurl
|
||||
, buildPythonPackage
|
||||
, lammps-mpi
|
||||
, mpi
|
||||
, mpi4py
|
||||
, numpy
|
||||
, cython
|
||||
, pymatgen
|
||||
, ase
|
||||
, pytestrunner
|
||||
, pytest
|
||||
, pytestcov
|
||||
, isPy3k
|
||||
, openssh
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "lammps-cython";
|
||||
version = "0.5.7";
|
||||
disabled = (!isPy3k);
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://gitlab.com/costrouc/${pname}/-/archive/v${version}/${pname}-v${version}.tar.gz";
|
||||
sha256 = "1wj9scmjdl00af13b5ihfccrjpikrdgkzd88ialam1nkxvxi42bl";
|
||||
};
|
||||
|
||||
buildInputs = [ cython pytestrunner ];
|
||||
checkInputs = [ pytest pytestcov openssh ];
|
||||
propagatedBuildInputs = [ mpi4py pymatgen ase numpy ];
|
||||
|
||||
preBuild = ''
|
||||
echo "Creating lammps.cfg file..."
|
||||
cat << EOF > lammps.cfg
|
||||
[lammps]
|
||||
lammps_include_dir = ${lammps-mpi}/include
|
||||
lammps_library_dir = ${lammps-mpi}/lib
|
||||
lammps_library = lammps_mpi
|
||||
|
||||
[mpi]
|
||||
mpi_include_dir = ${mpi}/include
|
||||
mpi_library_dir = ${mpi}/lib
|
||||
mpi_library = mpi
|
||||
EOF
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Pythonic Wrapper to LAMMPS using cython";
|
||||
homepage = https://gitlab.com/costrouc/lammps-cython;
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ costrouc ];
|
||||
};
|
||||
}
|
||||
28
pkgs/development/python-modules/pathlib/default.nix
Normal file
28
pkgs/development/python-modules/pathlib/default.nix
Normal file
@@ -0,0 +1,28 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchPypi
|
||||
, python
|
||||
, pythonAtLeast
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "pathlib";
|
||||
version = "1.0.1";
|
||||
disabled = pythonAtLeast "3.4"; # Was added to std library in Python 3.4
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "17zajiw4mjbkkv6ahp3xf025qglkj0805m9s41c45zryzj6p2h39";
|
||||
};
|
||||
|
||||
checkPhase = ''
|
||||
${python.interpreter} -m unittest discover
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Object-oriented filesystem paths";
|
||||
homepage = https://pathlib.readthedocs.org/;
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ costrouc ];
|
||||
};
|
||||
}
|
||||
23
pkgs/development/python-modules/py-cpuinfo/default.nix
Normal file
23
pkgs/development/python-modules/py-cpuinfo/default.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{ lib
|
||||
, fetchFromGitHub
|
||||
, buildPythonPackage
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "py-cpuinfo";
|
||||
version = "4.0.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "workhorsy";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "1pp561lj80jnvr2038nrzhmks2akxsbdqxvfrqa6n340x81981lm";
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Get CPU info with pure Python 2 & 3";
|
||||
homepage = https://github.com/workhorsy/py-cpuinfo;
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ costrouc ];
|
||||
};
|
||||
}
|
||||
48
pkgs/development/python-modules/pygmo/default.nix
Normal file
48
pkgs/development/python-modules/pygmo/default.nix
Normal file
@@ -0,0 +1,48 @@
|
||||
{ lib
|
||||
, fetchFromGitHub
|
||||
, buildPythonPackage
|
||||
, cmake
|
||||
, eigen
|
||||
, nlopt
|
||||
, ipopt
|
||||
, boost
|
||||
, pagmo2
|
||||
, numpy
|
||||
, cloudpickle
|
||||
, ipyparallel
|
||||
, numba
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "pygmo";
|
||||
version = "2.8";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "esa";
|
||||
repo = "pagmo2";
|
||||
rev = "v${version}";
|
||||
sha256 = "1xwxamcn3fkwr62jn6bkanrwy0cvsksf75hfwx4fvl56awnbz41z";
|
||||
};
|
||||
|
||||
buildInputs = [ cmake eigen nlopt ipopt boost pagmo2 ];
|
||||
propagatedBuildInputs = [ numpy cloudpickle ipyparallel numba ];
|
||||
|
||||
preBuild = ''
|
||||
cp -v -r $src/* .
|
||||
cmake -DCMAKE_INSTALL_PREFIX=$out -DPAGMO_BUILD_TESTS=no -DCMAKE_SYSTEM_NAME=Linux -DPagmo_DIR=${pagmo2} -DPAGMO_BUILD_PYGMO=yes -DPAGMO_BUILD_PAGMO=no -DPAGMO_WITH_EIGEN3=yes -DPAGMO_WITH_NLOPT=yes -DNLOPT_LIBRARY=${nlopt}/lib/libnlopt_cxx.so -DPAGMO_WITH_IPOPT=yes -DIPOPT=${ipopt}
|
||||
|
||||
make install
|
||||
mv $out/lib/python*/site-packages/pygmo wheel
|
||||
cd wheel
|
||||
'';
|
||||
|
||||
# dont do tests
|
||||
doCheck = false;
|
||||
|
||||
meta = {
|
||||
description = "Parallel optimisation for Python";
|
||||
homepage = https://esa.github.io/pagmo2/;
|
||||
license = lib.licenses.gpl3Plus;
|
||||
maintainers = with lib.maintainers; [ costrouc ];
|
||||
};
|
||||
}
|
||||
31
pkgs/development/python-modules/pymatgen-lammps/default.nix
Normal file
31
pkgs/development/python-modules/pymatgen-lammps/default.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{ lib
|
||||
, fetchurl
|
||||
, buildPythonPackage
|
||||
, pymatgen
|
||||
, lammps
|
||||
, pytestrunner
|
||||
, pytest
|
||||
, isPy3k
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "pymatgen-lammps";
|
||||
version = "0.4.5";
|
||||
disabled = (!isPy3k);
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://gitlab.com/costrouc/${pname}/-/archive/v${version}/${pname}-v${version}.tar.gz";
|
||||
sha256 = "0shldl8is3195jmji7dr3zsh1bzxlahaqrmpr28niks7nnfj80fx";
|
||||
};
|
||||
|
||||
buildInputs = [ pytestrunner ];
|
||||
checkInputs = [ pytest ];
|
||||
propagatedBuildInputs = [ pymatgen ];
|
||||
|
||||
meta = {
|
||||
description = "A LAMMPS wrapper using pymatgen";
|
||||
homepage = https://gitlab.com/costrouc/pymatgen-lammps;
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ costrouc ];
|
||||
};
|
||||
}
|
||||
31
pkgs/development/python-modules/pytest-benchmark/default.nix
Normal file
31
pkgs/development/python-modules/pytest-benchmark/default.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
, pytestrunner
|
||||
, pytest
|
||||
, py-cpuinfo
|
||||
, pythonOlder
|
||||
, pathlib
|
||||
, statistics
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "pytest-benchmark";
|
||||
version = "3.1.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ionelmc";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "1ch079dlc6c9ag74dh4dg6plkmh0h8kn78ari3fgadc75bald71m";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ pytest py-cpuinfo ] ++ lib.optional (pythonOlder "3.4") [ pathlib statistics ];
|
||||
|
||||
meta = {
|
||||
description = "Py.test fixture for benchmarking code";
|
||||
homepage = https://github.com/ionelmc/pytest-benchmark;
|
||||
license = lib.licenses.bsd2;
|
||||
maintainers = with lib.maintainers; [ costrouc ];
|
||||
};
|
||||
}
|
||||
27
pkgs/development/python-modules/statistics/default.nix
Normal file
27
pkgs/development/python-modules/statistics/default.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{ lib
|
||||
, fetchPypi
|
||||
, buildPythonPackage
|
||||
, docutils
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "statistics";
|
||||
version = "1.0.3.5";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "2dc379b80b07bf2ddd5488cad06b2b9531da4dd31edb04dc9ec0dc226486c138";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ docutils ];
|
||||
|
||||
# statistics package does not have any tests
|
||||
doCheck = false;
|
||||
|
||||
meta = {
|
||||
description = "A Python 2.* port of 3.4 Statistics Module";
|
||||
homepage = https://github.com/digitalemagine/py-statistics;
|
||||
license = lib.licenses.asl20;
|
||||
maintainers = with lib.maintainers; [ costrouc ];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user