2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
2022-04-03 18:54:34 +00:00
|
|
|
, ase
|
2021-12-06 16:07:01 +00:00
|
|
|
, buildPythonPackage
|
2020-04-24 23:36:52 +00:00
|
|
|
, cython
|
|
|
|
, datamodeldict
|
2021-12-06 16:07:01 +00:00
|
|
|
, fetchFromGitHub
|
2022-09-09 14:08:57 +00:00
|
|
|
, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
, matplotlib
|
|
|
|
, numericalunits
|
|
|
|
, numpy
|
|
|
|
, pandas
|
2022-04-03 18:54:34 +00:00
|
|
|
, phonopy
|
2021-12-06 16:07:01 +00:00
|
|
|
, potentials
|
2022-04-03 18:54:34 +00:00
|
|
|
, pymatgen
|
2020-04-24 23:36:52 +00:00
|
|
|
, pytest
|
2022-09-09 14:08:57 +00:00
|
|
|
, pytestCheckHook
|
2021-12-06 16:07:01 +00:00
|
|
|
, pythonOlder
|
2022-05-18 14:49:53 +00:00
|
|
|
, pythonAtLeast
|
2022-04-03 18:54:34 +00:00
|
|
|
, requests
|
2020-04-24 23:36:52 +00:00
|
|
|
, scipy
|
|
|
|
, toolz
|
|
|
|
, xmltodict
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2022-09-09 14:08:57 +00:00
|
|
|
version = "1.4.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "atomman";
|
2021-12-06 16:07:01 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "usnistgov";
|
2021-12-06 16:07:01 +00:00
|
|
|
repo = "atomman";
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = "v${version}";
|
2022-09-09 14:08:57 +00:00
|
|
|
hash = "sha256-wXz/uHjXKHVKJu/HoFF2mADSBLp6UGF9ivOp2ZOz/Ys=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
patches = [
|
|
|
|
# Fix several tests that are failing on master.
|
|
|
|
# https://github.com/usnistgov/atomman/pull/9
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-tests-1.patch";
|
|
|
|
url = "https://github.com/usnistgov/atomman/commit/d255977a5e0ce4584e2c886f6c55ccb9f5932731.patch";
|
|
|
|
hash = "sha256-lBFOgcozY85JfQVsVjd51Jf9mrokwQuYdxa8l7VzkqU=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-tests-2.patch";
|
|
|
|
url = "https://github.com/usnistgov/atomman/commit/de4177f28ad7c48d482cb606f323128e2fcb86aa.patch";
|
|
|
|
hash = "sha256-+YpwdKCT/OTue3b2GOk9Jagg26r1PTTV2Zg+GGBd8sM=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-tests-3.patch";
|
|
|
|
url = "https://github.com/usnistgov/atomman/commit/10b168493ee883348699f1e42680423cec84bed5.patch";
|
|
|
|
hash = "sha256-b4f3POjiceq3xApfjnKAs9dEf1trCiTIyu7hMPL0ZTw=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-tests-4.patch";
|
|
|
|
url = "https://github.com/usnistgov/atomman/commit/057d24c70427bab3c7c530251ceb5f4e27eb5c56.patch";
|
|
|
|
hash = "sha256-FTg/GNRZ5xigGW8SpUTIw2/GEzOxwb1rsv2wGebmZOk=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
cython
|
|
|
|
datamodeldict
|
|
|
|
matplotlib
|
|
|
|
numericalunits
|
|
|
|
numpy
|
|
|
|
pandas
|
|
|
|
potentials
|
2022-04-03 18:54:34 +00:00
|
|
|
requests
|
2021-12-06 16:07:01 +00:00
|
|
|
scipy
|
|
|
|
toolz
|
|
|
|
xmltodict
|
|
|
|
];
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
preCheck = ''
|
|
|
|
# By default, pytestCheckHook imports atomman from the current directory
|
|
|
|
# instead of from where `pip` installs it and fails due to missing Cython
|
|
|
|
# modules. Fix this by removing atomman from the current directory.
|
|
|
|
#
|
|
|
|
rm -r atomman
|
|
|
|
'';
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
checkInputs = [
|
2022-04-03 18:54:34 +00:00
|
|
|
ase
|
|
|
|
phonopy
|
|
|
|
pymatgen
|
2021-12-06 16:07:01 +00:00
|
|
|
pytest
|
2022-09-09 14:08:57 +00:00
|
|
|
pytestCheckHook
|
2021-12-06 16:07:01 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
disabledTests = [
|
|
|
|
"test_unique_shifts_prototype" # needs network access to download database files
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"atomman"
|
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Atomistic Manipulation Toolkit";
|
2021-12-06 16:07:01 +00:00
|
|
|
homepage = "https://github.com/usnistgov/atomman/";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with maintainers; [ costrouc ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|