about summary refs log tree commit diff
path: root/pkgs/development/python-modules/gstools/default.nix
blob: e1104895398638833a497b45890ed74cb8a970be (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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  setuptools-scm,
  numpy,
  cython,
  extension-helpers,
  hankel,
  emcee,
  meshio,
  pyevtk,
  scipy,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "gstools";
  version = "1.6.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "GeoStat-Framework";
    repo = "GSTools";
    rev = "refs/tags/v${version}";
    hash = "sha256-QpdOARzcSRVFl/DbnE2JLBFZmTSh/fBOmzweuf+zfEs=";
  };

  build-system = [
    setuptools
    setuptools-scm
    numpy
    cython
    extension-helpers
  ];

  dependencies = [
    emcee
    hankel
    meshio
    numpy
    pyevtk
    scipy
  ];

  # scipy derivation dont support numpy_2 and is patched to use version 1
  # Using numpy_2 in the derivation will cause a clojure duplicate error
  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace-fail 'numpy>=2.0.0rc1,' 'numpy' \
  '';

  pythonImportsCheck = [ "gstools" ];
  nativeCheckInputs = [ pytestCheckHook ];

  meta = {
    description = "Geostatistical toolbox";
    homepage = "https://github.com/GeoStat-Framework/GSTools";
    changelog = "https://github.com/GeoStat-Framework/GSTools/blob/${src.rev}/CHANGELOG.md";
    license = lib.licenses.lgpl3Only;
    maintainers = with lib.maintainers; [ sigmanificient ];
  };
}