diff options
Diffstat (limited to 'gnu/packages/python-science.scm')
| -rw-r--r-- | gnu/packages/python-science.scm | 210 |
1 files changed, 178 insertions, 32 deletions
diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm index 6fce8d23192..738b504e3b4 100644 --- a/gnu/packages/python-science.scm +++ b/gnu/packages/python-science.scm | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | #:use-module (gnu packages) | 35 | #:use-module (gnu packages) |
| 36 | #:use-module (gnu packages base) | 36 | #:use-module (gnu packages base) |
| 37 | #:use-module (gnu packages check) | 37 | #:use-module (gnu packages check) |
| 38 | #:use-module (gnu packages databases) | ||
| 38 | #:use-module (gnu packages gcc) | 39 | #:use-module (gnu packages gcc) |
| 39 | #:use-module (gnu packages image-processing) | 40 | #:use-module (gnu packages image-processing) |
| 40 | #:use-module (gnu packages machine-learning) | 41 | #:use-module (gnu packages machine-learning) |
| @@ -44,6 +45,7 @@ | |||
| 44 | #:use-module (gnu packages pkg-config) | 45 | #:use-module (gnu packages pkg-config) |
| 45 | #:use-module (gnu packages python) | 46 | #:use-module (gnu packages python) |
| 46 | #:use-module (gnu packages python-build) | 47 | #:use-module (gnu packages python-build) |
| 48 | #:use-module (gnu packages python-crypto) | ||
| 47 | #:use-module (gnu packages python-check) | 49 | #:use-module (gnu packages python-check) |
| 48 | #:use-module (gnu packages python-web) | 50 | #:use-module (gnu packages python-web) |
| 49 | #:use-module (gnu packages python-xyz) | 51 | #:use-module (gnu packages python-xyz) |
| @@ -327,49 +329,55 @@ of the SGP4 satellite tracking algorithm.") | |||
| 327 | (define-public python-pandas | 329 | (define-public python-pandas |
| 328 | (package | 330 | (package |
| 329 | (name "python-pandas") | 331 | (name "python-pandas") |
| 330 | (version "1.0.5") | 332 | (version "1.3.0") |
| 331 | (source | 333 | (source |
| 332 | (origin | 334 | (origin |
| 333 | (method url-fetch) | 335 | (method url-fetch) |
| 334 | (uri (pypi-uri "pandas" version)) | 336 | (uri (pypi-uri "pandas" version)) |
| 335 | (sha256 | 337 | (sha256 |
| 336 | (base32 "1a2gv3g6jr6vb5ca43fkwjl5xf86wpfz8y3zcy787adjl0hdkib9")))) | 338 | (base32 "1qi2cv450m05dwccx3p1s373k5b4ncvwi74plnms2pidrz4ycm65")))) |
| 337 | (build-system python-build-system) | 339 | (build-system python-build-system) |
| 338 | (arguments | 340 | (arguments |
| 339 | `(#:modules ((guix build utils) | 341 | `(#:modules ((guix build utils) |
| 340 | (guix build python-build-system) | 342 | (guix build python-build-system) |
| 341 | (ice-9 ftw) | 343 | (ice-9 ftw) |
| 344 | (srfi srfi-1) | ||
| 342 | (srfi srfi-26)) | 345 | (srfi srfi-26)) |
| 343 | #:phases (modify-phases %standard-phases | 346 | #:phases |
| 344 | (add-after 'unpack 'patch-which | 347 | (modify-phases %standard-phases |
| 345 | (lambda* (#:key inputs #:allow-other-keys) | 348 | (add-after 'unpack 'patch-which |
| 346 | (let ((which (assoc-ref inputs "which"))) | 349 | (lambda* (#:key inputs #:allow-other-keys) |
| 347 | (substitute* "pandas/io/clipboard/__init__.py" | 350 | (let ((which (assoc-ref inputs "which"))) |
| 348 | (("^WHICH_CMD = .*") | 351 | (substitute* "pandas/io/clipboard/__init__.py" |
| 349 | (string-append "WHICH_CMD = \"" which "\"\n")))) | 352 | (("^WHICH_CMD = .*") |
| 350 | #t)) | 353 | (string-append "WHICH_CMD = \"" which "\"\n")))))) |
| 351 | (add-before 'check 'prepare-x | 354 | (add-before 'check 'prepare-x |
| 352 | (lambda _ | 355 | (lambda _ |
| 353 | (system "Xvfb &") | 356 | (system "Xvfb &") |
| 354 | (setenv "DISPLAY" ":0") | 357 | (setenv "DISPLAY" ":0") |
| 355 | ;; xsel needs to write a log file. | 358 | ;; xsel needs to write a log file. |
| 356 | (setenv "HOME" "/tmp") | 359 | (setenv "HOME" "/tmp"))) |
| 357 | #t)) | 360 | (replace 'check |
| 358 | (replace 'check | 361 | (lambda _ |
| 359 | (lambda _ | 362 | (let ((build-directory |
| 360 | (let ((build-directory | 363 | (string-append |
| 361 | (string-append | 364 | (getcwd) "/build/" |
| 362 | (getcwd) "/build/" | 365 | (first (scandir "build" |
| 363 | (car (scandir "build" | 366 | (cut string-prefix? "lib." <>)))))) |
| 364 | (cut string-prefix? "lib." <>)))))) | 367 | (with-directory-excursion build-directory |
| 365 | ;; Disable the "strict data files" option which causes | 368 | (invoke "pytest" "-vv" "pandas" "--skip-slow" |
| 366 | ;; the build to error out if required data files are | 369 | "--skip-network" |
| 367 | ;; not available (as is the case with PyPI archives). | 370 | "-k" |
| 368 | (substitute* "setup.cfg" | 371 | ;; These tets access the internet: |
| 369 | (("addopts = --strict-data-files") "addopts = ")) | 372 | ;; pandas/tests/io/xml/test_xml.py::test_wrong_url[lxml] |
| 370 | (with-directory-excursion build-directory | 373 | ;; pandas/tests/io/xml/test_xml.py::test_wrong_url[etree] |
| 371 | (invoke "pytest" "-vv" "pandas" "--skip-slow" | 374 | ;; TODO: the excel tests fail for unknown reasons |
| 372 | "--skip-network")))))))) | 375 | (string-append "not test_wrong_url" |
| 376 | " and not test_excelwriter_fspath" | ||
| 377 | " and not test_ExcelWriter_dispatch" | ||
| 378 | ;; TODO: Missing input | ||
| 379 | " and not TestS3" | ||
| 380 | " and not s3"))))))))) | ||
| 373 | (propagated-inputs | 381 | (propagated-inputs |
| 374 | `(("python-jinja2" ,python-jinja2) | 382 | `(("python-jinja2" ,python-jinja2) |
| 375 | ("python-numpy" ,python-numpy) | 383 | ("python-numpy" ,python-numpy) |
| @@ -835,3 +843,141 @@ and more | |||
| 835 | @end itemize") | 843 | @end itemize") |
| 836 | (license license:gpl3))) | 844 | (license license:gpl3))) |
| 837 | 845 | ||
| 846 | (define-public python-distributed | ||
| 847 | (package | ||
| 848 | (name "python-distributed") | ||
| 849 | (version "2021.07.1") | ||
| 850 | (source | ||
| 851 | (origin | ||
| 852 | ;; The test files are not included in the archive on pypi | ||
| 853 | (method git-fetch) | ||
| 854 | (uri (git-reference | ||
| 855 | (url "https://github.com/dask/distributed") | ||
| 856 | (commit version))) | ||
| 857 | (file-name (git-file-name name version)) | ||
| 858 | (sha256 | ||
| 859 | (base32 | ||
| 860 | "0i55zf3k55sqjxnwlzsyj3h3v1588fn54ng4mj3dfiqzh3nlj0dg")))) | ||
| 861 | (build-system python-build-system) | ||
| 862 | (arguments | ||
| 863 | '(#:phases | ||
| 864 | (modify-phases %standard-phases | ||
| 865 | (add-after 'unpack 'fix-references | ||
| 866 | (lambda* (#:key outputs #:allow-other-keys) | ||
| 867 | (substitute* '("distributed/comm/tests/test_ucx_config.py" | ||
| 868 | "distributed/tests/test_client.py" | ||
| 869 | "distributed/tests/test_queues.py" | ||
| 870 | "distributed/tests/test_variable.py" | ||
| 871 | "distributed/cli/tests/test_tls_cli.py" | ||
| 872 | "distributed/cli/tests/test_dask_spec.py" | ||
| 873 | "distributed/cli/tests/test_dask_worker.py" | ||
| 874 | "distributed/cli/tests/test_dask_scheduler.py") | ||
| 875 | (("\"dask-scheduler\"") | ||
| 876 | (format #false "\"~a/bin/dask-scheduler\"" | ||
| 877 | (assoc-ref outputs "out"))) | ||
| 878 | (("\"dask-worker\"") | ||
| 879 | (format #false "\"~a/bin/dask-worker\"" | ||
| 880 | (assoc-ref outputs "out")))))) | ||
| 881 | (replace 'check | ||
| 882 | (lambda* (#:key tests? #:allow-other-keys) | ||
| 883 | (when tests? | ||
| 884 | (setenv "DISABLE_IPV6" "1") | ||
| 885 | (invoke "pytest" "-vv" "distributed" | ||
| 886 | "-m" "not slow and not gpu and not ipython and not avoid_ci" | ||
| 887 | "-k" | ||
| 888 | ;; TODO: These tests fail for unknown reasons: | ||
| 889 | ;; Assertion error. | ||
| 890 | (string-append | ||
| 891 | "not test_version_option" | ||
| 892 | ;; "The 'distributed' distribution was not found" | ||
| 893 | " and not test_register_backend_entrypoint" | ||
| 894 | ;; "AttributeError: module 'distributed.dashboard' has no attribute 'scheduler'" | ||
| 895 | " and not test_get_client_functions_spawn_clusters")))))))) | ||
| 896 | (propagated-inputs | ||
| 897 | `(("python-click" ,python-click) | ||
| 898 | ("python-cloudpickle" ,python-cloudpickle) | ||
| 899 | ("python-cryptography" ,python-cryptography) | ||
| 900 | ("python-dask" ,python-dask) | ||
| 901 | ("python-msgpack" ,python-msgpack) | ||
| 902 | ("python-psutil" ,python-psutil) | ||
| 903 | ("python-pyyaml" ,python-pyyaml) | ||
| 904 | ("python-setuptools" ,python-setuptools) | ||
| 905 | ("python-sortedcontainers" ,python-sortedcontainers) | ||
| 906 | ("python-tblib" ,python-tblib) | ||
| 907 | ("python-toolz" ,python-toolz) | ||
| 908 | ("python-tornado" ,python-tornado-6) | ||
| 909 | ("python-zict" ,python-zict))) | ||
| 910 | (native-inputs | ||
| 911 | `(("python-pytest" ,python-pytest))) | ||
| 912 | (home-page "https://distributed.dask.org") | ||
| 913 | (synopsis "Distributed scheduler for Dask") | ||
| 914 | (description "Dask.distributed is a lightweight library for distributed | ||
| 915 | computing in Python. It extends both the @code{concurrent.futures} and | ||
| 916 | @code{dask} APIs to moderate sized clusters.") | ||
| 917 | (license license:bsd-3))) | ||
| 918 | |||
| 919 | (define-public python-modin | ||
| 920 | (package | ||
| 921 | (name "python-modin") | ||
| 922 | (version "0.10.1") | ||
| 923 | (source | ||
| 924 | (origin | ||
| 925 | ;; The archive on pypi does not include all required files. | ||
| 926 | (method git-fetch) | ||
| 927 | (uri (git-reference | ||
| 928 | (url "https://github.com/modin-project/modin") | ||
| 929 | (commit version))) | ||
| 930 | (file-name (git-file-name name version)) | ||
| 931 | (sha256 | ||
| 932 | (base32 | ||
| 933 | "128ghfb9ncmnn8km409xjcdppvn9nr9jqw8rkvsfavh7wnwlk509")))) | ||
| 934 | (build-system python-build-system) | ||
| 935 | (arguments | ||
| 936 | `(#:phases | ||
| 937 | (modify-phases %standard-phases | ||
| 938 | (add-after 'unpack 'make-files-writable | ||
| 939 | (lambda _ | ||
| 940 | (for-each make-file-writable (find-files ".")))) | ||
| 941 | (replace 'check | ||
| 942 | (lambda* (#:key tests? #:allow-other-keys) | ||
| 943 | (when tests? | ||
| 944 | (setenv "MODIN_ENGINE" "dask") | ||
| 945 | (invoke "python" "-m" "pytest" | ||
| 946 | "modin/pandas/test/test_concat.py") | ||
| 947 | (setenv "MODIN_ENGINE" "python") | ||
| 948 | (invoke "python" "-m" "pytest" | ||
| 949 | "modin/pandas/test/test_concat.py"))))))) | ||
| 950 | (propagated-inputs | ||
| 951 | `(("python-cloudpickle" ,python-cloudpickle) | ||
| 952 | ("python-dask" ,python-dask) | ||
| 953 | ("python-distributed" ,python-distributed) | ||
| 954 | ("python-numpy" ,python-numpy) | ||
| 955 | ("python-packaging" ,python-packaging) | ||
| 956 | ("python-pandas" ,python-pandas))) | ||
| 957 | (native-inputs | ||
| 958 | `(("python-coverage" ,python-coverage) | ||
| 959 | ("python-jinja2" ,python-jinja2) | ||
| 960 | ("python-lxml" ,python-lxml) | ||
| 961 | ("python-matplotlib" ,python-matplotlib) | ||
| 962 | ("python-msgpack" ,python-msgpack) | ||
| 963 | ("python-openpyxl" ,python-openpyxl) | ||
| 964 | ("python-psutil" ,python-psutil) | ||
| 965 | ("python-pyarrow" ,python-pyarrow) | ||
| 966 | ("python-pytest" ,python-pytest) | ||
| 967 | ("python-pytest-benchmark" ,python-pytest-benchmark) | ||
| 968 | ("python-pytest-cov" ,python-pytest-cov) | ||
| 969 | ("python-pytest-xdist" ,python-pytest-xdist) | ||
| 970 | ("python-scipy" ,python-scipy) | ||
| 971 | ("python-sqlalchemy" ,python-sqlalchemy) | ||
| 972 | ("python-tables" ,python-tables) | ||
| 973 | ("python-tqdm" ,python-tqdm) | ||
| 974 | ("python-xarray" ,python-xarray) | ||
| 975 | ("python-xlrd" ,python-xlrd))) | ||
| 976 | (home-page "https://github.com/modin-project/modin") | ||
| 977 | (synopsis "Make your pandas code run faster") | ||
| 978 | (description | ||
| 979 | "Modin uses Ray or Dask to provide an effortless way to speed up your | ||
| 980 | pandas notebooks, scripts, and libraries. Unlike other distributed DataFrame | ||
| 981 | libraries, Modin provides seamless integration and compatibility with existing | ||
| 982 | pandas code.") | ||
| 983 | (license license:asl2.0))) | ||
