2022-04-03 18:54:34 +00:00
|
|
|
{ lib
|
2024-04-21 15:54:59 +00:00
|
|
|
, stdenv
|
2022-04-03 18:54:34 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2024-04-21 15:54:59 +00:00
|
|
|
, ase
|
2022-02-10 20:34:41 +00:00
|
|
|
, cython
|
2020-12-07 07:45:13 +00:00
|
|
|
, glibcLocales
|
2024-04-21 15:54:59 +00:00
|
|
|
, joblib
|
2020-12-07 07:45:13 +00:00
|
|
|
, matplotlib
|
|
|
|
, monty
|
|
|
|
, networkx
|
|
|
|
, numpy
|
|
|
|
, palettable
|
|
|
|
, pandas
|
|
|
|
, plotly
|
2022-02-10 20:34:41 +00:00
|
|
|
, pybtex
|
2020-12-07 07:45:13 +00:00
|
|
|
, pydispatcher
|
2024-04-21 15:54:59 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pytest-xdist
|
2022-04-03 18:54:34 +00:00
|
|
|
, pythonOlder
|
2020-12-07 07:45:13 +00:00
|
|
|
, requests
|
2021-12-06 16:07:01 +00:00
|
|
|
, ruamel-yaml
|
2020-12-07 07:45:13 +00:00
|
|
|
, scipy
|
2024-04-21 15:54:59 +00:00
|
|
|
, seekpath
|
2020-12-07 07:45:13 +00:00
|
|
|
, spglib
|
|
|
|
, sympy
|
|
|
|
, tabulate
|
|
|
|
, uncertainties
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pymatgen";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "2024.2.23";
|
2022-04-03 18:54:34 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "materialsproject";
|
|
|
|
repo = "pymatgen";
|
|
|
|
rev= "v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-eswoup9ACj/PHVW3obcnZjD4tWemsmROZFtwGGigEYE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cython
|
|
|
|
glibcLocales
|
|
|
|
];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
matplotlib
|
|
|
|
monty
|
|
|
|
networkx
|
|
|
|
numpy
|
|
|
|
palettable
|
|
|
|
pandas
|
|
|
|
plotly
|
2022-02-10 20:34:41 +00:00
|
|
|
pybtex
|
2020-07-18 16:06:22 +00:00
|
|
|
pydispatcher
|
|
|
|
requests
|
2021-12-06 16:07:01 +00:00
|
|
|
ruamel-yaml
|
2020-07-18 16:06:22 +00:00
|
|
|
scipy
|
|
|
|
spglib
|
|
|
|
sympy
|
|
|
|
tabulate
|
2020-12-07 07:45:13 +00:00
|
|
|
uncertainties
|
2020-07-18 16:06:22 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
pytest-xdist
|
|
|
|
] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
|
|
|
|
preCheck = ''
|
|
|
|
# hide from tests
|
|
|
|
mv pymatgen _pymatgen
|
|
|
|
# ensure tests can find these
|
|
|
|
export PMG_TEST_FILES_DIR="$(realpath ./tests/files)"
|
|
|
|
# some tests cover the command-line scripts
|
|
|
|
export PATH=$out/bin:$PATH
|
|
|
|
'';
|
|
|
|
disabledTests = [
|
|
|
|
# presumably won't work with our dir layouts
|
|
|
|
"test_egg_sources_txt_is_complete"
|
|
|
|
# borderline precision failure
|
|
|
|
"test_thermal_conductivity"
|
|
|
|
];
|
|
|
|
|
|
|
|
passthru.optional-dependencies = {
|
|
|
|
ase = [ ase ];
|
|
|
|
joblib = [ joblib ];
|
|
|
|
seekpath = [ seekpath ];
|
|
|
|
};
|
2022-04-03 18:54:34 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"pymatgen"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2024-04-21 15:54:59 +00:00
|
|
|
broken = stdenv.isDarwin; # tests segfault. that's bad.
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A robust materials analysis code that defines core object representations for structures and molecules";
|
|
|
|
homepage = "https://pymatgen.org/";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ psyanticy ];
|
|
|
|
};
|
|
|
|
}
|