about summary refs log tree commit diff
path: root/pkgs/development/python-modules/fipy/default.nix
blob: 2be37738ebb1889f54788592ad869cd7df576e5f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{
  lib,
  buildPythonPackage,
  numpy,
  scipy,
  pyamg,
  future,
  matplotlib,
  tkinter,
  mpi4py,
  scikit-fmm,
  gmsh,
  python,
  stdenv,
  openssh,
  fetchFromGitHub,
  pythonAtLeast,
  pythonOlder,
}:

buildPythonPackage rec {
  pname = "fipy";
  version = "3.4.5";
  format = "setuptools";

  # Python 3.12 is not yet supported.
  # https://github.com/usnistgov/fipy/issues/997
  # https://github.com/usnistgov/fipy/pull/1023
  disabled = pythonOlder "3.7" || pythonAtLeast "3.12";

  src = fetchFromGitHub {
    owner = "usnistgov";
    repo = "fipy";
    rev = "refs/tags/${version}";
    hash = "sha256-345YrGQgHNq0FULjJjLqHksyfm/EHl+KyGfxwS6xK9U=";
  };

  propagatedBuildInputs = [
    numpy
    scipy
    pyamg
    matplotlib
    tkinter
    mpi4py
    future
    scikit-fmm
    openssh
  ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ gmsh ];

  nativeCheckInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [ gmsh ];

  # NOTE: Two of the doctests in fipy.matrices.scipyMatrix._ScipyMatrix.CSR fail, and there is no
  # clean way to disable them.
  doCheck = false;

  checkPhase = ''
    export OMPI_MCA_plm_rsh_agent=${openssh}/bin/ssh
    ${python.interpreter} setup.py test --modules
  '';

  # NOTE: Importing fipy within the sandbox will fail because plm_rsh_agent isn't set and the process isn't able
  # to start a daemon on the builder.
  # pythonImportsCheck = [ "fipy" ];

  meta = with lib; {
    homepage = "https://www.ctcms.nist.gov/fipy/";
    description = "Finite Volume PDE Solver Using Python";
    changelog = "https://github.com/usnistgov/fipy/blob/${version}/CHANGELOG.rst";
    license = licenses.free;
    maintainers = with maintainers; [ wd15 ];
  };
}