1{
2 lib,
3 ase,
4 buildPythonPackage,
5 cython,
6 datamodeldict,
7 fetchFromGitHub,
8 matplotlib,
9 numericalunits,
10 numpy,
11 pandas,
12 phonopy,
13 potentials,
14 pymatgen,
15 pytestCheckHook,
16 pythonOlder,
17 requests,
18 scipy,
19 setuptools,
20 toolz,
21 wheel,
22 xmltodict,
23 pythonRelaxDepsHook,
24}:
25
26buildPythonPackage {
27 pname = "atomman";
28 version = "1.4.6-unstable-2023-07-28";
29 pyproject = true;
30
31 disabled = pythonOlder "3.7";
32
33 src = fetchFromGitHub {
34 owner = "usnistgov";
35 repo = "atomman";
36 rev = "b8af21a9285959d38ee26173081db1b4488401bc";
37 hash = "sha256-WfB+OY61IPprT6OCVHl8VA60p7lLVkRGuyYX+nm7bbA=";
38 };
39
40 nativeBuildInputs = [ pythonRelaxDepsHook ];
41
42 build-system = [
43 setuptools
44 wheel
45 numpy
46 cython
47 ];
48
49 dependencies = [
50 datamodeldict
51 matplotlib
52 numericalunits
53 numpy
54 pandas
55 potentials
56 requests
57 scipy
58 toolz
59 xmltodict
60 ];
61
62 pythonRelaxDeps = [ "potentials" ];
63
64 preCheck = ''
65 # By default, pytestCheckHook imports atomman from the current directory
66 # instead of from where `pip` installs it and fails due to missing Cython
67 # modules. Fix this by removing atomman from the current directory.
68 #
69 rm -r atomman
70 '';
71
72 nativeCheckInputs = [
73 ase
74 phonopy
75 pymatgen
76 pytestCheckHook
77 ];
78
79 disabledTests = [
80 "test_unique_shifts_prototype" # needs network access to download database files
81 ];
82
83 pythonImportsCheck = [ "atomman" ];
84
85 meta = with lib; {
86 description = "Atomistic Manipulation Toolkit";
87 homepage = "https://github.com/usnistgov/atomman/";
88 license = licenses.mit;
89 maintainers = with maintainers; [ ];
90 };
91}