projects/guix·blob wip-node-riscv64 · refs

4243 lines · 167.8 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015, 2016, 2020-2025 Ricardo Wurmus <[email protected]>
3;;; Copyright © 2015 Federico Beffa <[email protected]>
4;;; Copyright © 2016 Ben Woodcroft <[email protected]>
5;;; Copyright © 2016 Hartmut Goebel <[email protected]>
6;;; Copyright © 2016, 2022-2025 Efraim Flashner <[email protected]>
7;;; Copyright © 2016-2020, 2022 Marius Bakke <[email protected]>
8;;; Copyright © 2019 Tobias Geerinckx-Rice <[email protected]>
9;;; Copyright © 2019, 2021, 2022, 2023, 2024 Maxim Cournoyer <[email protected]>
10;;; Copyright © 2019 Giacomo Leidi <[email protected]>
11;;; Copyright © 2020 Pierre Langlois <[email protected]>
12;;; Copyright © 2020-2025 Vinicius Monego <[email protected]>
13;;; Copyright © 2021 Greg Hogan <[email protected]>
14;;; Copyright © 2021 Roel Janssen <[email protected]>
15;;; Copyright © 2021 Paul Garlick <[email protected]>
16;;; Copyright © 2021 Arun Isaac <[email protected]>
17;;; Copyright © 2021, 2023 Felix Gruber <[email protected]>
18;;; Copyright © 2022 Malte Frank Gerdes <[email protected]>
19;;; Copyright © 2022 Guillaume Le Vaillant <[email protected]>
20;;; Copyright © 2022 Paul A. Patience <[email protected]>
21;;; Copyright © 2022 Wiktor Żelazny <[email protected]>
22;;; Copyright © 2022 Eric Bavier <[email protected]>
23;;; Copyright © 2022, 2024 Antero Mejr <[email protected]>
24;;; Copyright © 2022 jgart <[email protected]>
25;;; Copyright © 2023, 2024 Troy Figiel <[email protected]>
26;;; Copyright © 2024-2025 Sharlatan Hellseher <[email protected]>
27;;; Copyright © 2024 Marco Baggio <[email protected]>
28;;; Copyright © 2024 Nicolas Graves <[email protected]>
29;;; Copyright © 2024 Rick Huijzer <[email protected]>
30;;;
31;;; This file is part of GNU Guix.
32;;;
33;;; GNU Guix is free software; you can redistribute it and/or modify it
34;;; under the terms of the GNU General Public License as published by
35;;; the Free Software Foundation; either version 3 of the License, or (at
36;;; your option) any later version.
37;;;
38;;; GNU Guix is distributed in the hope that it will be useful, but
39;;; WITHOUT ANY WARRANTY; without even the implied warranty of
40;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
41;;; GNU General Public License for more details.
42;;;
43;;; You should have received a copy of the GNU General Public License
44;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
45
46(define-module (gnu packages python-science)
47 #:use-module ((guix licenses) #:prefix license:)
48 #:use-module (gnu packages)
49 #:use-module (gnu packages base)
50 #:use-module (gnu packages bioinformatics)
51 #:use-module (gnu packages boost)
52 #:use-module (gnu packages build-tools)
53 #:use-module (gnu packages check)
54 #:use-module (gnu packages chemistry)
55 #:use-module (gnu packages cmake)
56 #:use-module (gnu packages compression)
57 #:use-module (gnu packages cpp)
58 #:use-module (gnu packages crates-io)
59 #:use-module (gnu packages crypto)
60 #:use-module (gnu packages databases)
61 #:use-module (gnu packages digest)
62 #:use-module (gnu packages gcc)
63 #:use-module (gnu packages geo)
64 #:use-module (gnu packages image)
65 #:use-module (gnu packages image-processing)
66 #:use-module (gnu packages machine-learning)
67 #:use-module (gnu packages maths)
68 #:use-module (gnu packages mpi)
69 #:use-module (gnu packages pcre)
70 #:use-module (gnu packages perl)
71 #:use-module (gnu packages pkg-config)
72 #:use-module (gnu packages python)
73 #:use-module (gnu packages python-build)
74 #:use-module (gnu packages python-check)
75 #:use-module (gnu packages python-crypto)
76 #:use-module (gnu packages python-graphics)
77 #:use-module (gnu packages python-web)
78 #:use-module (gnu packages python-xyz)
79 #:use-module (gnu packages rust-apps)
80 #:use-module (gnu packages simulation)
81 #:use-module (gnu packages sphinx)
82 #:use-module (gnu packages ssh)
83 #:use-module (gnu packages statistics)
84 #:use-module (gnu packages time)
85 #:use-module (gnu packages xdisorg)
86 #:use-module (gnu packages xml)
87 #:use-module (gnu packages xorg)
88 #:use-module (guix packages)
89 #:use-module (guix gexp)
90 #:use-module (guix download)
91 #:use-module (guix git-download)
92 #:use-module (guix utils)
93 #:use-module (guix build-system cargo)
94 #:use-module (guix build-system cmake)
95 #:use-module (guix build-system python)
96 #:use-module (guix build-system pyproject))
97
98(define-public pyre
99 (package
100 (name "pyre")
101 (version "1.12.5")
102 (source
103 (origin
104 (method git-fetch)
105 (uri (git-reference
106 (url "https://github.com/pyre/pyre")
107 (commit (string-append "v" version))))
108 (file-name (git-file-name name version))
109 (sha256
110 (base32
111 "0crmssga481q2ggwcmj40nj5n9975wri14p609jdr9hwg4vdyvj2"))))
112 (build-system cmake-build-system)
113 (arguments
114 (list
115 #:imported-modules (append %cmake-build-system-modules
116 %python-build-system-modules)
117 #:modules '((guix build cmake-build-system)
118 ((guix build python-build-system) #:prefix python:)
119 (guix build utils))
120 #:configure-flags
121 #~(list (string-append "-DPYRE_VERSION=" #$version)
122 (string-append "-DPYRE_DEST_PACKAGES="
123 (python:site-packages %build-inputs %outputs)))
124 #:phases
125 #~(modify-phases %standard-phases
126 (add-after 'unpack 'enable-bytecode-determinism
127 (assoc-ref python:%standard-phases 'enable-bytecode-determinism))
128 ;; Move the check phase after the Python 'pyre' module
129 ;; is installed and made available.
130 (delete 'check)
131 (add-after 'install 'add-to-pythonpath
132 (lambda* (#:key inputs outputs #:allow-other-keys)
133 (python:add-installed-pythonpath inputs outputs)))
134 (add-after 'add-to-pythonpath 'wrap
135 (assoc-ref python:%standard-phases 'wrap))
136 (add-after 'add-to-pythonpath 'check
137 (lambda* (#:key tests? parallel-tests? #:allow-other-keys)
138 (when tests?
139 (setenv "CTEST_OUTPUT_ON_FAILURE" "1")
140 (let ((ignored-tests
141 (list
142 ;; The MPI tests are failing for unknown reasons (see:
143 ;; https://github.com/pyre/pyre/issues/126).
144 "tests.mpi"
145 ;; These tests have a cleanup phase that fails
146 ;; non-deterministically (see:
147 ;; https://github.com/pyre/pyre/issues/125).
148 "tests.pyre.lib.viz.flow"
149 ;; This test expects a TCP port 22 to be listening.
150 "tests.pyre.pkg.ipc.tcp.py"
151 ;; These postgres tests require a running postgresql
152 ;; daemon; they are also skipped in upstream CI.
153 "tests.postgres.ext"
154 ;; This test fails due to pre-1980 timestamps, not
155 ;; supported by ZIP.
156 "tests.pyre.pkg.filesystem.zip_open.py"
157 ;; This one trips on the patched python3 shebang.
158 "tests.pyre.pkg.filesystem.local_open.py")))
159 (invoke "ctest"
160 "-j" (if parallel-tests?
161 (number->string (parallel-job-count))
162 "1")
163 "-E" (string-join ignored-tests "|")))))))))
164 (native-inputs (list openssh-sans-x python python-numpy pybind11 zip))
165 (inputs (list gsl hdf5 openmpi postgresql))
166 (propagated-inputs (list python-pyyaml)) ;for the Python bindings
167 (home-page "http://pyre.orthologue.com/")
168 (synopsis "Framework for building Scientific applications")
169 (description
170 "This package provides a framework for building scientific applications.
171It aims to bring state of the art software design practices to scientific
172computing, with the goal of providing a strong skeleton on which to build
173scientific codes by steering the implementation towards usability and
174maintainability.")
175 (license license:bsd-3)))
176
177(define-public python-cmocean
178 (package
179 (name "python-cmocean")
180 (version "4.0.3")
181 (source
182 (origin
183 (method url-fetch)
184 (uri (pypi-uri "cmocean" version))
185 (sha256
186 (base32 "0z0d4ma6i228gwpgnkai8scs9bmzz41rirlnqpmb8hazzfcq71ip"))))
187 (build-system pyproject-build-system)
188 (native-inputs
189 (list python-pytest
190 python-setuptools
191 python-wheel))
192 (propagated-inputs
193 (list python-matplotlib
194 python-numpy
195 python-packaging))
196 (home-page "https://github.com/matplotlib/cmocean")
197 (synopsis "Colormaps for Oceanography")
198 (description
199 "This package contains colormaps for commonly-used oceanographic
200variables. Most of the colormaps started from @code{matplotlib} colormaps,
201but have now been adjusted using the viscm tool to be perceptually uniform.")
202 (license license:expat)))
203
204(define-public python-cvxpy
205 (package
206 (name "python-cvxpy")
207 (version "1.4.3")
208 (source
209 (origin
210 (method url-fetch)
211 (uri (pypi-uri "cvxpy" version))
212 (sha256
213 (base32 "0lyri9j5gyg6m1bvfy1a4q2sqdy3w45lp0bxiq9as8srq347ic5i"))))
214 (build-system pyproject-build-system)
215 ;; It's odd but cvxpy appears to need pybind11 at runtime according to its
216 ;; specification. Moving pybind11 to native-inputs would break downstream
217 ;; packages using cvxpy.
218 (propagated-inputs (list pybind11
219 python-clarabel
220 python-ecos
221 python-numpy
222 python-osqp
223 python-scipy
224 python-scs))
225 (native-inputs (list python-pytest python-setuptools python-wheel))
226 (home-page "https://github.com/cvxpy/cvxpy")
227 (synopsis "DSL for modeling convex optimization problems")
228 (description
229 "This package provides a domain-specific language for modeling convex
230optimization problems in Python.")
231 (license license:asl2.0)))
232
233(define-public python-ecos
234 (package
235 (name "python-ecos")
236 (version "2.0.13")
237 (source
238 (origin
239 (method git-fetch)
240 (uri (git-reference
241 (url "https://github.com/embotech/ecos-python")
242 (commit (string-append "v" version))
243 (recursive? #true)))
244 (file-name (git-file-name name version))
245 (sha256
246 (base32 "16ljq8maflfkgbw16rldg6cy14vgz2pb3b2iga60i7yzkq2ikmyw"))))
247 (build-system pyproject-build-system)
248 (propagated-inputs (list python-numpy python-scipy))
249 (native-inputs (list python-pytest python-setuptools python-wheel))
250 (home-page "https://github.com/embotech/ecos")
251 (synopsis "Embedded Cone Solver")
252 (description
253 "This is the Python package for ECOS: Embedded Cone Solver. ECOS is
254numerical software for solving convex second-order cone programs (SOCPs).")
255 (license license:gpl3)))
256
257(define-public python-formulaic
258 (package
259 (name "python-formulaic")
260 (version "1.0.1")
261 (source
262 (origin
263 (method url-fetch)
264 (uri (pypi-uri "formulaic" version))
265 (sha256
266 (base32 "18gvd3f2x358jj0df8vx5fhhnvzw047rsrs03vmvqnxaly97kpb4"))))
267 (build-system pyproject-build-system)
268 (propagated-inputs (list python-astor
269 python-cached-property
270 python-interface-meta
271 python-numpy
272 python-pandas
273 python-scipy
274 python-typing-extensions
275 python-wrapt))
276 (native-inputs (list python-hatchling python-hatch-vcs python-pytest))
277 (home-page "https://github.com/matthewwardrop/formulaic")
278 (synopsis "Implementation of Wilkinson formulas")
279 (description "Formulaic is a high-performance implementation of Wilkinson
280formulas for Python.")
281 (license license:expat)))
282
283(define-public python-imagehash
284 (package
285 (name "python-imagehash")
286 (version "4.3.1")
287 (source
288 (origin
289 (method git-fetch) ;no tests in PyPI
290 (uri (git-reference
291 ;; It's an effective and maintained fork of
292 ;; <https://github.com/bunchesofdonald/photohash> project, which
293 ;; has the latest release in 2016.
294 (url "https://github.com/JohannesBuchner/imagehash")
295 (commit (string-append "v" version))))
296 (file-name (git-file-name name version))
297 (sha256
298 (base32 "1lw9lxzrzy9s5v3xc35vmh97hlyavnla087fp19k77va6v8vbjjf"))))
299 (build-system pyproject-build-system)
300 (native-inputs
301 (list python-pytest
302 python-setuptools
303 python-wheel))
304 (propagated-inputs
305 (list python-numpy
306 python-pillow
307 python-pywavelets
308 python-scipy))
309 (home-page "https://github.com/JohannesBuchner/imagehash")
310 (synopsis "Perceptual Image Hashing library")
311 (description
312 "This package implements a functionality to tell whether two images look
313nearly identical. The image hash algorithms (average, perceptual, difference,
314wavelet) analyse the image structure on luminance (without color information).
315The color hash algorithm analyses the color distribution and black & gray
316fractions (without position information).
317
318Features:
319@itemize
320@item average hashing
321@item perceptual hashing
322@item difference hashing
323@item wavelet hashing
324@item HSV color hashing (colorhash)
325@item crop-resistant hashing
326@end itemize")
327 (license license:bsd-2)))
328
329(define-public python-osqp
330 (package
331 (name "python-osqp")
332 (version "0.6.5")
333 (source
334 (origin
335 (method git-fetch)
336 (uri (git-reference
337 (url "https://github.com/osqp/osqp-python")
338 (commit (string-append "v" version))
339 (recursive? #true)))
340 (file-name (git-file-name name version))
341 (sha256
342 (base32 "0s1nbzkfsi2h4ji3v0k14pfcrvinakrwy4xdbz320lbaq3yb0b65"))))
343 (build-system pyproject-build-system)
344 (arguments
345 (list
346 #:test-flags
347 ;; Some of these test failures are explained by
348 ;; https://github.com/osqp/osqp-python/issues/121.
349 ;; These tests require the module "vec_emosqp", which we don't have.
350 '(list "--ignore=src/osqp/tests/codegen_vectors_test.py"
351 ;; These tests need "mat_emosqp".
352 "--ignore=src/osqp/tests/codegen_matrices_test.py"
353 ;; These fail with accuracy differences
354 "--ignore=src/osqp/tests/update_matrices_test.py"
355 "--ignore=src/osqp/tests/feasibility_test.py"
356 "--ignore=src/osqp/tests/polishing_test.py"
357 ;; This requires the nonfree MKL.
358 "--ignore=src/osqp/tests/mkl_pardiso_test.py")
359 #:phases
360 #~(modify-phases %standard-phases
361 ;; It looks like the upgrade to scipy 1.12.0 only broke the test
362 ;; suite, not the features of this library. See
363 ;; https://github.com/osqp/osqp-python/issues/121.
364 (add-after 'unpack 'relax-requirements
365 (lambda _
366 (substitute* "requirements.txt"
367 (("scipy.*1.12.0") "scipy <= 1.12.0"))))
368 (add-before 'build 'set-version
369 (lambda _
370 (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" #$version))))))
371 (propagated-inputs (list python-numpy python-qdldl python-scipy))
372 ;; We need setuptools-scm only for the version number. Without it the
373 ;; version number will be "0.0.0" and downstream packages will complain.
374 (native-inputs
375 (list cmake-minimal
376 python-pytest
377 python-setuptools-scm
378 python-setuptools
379 python-wheel))
380 (home-page "https://osqp.org/")
381 (synopsis "OSQP: operator splitting QP solver")
382 (description "The OSQP (Operator Splitting Quadratic Program) solver is a
383numerical optimization package.")
384 (license license:asl2.0)))
385
386(define-public python-qdldl
387 (package
388 (name "python-qdldl")
389 (version "0.1.7.post2")
390 (source
391 (origin
392 (method url-fetch)
393 (uri (pypi-uri "qdldl" version))
394 (sha256
395 (base32 "1lspam0k8gnw1yglqxvdv350fq00nkgdfmkizmx7bk0hxjjkj5ab"))))
396 (build-system pyproject-build-system)
397 (native-inputs
398 (list cmake-minimal
399 pybind11
400 python-setuptools
401 python-wheel))
402 (propagated-inputs (list python-numpy python-scipy))
403 (home-page "https://github.com/oxfordcontrol/qdldl-python/")
404 (synopsis "QDLDL LDL factorization routine")
405 (description "This package provides a Python interface to the QDLDL LDL
406factorization routine for quasi-definite linear system.")
407 (license license:asl2.0)))
408
409(define-public python-scipy
410 (package
411 (name "python-scipy")
412 (version "1.12.0")
413 (source
414 (origin
415 (method url-fetch)
416 (uri (pypi-uri "scipy" version))
417 (sha256
418 (base32 "18rn15wg3lp58z204fbjjhy0h79c53yg3c4qqs9h3liniamspxab"))))
419 (build-system pyproject-build-system)
420 (arguments
421 (list
422 #:phases
423 #~(modify-phases %standard-phases
424 (replace 'check
425 (lambda* (#:key tests? #:allow-other-keys)
426 (when tests?
427 ;; Step out of the source directory to avoid interference.
428 (with-directory-excursion "/tmp"
429 (invoke "python" "-c"
430 (string-append
431 "import scipy; scipy.test('fast', parallel="
432 (number->string (parallel-job-count))
433 ", verbose=2)"))))))
434 (add-after 'check 'install-doc
435 (lambda* (#:key outputs #:allow-other-keys)
436 ;; FIXME: Documentation cannot be built because it requires
437 ;; a newer version of pydata-sphinx-theme, which currently
438 ;; cannot build without internet access:
439 ;; <https://github.com/pydata/pydata-sphinx-theme/issues/628>.
440 ;; Keep the phase for easy testing.
441 (let ((sphinx-build (false-if-exception
442 (search-input-file input "bin/sphinx-build"))))
443 (if sphinx-build
444 (let* ((doc (assoc-ref outputs "doc"))
445 (data (string-append doc "/share"))
446 (docdir (string-append
447 data "/doc/"
448 #$(package-name this-package) "-"
449 #$(package-version this-package)))
450 (html (string-append docdir "/html")))
451 (with-directory-excursion "doc"
452 ;; Build doc.
453 (invoke "make" "html"
454 ;; Building the documentation takes a very long time.
455 ;; Parallelize it.
456 (string-append "SPHINXOPTS=-j"
457 (number->string (parallel-job-count))))
458 ;; Install doc.
459 (mkdir-p html)
460 (copy-recursively "build/html" html)))
461 (format #t "sphinx-build not found, skipping~%"))))))))
462 (propagated-inputs
463 (append
464 (if (supported-package? python-jupytext) ; Depends on pandoc.
465 (list python-jupytext)
466 '())
467 (list python-matplotlib
468 python-mpmath
469 python-mypy
470 python-numpy
471 python-numpydoc
472 python-pydata-sphinx-theme
473 python-pydevtool
474 python-pythran
475 python-rich-click
476 python-sphinx
477 python-threadpoolctl
478 python-typing-extensions)))
479 (inputs (list openblas pybind11-2.10))
480 (native-inputs
481 (list gfortran
482 ;; XXX: Adding gfortran shadows GCC headers, causing a compilation
483 ;; failure. Somehow also providing GCC works around it ...
484 gcc
485 meson-python
486 pkg-config
487 python-click
488 python-cython-0.29.35
489 python-doit
490 python-hypothesis
491 python-pooch
492 python-pycodestyle
493 python-pydevtool
494 python-pytest
495 python-pytest-cov
496 python-pytest-timeout
497 python-pytest-xdist))
498 (home-page "https://scipy.org/")
499 (synopsis "The Scipy library provides efficient numerical routines")
500 (description "The SciPy library is one of the core packages that make up
501the SciPy stack. It provides many user-friendly and efficient numerical
502routines such as routines for numerical integration and optimization.")
503 (license license:bsd-3)))
504
505(define-public python-scikit-allel
506 (package
507 (name "python-scikit-allel")
508 (version "1.3.13")
509 (source
510 (origin
511 (method url-fetch)
512 (uri (pypi-uri "scikit_allel" version))
513 (sha256
514 (base32 "0d9yadzhsjjqkh6rz273f53iwczk0c7pv9dajzcrmfnk036b8f4s"))))
515 (build-system pyproject-build-system)
516 (arguments
517 (list
518 #:test-flags
519 '(list "-k"
520 (string-append
521 ;; AttributeError: 'Dataset' object has no attribute 'asstr'
522 "not test_vcf_to_hdf5"
523 " and not test_vcf_to_hdf5_exclude"
524 " and not test_vcf_to_hdf5_rename"
525 " and not test_vcf_to_hdf5_group"
526 " and not test_vcf_to_hdf5_ann"
527 ;; Does not work with recent hmmlearn
528 " and not test_roh_mhmm_0pct"
529 " and not test_roh_mhmm_100pct"))
530 #:phases
531 '(modify-phases %standard-phases
532 (add-before 'check 'build-ext
533 (lambda _
534 (invoke "python" "setup.py" "build_ext" "--inplace"))))))
535 (propagated-inputs
536 (list python-dask python-numpy))
537 (native-inputs
538 (list htslib
539 python-cython
540 python-h5py
541 python-hmmlearn
542 python-numexpr
543 python-numpy
544 python-pytest
545 python-setuptools
546 python-setuptools-scm
547 python-wheel
548 python-zarr))
549 (home-page "https://github.com/cggh/scikit-allel")
550 (synopsis "Explore and analyze genetic variation data")
551 (description
552 "This package provides utilities for exploratory analysis of large scale
553genetic variation data.")
554 (license license:expat)))
555
556(define-public python-scikit-build-core
557 (package
558 (name "python-scikit-build-core")
559 (version "0.10.7")
560 (source
561 (origin
562 (method url-fetch)
563 (uri (pypi-uri "scikit_build_core" version))
564 (sha256
565 (base32 "1y64d8rl39banfwdkszyd4sbzp795q8lj66yxrz2l84mwygvbjq4"))))
566 (build-system pyproject-build-system)
567 ;; Tests are aborted with the admonition: "setup.py install is
568 ;; deprecated. Use build and pip and other standards-based tools."
569 (arguments (list #:tests? #false))
570 (propagated-inputs (list python-exceptiongroup
571 python-importlib-metadata
572 python-importlib-resources
573 python-packaging
574 python-pathspec
575 python-tomli
576 python-typing-extensions))
577 (native-inputs (list pybind11
578 python-cattrs
579 python-fastjsonschema
580 python-hatch-fancy-pypi-readme
581 python-hatch-vcs
582 python-hatchling
583 python-numpy
584 python-pip
585 python-pypa-build
586 python-pytest
587 python-pytest-subprocess
588 python-rich
589 python-setuptools
590 python-setuptools-scm
591 python-virtualenv
592 python-wheel))
593 (home-page "https://github.com/scikit-build/scikit-build-core")
594 (synopsis "Build backend for CMake based projects")
595 (description "Scikit-build-core is a build backend for Python that uses
596CMake to build extension modules. It has a simple yet powerful static
597configuration system in pyproject.toml, and supports almost unlimited
598flexibility via CMake. It was initially developed to support the demanding
599needs of scientific users, but can build any sort of package that uses
600CMake.")
601 (license license:asl2.0)))
602
603(define-public python-scikit-fem
604 (package
605 (name "python-scikit-fem")
606 (version "10.0.2")
607 (source
608 (origin
609 (method git-fetch) ; no tests in PyPI
610 (uri (git-reference
611 (url "https://github.com/kinnala/scikit-fem")
612 (commit version)))
613 (file-name (git-file-name name version))
614 (sha256
615 (base32 "10kvzm4fmazsrddd83m0903wan67fkj13vdp6w1iw6wm6a0b5h28"))))
616 (build-system pyproject-build-system)
617 (arguments
618 (list
619 #:test-flags #~(list
620 ;; Tests require Jax.
621 "--ignore=tests/test_autodiff.py"
622 "--ignore=tests/test_examples.py")))
623 (native-inputs
624 (list python-autograd
625 python-pyamg
626 ;; python-jax ; not packed yet
627 python-pytest
628 python-shapely
629 python-setuptools
630 python-wheel))
631 (propagated-inputs
632 (list python-meshio
633 python-numpy
634 python-scipy))
635 (home-page "https://scikit-fem.readthedocs.io/en/latest/")
636 (synopsis "Library for performing finite element assembly")
637 (description
638 "@code{scikit-fem} is a library for performing finite element assembly.
639Its main purpose is the transformation of bilinear forms into sparse matrices
640and linear forms into vectors.")
641 (license license:bsd-3)))
642
643(define-public python-scikit-fuzzy
644 (package
645 (name "python-scikit-fuzzy")
646 (version "0.5.0")
647 (source
648 (origin
649 (method url-fetch)
650 (uri (pypi-uri "scikit_fuzzy" version))
651 (sha256
652 (base32 "0zsfyd8cpd2l82fwh3smxbwhb3bkqwlq17cbav53axma4c2k9r9f"))))
653 (build-system pyproject-build-system)
654 (arguments
655 (list
656 #:test-flags #~(list "--pyargs" "skfuzzy")))
657 (native-inputs
658 (list python-pytest python-setuptools python-wheel))
659 (propagated-inputs
660 (list python-networkx python-numpy python-scipy))
661 (home-page "https://github.com/scikit-fuzzy/scikit-fuzzy")
662 (synopsis "Fuzzy logic toolkit for SciPy")
663 (description
664 "This package implements many useful tools for projects involving fuzzy
665logic, also known as grey logic.")
666 (license license:bsd-3)))
667
668(define-public python-scikit-image
669 (package
670 (name "python-scikit-image")
671 (version "0.23.2")
672 (source
673 (origin
674 (method git-fetch)
675 (uri (git-reference
676 (url "https://github.com/scikit-image/scikit-image")
677 (commit (string-append "v" version))))
678 (file-name (git-file-name name version))
679 (sha256
680 (base32 "1bc8i57sjk44vd9k1ilr6fpvfq1zbq9yfi22lz22k26mzrlisym3"))))
681 (build-system pyproject-build-system)
682 (arguments
683 (list
684 ;; Disable flaky test
685 #:test-flags #~(list "-k" "not test_ellipse_parameter_stability")
686 #:phases
687 #~(modify-phases %standard-phases
688 (add-before 'build 'change-home-dir
689 (lambda _
690 ;; Change from /homeless-shelter to /tmp for write permission.
691 (setenv "HOME" "/tmp")))
692 (replace 'check
693 (lambda* (#:key tests? test-flags #:allow-other-keys)
694 (when tests?
695 (with-directory-excursion "/tmp"
696 (apply invoke "pytest" "-v" "--doctest-modules"
697 (append test-flags (list #$output))))))))))
698 ;; See requirements/ for the list of build and run time requirements.
699 ;; NOTE: scikit-image has an optional dependency on python-pooch, however
700 ;; propagating it would enable many more tests that require online data.
701 (propagated-inputs
702 (list python-cloudpickle
703 python-dask
704 python-imageio
705 python-lazy-loader
706 python-matplotlib
707 python-networkx
708 python-numpy
709 python-pillow
710 python-pythran
711 python-pywavelets
712 python-scipy
713 python-tifffile))
714 (native-inputs
715 (list meson-python
716 python-cython
717 python-numpydoc
718 python-packaging
719 python-pytest
720 python-pytest-localserver
721 python-wheel))
722 (home-page "https://scikit-image.org/")
723 (synopsis "Image processing in Python")
724 (description
725 "Scikit-image is a collection of algorithms for image processing.")
726 (license license:bsd-3)))
727
728(define-public python-scikit-misc
729 (package
730 (name "python-scikit-misc")
731 (version "0.5.1")
732 (source
733 (origin
734 (method url-fetch)
735 (uri (pypi-uri "scikit_misc" version))
736 (sha256
737 (base32 "18sj7qa3kk4pqh3rzg2c64lf03nciv9cf985yh1h2kpqqndgdhf5"))))
738 (build-system pyproject-build-system)
739 (arguments
740 (list
741 #:test-flags
742 '(list "--pyargs" "skmisc")
743 #:phases
744 #~(modify-phases %standard-phases
745 (add-after 'unpack 'fix-version
746 (lambda _
747 (call-with-output-file "skmisc/_version.py"
748 (lambda (port)
749 (display (string-append "__version__ = \"" #$version "\"")
750 port)))
751 (substitute* "meson.build"
752 (("^ version: run_command.*")
753 (string-append " version: '" #$version "',\n")))
754 (substitute* "pyproject.toml"
755 (("dynamic = \\['version'\\]")
756 (string-append "version = \"" #$version "\""))))))))
757 (propagated-inputs (list meson-python
758 python-numpy
759 python-numpydoc
760 python-spin
761 python-twine))
762 (native-inputs (list gfortran
763 pkg-config
764 python-cython-3
765 python-meson-python
766 python-numpy
767 python-pytest
768 python-pytest-cov
769 python-setuptools
770 python-wheel))
771 (home-page "https://has2k1.github.io/scikit-misc/stable")
772 (synopsis "Miscellaneous tools for scientific computing.")
773 (description "This package provides miscellaneous tools for data analysis
774and scientific computing.")
775 (license license:bsd-3)))
776
777(define-public python-scikit-opt
778 (package
779 (name "python-scikit-opt")
780 (version "0.6.6")
781 (source
782 (origin
783 (method url-fetch)
784 (uri (pypi-uri "scikit-opt" version))
785 (sha256
786 (base32 "0ycqizgsj7q57asc1bphzhf1fx9zqn0vx5rli7q541bas64hfqiy"))))
787 (build-system pyproject-build-system)
788 (propagated-inputs (list python-numpy python-pytorch python-scipy))
789 (native-inputs (list python-setuptools))
790 (home-page "https://github.com/guofei9987/scikit-opt")
791 (synopsis "Swarm intelligence algorithms in Python")
792 (description
793 "Scikit-opt (or sko) is a Python module implementing @dfn{swarm
794intelligence} algorithms: genetic algorithm, particle swarm optimization,
795simulated annealing, ant colony algorithm, immune algorithm, artificial fish
796swarm algorithm.")
797 (license license:expat)))
798
799(define-public python-scikit-optimize
800 (package
801 (name "python-scikit-optimize")
802 (version "0.10.2")
803 (source (origin
804 (method git-fetch)
805 (uri (git-reference
806 (url "https://github.com/holgern/scikit-optimize")
807 (commit (string-append "v" version))))
808 (file-name (git-file-name name version))
809 (sha256
810 (base32
811 "0pc6avzxz8l32km5jvv3maih0a5x2akxybvxl2hdg04qz2l0kz8b"))))
812 (build-system pyproject-build-system)
813 (propagated-inputs
814 (list python-joblib
815 python-matplotlib
816 python-numpy
817 python-pyaml
818 python-scikit-learn
819 python-scipy))
820 (native-inputs
821 (list python-pytest python-setuptools python-wheel))
822 (home-page "https://scikit-optimize.github.io/")
823 (synopsis "Sequential model-based optimization toolbox")
824 (description "Scikit-Optimize, or @code{skopt}, is a simple and efficient
825library to minimize (very) expensive and noisy black-box functions. It
826implements several methods for sequential model-based optimization.
827@code{skopt} aims to be accessible and easy to use in many contexts.")
828 (license license:bsd-3)))
829
830(define-public python-scikit-surprise
831 (package
832 (name "python-scikit-surprise")
833 (version "1.1.4")
834 (source
835 (origin
836 (method git-fetch)
837 (uri (git-reference
838 (url "https://github.com/NicolasHug/Surprise")
839 (commit (string-append "v" version))))
840 (file-name (git-file-name name version))
841 (sha256
842 (base32 "15ckx2i41vs21sa3yqyj12zr0h4zrcdf3lrwcy2c1cq2bjq7mnvz"))))
843 (build-system pyproject-build-system)
844 (arguments
845 (list
846 #:phases
847 #~(modify-phases %standard-phases
848 (add-before 'check 'set-home
849 (lambda _
850 ;; Change from /homeless-shelter to /tmp for write
851 ;; permission.
852 (setenv "HOME" "/tmp"))))))
853 (native-inputs
854 (list python-cython-3
855 python-pandas
856 python-pytest
857 python-setuptools
858 python-wheel))
859 (propagated-inputs
860 (list python-joblib
861 python-numpy
862 python-scikit-learn))
863 (home-page "https://surpriselib.com/")
864 (synopsis "Recommender system library for Scikit-learn")
865 (description
866 "This package provides a Python library for building and analyzing
867recommender systems that deal with explicit rating data. It was designed with
868the following purposes in mind:
869@itemize
870@item Provide tools to handle downloaded or user-provided datasets.
871@item Provide ready-to-use prediction algorithms and similarity measures.
872@item Provide a base for creating custom algorithms.
873@item Provide tools to evaluate, analyse and compare algorithm performance.
874@item Provide documentation with precise details regarding library algorithms.
875@end itemize")
876 (license license:bsd-3)))
877
878(define-public python-scikit-survival
879 (let ((revision "1")
880 ;; We need a later commit for support of a more recent sklearn and
881 ;; numpy 2.
882 (commit "bceb53ebb8306f959c70fae2be9d552f33dd3f21"))
883 (package
884 (name "python-scikit-survival")
885 (version (git-version "0.22.2" revision commit))
886 (source
887 (origin
888 (method git-fetch)
889 (uri (git-reference
890 (url "https://github.com/sebp/scikit-survival")
891 (commit commit)
892 ;; This package contains a copy of Eigen. It would be good to
893 ;; figure out how to use our own Eigen package.
894 (recursive? #true)))
895 (file-name (git-file-name name version))
896 (sha256
897 (base32 "1m3z64nv4sgay0mdrrw4q4z5ylx63a9w2x43w1r4g8kpg7z9rdfc"))))
898 (build-system pyproject-build-system)
899 (arguments
900 (list
901 #:phases
902 #~(modify-phases %standard-phases
903 (add-before 'build 'set-version
904 (lambda _
905 (setenv "SETUPTOOLS_SCM_PRETEND_VERSION"
906 #$(version-major+minor version)))))))
907 (propagated-inputs
908 (list python-ecos
909 python-importlib-resources
910 python-joblib
911 python-numexpr
912 python-numpy
913 python-osqp
914 python-pandas
915 python-scikit-learn
916 python-scipy))
917 (native-inputs
918 (list python-black
919 python-pypa-build
920 python-coverage
921 python-cython-3
922 python-packaging
923 python-pytest
924 python-setuptools
925 python-setuptools-scm
926 python-tomli
927 python-tox))
928 (home-page "https://github.com/sebp/scikit-survival")
929 (synopsis "Survival analysis built on top of scikit-learn")
930 (description "Scikit-survival is a Python module for survival analysis
931built on top of scikit-learn. It allows doing survival analysis while
932utilizing the power of scikit-learn, e.g., for pre-processing or doing
933cross-validation.")
934 (license license:gpl3+))))
935
936(define-public python-tdda
937 (package
938 (name "python-tdda")
939 (version "2.0.9")
940 (source
941 (origin
942 (method url-fetch)
943 (uri (pypi-uri "tdda" version))
944 (sha256
945 (base32 "1xs91s8b7cshjcqw88qsrjh10xly799k5rf2ycawqfz2mw8sy3br"))))
946 (build-system pyproject-build-system)
947 (arguments
948 '(#:phases (modify-phases %standard-phases
949 (replace 'check
950 (lambda* (#:key tests? #:allow-other-keys)
951 (when tests?
952 (invoke "tdda" "test")))))))
953 (native-inputs
954 (list python-numpy
955 python-pandas
956 python-setuptools
957 python-wheel))
958 (home-page "https://www.stochasticsolutions.com")
959 (synopsis "Test-driven data analysis library for Python")
960 (description
961 "The TDDA Python module provides command-line and Python API support
962for the overall process of data analysis, through tools that perform
963reference testing, constraint discovery for data, automatic inference
964of regular expressions from text data and automatic test generation.")
965 (license license:expat))) ; MIT License
966
967(define-public python-trimesh
968 (package
969 (name "python-trimesh")
970 (version "4.5.3")
971 (source
972 (origin
973 (method git-fetch) ; no tests in PyPI
974 (uri (git-reference
975 (url "https://github.com/mikedh/trimesh")
976 (commit version)))
977 (file-name (git-file-name name version))
978 (sha256
979 (base32 "17fyapp8nffnnf95bmcvllvg41fjlpvlv6qndbm048hnyayixxld"))))
980 (build-system pyproject-build-system)
981 (arguments
982 (list
983 #:test-flags
984 ;; XXX: When more optional modules are available review
985 ;; disabled tests once again.
986 ;;
987 ;; Disable tests requiring optional, not packed modules.
988 #~(list "-k" (string-join
989 (list "not test_bezier_example"
990 "test_discrete"
991 "test_dxf"
992 "test_ply_path_bezier"
993 "test_ply_path_line"
994 "test_ply_path_multi"
995 "test_revolve"
996 "test_screw"
997 "test_simple_closed"
998 "test_simple_extrude"
999 "test_simple_open"
1000 "test_slice_onplane"
1001 "test_spline_3D"
1002 "test_svg"
1003 ;; Following tests require network:
1004 "test_fuze"
1005 "test_remote")
1006 " and not "))
1007 #:phases
1008 #~(modify-phases %standard-phases
1009 ;; XXX: It struggles to load and fails with error: AttributeError:
1010 ;; module 'trimesh' has no attribute '__main__'.
1011 (delete 'sanity-check))))
1012 (native-inputs
1013 (list python-coveralls
1014 python-pyinstrument
1015 python-pytest))
1016 (propagated-inputs
1017 (list ;; python-cascadio ; not packed yet, optional
1018 python-chardet
1019 python-colorlog
1020 python-httpx
1021 python-jsonschema
1022 python-lxml
1023 ;; python-mapbox-earcut ; not packed yet, optional
1024 ;; python-manifold3d ; not packed yet, optional
1025 python-meshio
1026 python-networkx
1027 python-numpy
1028 ;; python-openctm ; not packed yet, optional
1029 python-pillow
1030 python-psutil
1031 python-pycollada
1032 python-pyglet
1033 python-requests
1034 python-rtree
1035 python-scikit-image
1036 python-scipy
1037 python-setuptools
1038 python-shapely
1039 ;; python-svg-path ; not packed yet, optional
1040 python-sympy
1041 ;; python-vhacdx ; not packed yet, optional
1042 ;; python-xatlas ; not packed yet, optional
1043 python-xxhash))
1044 (home-page "https://github.com/mikedh/trimesh")
1045 (synopsis "Python library for loading and using triangular meshes")
1046 (description
1047 "Trimesh is a pure Python library for loading and using triangular meshes
1048with an emphasis on watertight surfaces. The goal of the library is to
1049provide a full featured and well tested Trimesh object which allows for easy
1050manipulation and analysis, in the style of the Polygon object in the Shapely
1051library.")
1052 (license license:expat)))
1053
1054(define-public python-meshzoo
1055 (package
1056 (name "python-meshzoo")
1057 (version "0.9.4")
1058 (source
1059 (origin
1060 (method git-fetch)
1061 (uri (git-reference
1062 (url "https://github.com/diego-hayashi/meshzoo")
1063 (commit (string-append "v" version))))
1064 (file-name (git-file-name name version))
1065 (sha256
1066 (base32 "107byfppbq16fqyp2hw7ydcvvahspzq0hzvlvzqg2zxi1aigbr68"))))
1067 (build-system pyproject-build-system)
1068 (propagated-inputs
1069 (list python-numpy))
1070 (native-inputs (list python-flit-core python-matplotlib python-pytest))
1071 (home-page "https://github.com/diego-hayashi/meshzoo")
1072 (synopsis "Mesh generator for simple geometries")
1073 (description
1074 "@code{meshzoo} is a mesh generator for finite element or finite
1075volume computations for simple domains like regular polygons, disks,
1076spheres, cubes, etc.")
1077 (license license:gpl3+)))
1078
1079(define-public python-mpl-scatter-density
1080 (package
1081 (name "python-mpl-scatter-density")
1082 (version "0.8")
1083 (source
1084 (origin
1085 (method url-fetch)
1086 (uri (pypi-uri "mpl_scatter_density" version))
1087 (sha256
1088 (base32 "0cynk1rk6k2xklgv69difphrz6id77x3xb58kbs4mc4q7z6bvfid"))))
1089 (build-system pyproject-build-system)
1090 (arguments
1091 (list
1092 ;; See <https://github.com/astrofrog/mpl-scatter-density/issues/42>.
1093 #:test-flags #~(list "-k" "not test_default_dpi")))
1094 (native-inputs
1095 (list python-pytest
1096 python-pytest-cov
1097 python-pytest-mpl
1098 python-setuptools
1099 python-setuptools-scm
1100 python-wheel))
1101 (propagated-inputs
1102 (list python-fast-histogram
1103 python-matplotlib
1104 python-numpy))
1105 (home-page "https://github.com/astrofrog/mpl-scatter-density")
1106 (synopsis "Matplotlib helpers to make density scatter plots")
1107 (description
1108 "This package provides functionality to make it easy to make scatter
1109density maps, both for interactive and non-interactive use.")
1110 (license license:bsd-2)))
1111
1112(define-public python-mpsplines
1113 ;; No release on PyPI no git tag, use the latest commit.
1114 (let ((commit "4967655fca8f4d0fc0685486c8ec2f1fe2f199d2")
1115 (revision "0"))
1116 (package
1117 (name "python-mpsplines")
1118 (version (git-version "0.0.0" revision commit))
1119 (source
1120 (origin
1121 (method git-fetch)
1122 (uri (git-reference
1123 (url "https://github.com/jararias/mpsplines")
1124 (commit commit)))
1125 (file-name (git-file-name name version))
1126 (sha256
1127 (base32 "1wqfvjp1d6xzb07qnq72h76f0mx7za9pasgw3qp3ciaycmlkvdr3"))))
1128 (build-system pyproject-build-system)
1129 (arguments
1130 (list #:tests? #f)) ; no tests provided
1131 (native-inputs
1132 (list python-setuptools
1133 python-wheel))
1134 (propagated-inputs
1135 (list python-scipy
1136 python-numpy
1137 python-loguru))
1138 (home-page "https://github.com/jararias/mpsplines")
1139 (synopsis "Mean preserving interpolation with splines")
1140 (description
1141 "Thi package implements a functionality for mean-preserving
1142interpolation of 1D data (for example, time series) with splines.")
1143 (license license:bsd-3))))
1144
1145(define-public python-pyamg
1146 (package
1147 (name "python-pyamg")
1148 (version "5.0.1")
1149 (source (origin
1150 (method url-fetch)
1151 (uri (pypi-uri "pyamg" version))
1152 (modules '((guix build utils)))
1153 (snippet
1154 ;; Delete autogenerated files, regenerate in a phase.
1155 #~(begin
1156 (for-each
1157 (lambda (file)
1158 (delete-file (string-append "pyamg/amg_core/" file)))
1159 '("air_bind.cpp"
1160 "evolution_strength_bind.cpp"
1161 "graph_bind.cpp"
1162 "krylov_bind.cpp"
1163 "linalg_bind.cpp"
1164 "relaxation_bind.cpp"
1165 "ruge_stuben_bind.cpp"
1166 "smoothed_aggregation_bind.cpp"
1167 "tests/bind_examples_bind.cpp"))))
1168 (sha256
1169 (base32
1170 "0l3dliwynxyjvbgpmi2k8jqvkkw6fc00c8w69h6swhrkfh0ql12z"))))
1171 (arguments
1172 (list
1173 #:test-flags
1174 ;; Test installed package in order to find C++ modules.
1175 #~(list "--pyargs" "pyamg.tests")
1176 #:phases
1177 #~(modify-phases %standard-phases
1178 ;; Regenerate the autogenerated files.
1179 (add-after 'unpack 'amg-core-bind-them
1180 (lambda _
1181 ;; bindthem.py heavily depends on location to produce *_bind.cpp
1182 ;; file, make it available in tests as well.
1183 (copy-file "pyamg/amg_core/bindthem.py"
1184 "pyamg/amg_core/tests/bindthem.py")
1185 (with-directory-excursion "pyamg/amg_core"
1186 (substitute* "bindthem.py"
1187 (("/usr/bin/env python3") (which "python3")))
1188 (invoke "sh" "generate.sh"))
1189 (with-directory-excursion "pyamg/amg_core/tests"
1190 (invoke "python" "bindthem.py" "bind_examples.h")))))))
1191 (build-system pyproject-build-system)
1192 (native-inputs
1193 (list pybind11
1194 python-cppheaderparser
1195 python-pytest
1196 python-pyyaml
1197 python-setuptools
1198 python-setuptools-scm
1199 python-wheel))
1200 (propagated-inputs (list python-numpy python-scipy))
1201 (home-page "https://github.com/pyamg/pyamg")
1202 (synopsis "Algebraic Multigrid Solvers in Python")
1203 (description "PyAMG is a Python library of Algebraic Multigrid
1204(AMG) solvers. It features implementations of:
1205@itemize
1206@item Ruge-Stuben (RS) or Classical AMG
1207@item AMG based on Smoothed Aggregation (SA)
1208@item Adaptive Smoothed Aggregation (αSA)
1209@item Compatible Relaxation (CR)
1210@item Krylov methods such as CG, GMRES, FGMRES, BiCGStab, MINRES, etc.
1211@end itemize")
1212 (license license:expat)))
1213
1214(define-public python-pyet
1215 (package
1216 (name "python-pyet")
1217 (version "1.3.1")
1218 (source
1219 (origin
1220 (method url-fetch)
1221 (uri (pypi-uri "pyet" version))
1222 (sha256
1223 (base32 "1dblsx0bv1g453hcx5vwij1zgankwgwvhwllqkn47k578h038xvy"))))
1224 (build-system pyproject-build-system)
1225 (native-inputs
1226 (list python-mock
1227 python-pytest
1228 python-setuptools
1229 python-wheel))
1230 (propagated-inputs
1231 (list python-pandas
1232 python-xarray))
1233 (home-page "https://github.com/pyet-org/pyet")
1234 (synopsis "Python package for evapotranspiration calculation")
1235 (description
1236 "This package provides a Python library for calculating
1237Evapotranspiration using various standard methods.")
1238 (license license:expat)))
1239
1240(define-public python-nibabel
1241 (package
1242 (name "python-nibabel")
1243 (version "5.3.2")
1244 (source
1245 (origin
1246 (method url-fetch)
1247 (uri (pypi-uri "nibabel" version))
1248 (sha256
1249 (base32 "16snprwgp7qzp51j3mx0zdn7brvx6r14ankldi24ny0w7d8adp0b"))))
1250 (build-system pyproject-build-system)
1251 (arguments
1252 (list
1253 ;; AttributeError: 'dict' object has no attribute 'add'.
1254 #:test-flags #~(list "-k" "not test_first and not test_second")))
1255 (propagated-inputs (list python-importlib-resources python-numpy
1256 python-packaging python-typing-extensions))
1257 (native-inputs (list python-hatch-vcs
1258 python-hatchling
1259 python-pytest
1260 python-pytest-httpserver
1261 python-pytest-xdist))
1262 (home-page "https://nipy.org/nibabel/")
1263 (synopsis "Read and write access to common neuroimaging file formats")
1264 (description
1265 "@code{nibabel} is a library that provides read and write access to
1266common neuroimaging file formats, including: ANALYZE (plain, SPM99, SPM2
1267and later), GIFTI, NIfTI1, NIfTI2, CIFTI-2, MINC1, MINC2, AFNI BRIK/HEAD,
1268ECAT and Philips PAR/REC. In addition, NiBabel also supports FreeSurfer’s
1269MGH, geometry, annotation and morphometry files, and provides some limited
1270support for DICOM.")
1271 (license license:expat))) ; and other non-copyleft licenses
1272
1273(define-public python-tspex
1274 (package
1275 (name "python-tspex")
1276 (version "0.6.2")
1277 (source (origin
1278 (method url-fetch)
1279 (uri (pypi-uri "tspex" version))
1280 (sha256
1281 (base32
1282 "0x64ki1nzhms2nb8xpng92bzh5chs850dvapr93pkg05rk22m6mv"))))
1283 (build-system python-build-system)
1284 (propagated-inputs
1285 (list python-matplotlib python-numpy python-pandas python-xlrd))
1286 (home-page "https://apcamargo.github.io/tspex/")
1287 (synopsis "Calculate tissue-specificity metrics for gene expression")
1288 (description
1289 "This package provides a Python package for calculating
1290tissue-specificity metrics for gene expression.")
1291 (license license:gpl3+)))
1292
1293(define-public python-ndindex
1294 (package
1295 (name "python-ndindex")
1296 (version "1.7") ;newer versions require a newer numpy
1297 (source
1298 (origin
1299 (method url-fetch)
1300 (uri (pypi-uri "ndindex" version))
1301 (sha256
1302 (base32 "1lpgsagmgxzsas7g8yiv6wmyss8q57w92h70fn11rnpadsvx16xz"))))
1303 (build-system pyproject-build-system)
1304 (arguments (list #:test-flags #~(list "-c" "/dev/null"))) ;avoid coverage
1305 (native-inputs
1306 (list python-cython
1307 python-numpy
1308 python-pytest
1309 python-setuptools
1310 python-wheel))
1311 (home-page "https://quansight-labs.github.io/ndindex/")
1312 (synopsis "Python library for manipulating indices of ndarrays")
1313 (description "This package provides a Python library for manipulating
1314indices of @code{ndarrays}.")
1315 (license license:expat)))
1316
1317(define-public python-pandas-1
1318 (package
1319 (name "python-pandas")
1320 (version "1.5.3")
1321 (source
1322 (origin
1323 (method url-fetch)
1324 (uri (pypi-uri "pandas" version))
1325 (sha256
1326 (base32 "1cdhngylzh352wx5s3sjyznn7a6kmjqcfg97hgqm5h3yb9zgv8vl"))))
1327 (build-system pyproject-build-system)
1328 (arguments
1329 (list
1330 #:test-flags
1331 '(list "--pyargs" "pandas"
1332 "-n" (number->string (parallel-job-count))
1333 "-m" "not slow and not network and not db"
1334 "-k"
1335 (string-append
1336 ;; TODO: Missing input
1337 "not TestS3"
1338 " and not s3"
1339 ;; No module named 'pandas.io.sas._sas'
1340 " and not test_read_expands_user_home_dir"
1341 " and not test_read_non_existent"
1342 ;; Unknown failures
1343 " and not test_switch_options"
1344 ;; These fail with: td64 doesn't return NotImplemented, see numpy#17017
1345 " and not test_nat_comparisons"
1346 ;; Crashes
1347 " and not test_bytes_exceed_2gb"
1348 ;; get_subplotspec() returns None; possibly related to
1349 ;; https://github.com/pandas-dev/pandas/issues/54577
1350 " and not test_plain_axes"
1351 ;; This test fails when run with pytest-xdist
1352 ;; (see https://github.com/pandas-dev/pandas/issues/39096).
1353 " and not test_memory_usage"))
1354 #:phases
1355 #~(modify-phases %standard-phases
1356 (add-after 'unpack 'patch-build-system
1357 (lambda _
1358 (substitute* "pyproject.toml"
1359 ;; Not all data files are distributed with the tarball.
1360 (("--strict-data-files ") "")
1361 ;; Unknown property "asyncio_mode"
1362 (("asyncio_mode = \"strict\"") ""))))
1363 (add-after 'unpack 'patch-which
1364 (lambda* (#:key inputs #:allow-other-keys)
1365 (substitute* "pandas/io/clipboard/__init__.py"
1366 (("^WHICH_CMD = .*")
1367 (string-append "WHICH_CMD = \""
1368 (search-input-file inputs "/bin/which")
1369 "\"\n")))))
1370 (add-before 'check 'prepare-x
1371 (lambda _
1372 (system "Xvfb &")
1373 (setenv "DISPLAY" ":0")
1374 ;; xsel needs to write a log file.
1375 (setenv "HOME" "/tmp")))
1376 ;; The compiled libraries are only in the output at this point,
1377 ;; but they are needed to run tests.
1378 ;; FIXME: This should be handled by the pyargs pytest argument,
1379 ;; but is not for some reason.
1380 (add-before 'check 'pre-check
1381 (lambda* (#:key inputs outputs #:allow-other-keys)
1382 (copy-recursively
1383 (string-append (site-packages inputs outputs)
1384 "/pandas/_libs")
1385 "pandas/_libs"))))))
1386 (propagated-inputs
1387 (list python-jinja2
1388 python-matplotlib
1389 python-numpy
1390 python-openpyxl
1391 python-pytz
1392 python-dateutil
1393 python-xlrd
1394 python-xlsxwriter))
1395 (inputs
1396 (list which xclip xsel))
1397 (native-inputs
1398 (list python-cython-0.29.35
1399 python-beautifulsoup4
1400 python-lxml
1401 python-html5lib
1402 python-pytest
1403 python-pytest-mock
1404 python-pytest-xdist
1405 python-setuptools
1406 python-wheel
1407 ;; Needed to test clipboard support.
1408 xorg-server-for-tests))
1409 (home-page "https://pandas.pydata.org")
1410 (synopsis "Data structures for data analysis, time series, and statistics")
1411 (description
1412 "Pandas is a Python package providing fast, flexible, and expressive data
1413structures designed to make working with structured (tabular,
1414multidimensional, potentially heterogeneous) and time series data both easy
1415and intuitive. It aims to be the fundamental high-level building block for
1416doing practical, real world data analysis in Python.")
1417 (license license:bsd-3)))
1418
1419(define-public python-pandas-2
1420 (package
1421 (name "python-pandas")
1422 (version "2.2.3")
1423 (source
1424 (origin
1425 (method git-fetch)
1426 (uri (git-reference
1427 (url "https://github.com/pandas-dev/pandas")
1428 (commit (string-append "v" version))))
1429 (file-name (git-file-name name version))
1430 (sha256
1431 (base32 "00f6jnplwg7iffnxdm4hpfls0ncbarc23933xq1rm5nk5g8dcldx"))))
1432 (build-system pyproject-build-system)
1433 (arguments
1434 (list
1435 #:test-flags
1436 #~(list "--pyargs" "pandas"
1437 ;; "--exitfirst"
1438 ;; XXX The tests won't even start on my 16 core laptop, but they
1439 ;; start with 4 processes.
1440 "--numprocesses" (number->string (min 4 (parallel-job-count)))
1441 "-m" "not slow and not network and not db"
1442 ;; All tests errored.
1443 "--ignore=pandas/tests/io/test_clipboard.py"
1444 "-k" (string-join
1445 (list
1446 "not test_git_version"
1447 "test_show_versions_console"
1448 ;; Not testing ~ expansion.
1449 "test_expand_user"
1450 "test_get_handle_with_path"
1451 ;; These test access the internet (see:
1452 ;; https://github.com/pandas-dev/pandas/issues/45085).:
1453 ;; pandas/tests/io/xml/test_xml.py::test_wrong_url[lxml]
1454 ;; pandas/tests/io/xml/test_xml.py::test_wrong_url[etree]
1455 "test_wrong_url"
1456 ;; TODO: Missing input
1457 "TestS3"
1458 "s3"
1459 ;; This test fails when run with pytest-xdist
1460 ;; (see: https://github.com/pandas-dev/pandas/issues/39096).
1461 "test_memory_usage"
1462 "test_parsing_tzlocal_deprecated"
1463 ;; PyArrow is optional.
1464 "test_style_bar_with_pyarrow_NA_values"
1465 "test_very_negative_exponent"
1466 "test_usecols_no_header_pyarrow"
1467 "test_scientific_no_exponent[pyarrow-None]"
1468 "test_inspect_getmembers"
1469 ;; SciPy introduces cycle, optional.
1470 "test_savefig"
1471 ;; It requires a fresh python-tzdata, including new
1472 ;; timezones.
1473 "test_repr"
1474 ;; These tests should be skipped on 32bit systems:
1475 ;; Cannot cast array data from dtype('int64') to dtype('int32')
1476 #$@(if (not (target-64bit?))
1477 #~("test_inf_bound_infinite_recursion"
1478 "test_reindex_behavior_with_interval_index"
1479 "test_repeating_interval_index_with_infs")
1480 #~()))
1481 " and not "))
1482 #:phases
1483 #~(modify-phases %standard-phases
1484 (add-after 'unpack 'version-set-by-guix
1485 (lambda _
1486 (with-output-to-file "_version.py"
1487 (lambda _
1488 (display
1489 (string-append "__version__ = \""
1490 #$(package-version this-package)
1491 "\""))))))
1492 (add-before 'check 'pre-check
1493 (lambda _
1494 (setenv "HOME" ".")
1495 ;; Skip tests that require lots of resources.
1496 (setenv "PANDAS_CI" "1")))
1497 (add-after 'unpack 'patch-which
1498 (lambda _
1499 (substitute* "pandas/io/clipboard/__init__.py"
1500 (("^WHICH_CMD = .*")
1501 (string-append "WHICH_CMD = \""
1502 #$(this-package-input "which")
1503 "/bin/which\"\n")))))
1504 ;; The compiled libraries are only in the output at this point,
1505 ;; but they are needed to run tests.
1506 ;; FIXME: This should be handled by the pyargs pytest argument,
1507 ;; but is not for some reason.
1508 (add-before 'check 'pre-check
1509 (lambda _
1510 (copy-recursively
1511 (string-append #$output
1512 "/lib/python3.10/site-packages/pandas/_libs")
1513 "pandas/_libs"))))))
1514 (propagated-inputs
1515 (list python-dateutil
1516 python-jinja2
1517 python-matplotlib
1518 python-numpy
1519 python-openpyxl
1520 python-pytz
1521 python-tzdata
1522 python-xlrd
1523 python-xlsxwriter))
1524 (inputs
1525 (list which xclip xsel))
1526 (native-inputs
1527 (list meson-python
1528 python-beautifulsoup4
1529 python-cython-3
1530 python-html5lib
1531 python-lxml
1532 python-matplotlib
1533 python-openpyxl
1534 python-pytest-asyncio
1535 python-pytest
1536 python-pytest-localserver
1537 python-pytest-mock
1538 python-pytest-xdist
1539 python-versioneer))
1540 (home-page "https://pandas.pydata.org")
1541 (synopsis "Data structures for data analysis, time series, and statistics")
1542 (description
1543 "Pandas is a Python package providing fast, flexible, and expressive data
1544structures designed to make working with structured (tabular,
1545multidimensional, potentially heterogeneous) and time series data both easy
1546and intuitive. It aims to be the fundamental high-level building block for
1547doing practical, real world data analysis in Python.")
1548 (license license:bsd-3)))
1549
1550(define-public python-pandas python-pandas-2)
1551
1552(define-public python-pandas-stubs
1553 (package
1554 (name "python-pandas-stubs")
1555 ;; The versioning follows that of Pandas and uses the date of the
1556 ;; python-pandas-stubs release.
1557 (version "2.2.3.241126")
1558 (source
1559 (origin
1560 ;; No tests in the PyPI tarball.
1561 (method git-fetch)
1562 (uri (git-reference
1563 (url "https://github.com/pandas-dev/pandas-stubs")
1564 (commit (string-append "v" version))))
1565 (file-name (git-file-name name version))
1566 (sha256
1567 (base32 "0xbvin2l7h8vq9g24n4n2l49pdxbi15qghq7zkhh567p3pbmvsyb"))))
1568 (build-system pyproject-build-system)
1569 (arguments
1570 (list
1571 #:test-flags #~(list "--ignore=tests/test_io.py" ;requires python-calamine
1572 "-k"
1573 (string-append
1574 ;; The python-pyarrow package in Guix is built
1575 ;; with ORC integration, but these tests fail with
1576 ;; an abort in ORC because a timezone file is not
1577 ;; in the expected location:
1578 ;; https://github.com/apache/arrow/issues/40633
1579 "not test_orc"
1580 " and not test_orc_path"
1581 " and not test_orc_buffer"
1582 " and not test_orc_columns"
1583 " and not test_orc_bytes"
1584 " and not test_all_read_without_lxml_dtype_backend"
1585
1586 ;; Apparently "numpy.bool_" is not the same as the
1587 ;; expected "bool".
1588 " and not test_timedelta_cmp"
1589 " and not test_timedelta_cmp_rhs"
1590 " and not test_timestamp_cmp"
1591 " and not test_timestamp_eq_ne_rhs"))
1592 #:phases
1593 '(modify-phases %standard-phases
1594 ;; We cannot yet upgrade numpy to 1.26 because numba needs numpy
1595 ;; >1.24.
1596 (add-after 'unpack 'relax-requirements
1597 (lambda _
1598 (substitute* "pyproject.toml"
1599 (("numpy = \\{ version = \">=1.26.0\", python = \"<3.13\" \\}")
1600 "numpy = { version = \">=1.23.0\", python = \"<3.13\" }"))))
1601 (add-before 'check 'prepare-x
1602 (lambda _
1603 (system "Xvfb &")
1604 (setenv "DISPLAY" ":0")
1605 ;; xsel needs to write a log file.
1606 (setenv "HOME" (getcwd)))))))
1607 (propagated-inputs (list python-types-pytz))
1608 ;; Add python-fastparquet to native inputs once it has been packaged. Its
1609 ;; tests will be skipped for now.
1610 (native-inputs (list python-lxml
1611 python-matplotlib
1612 python-odfpy
1613 python-pandas
1614 python-poetry-core
1615 python-pyarrow
1616 python-pyreadstat
1617 python-pytest
1618 python-scipy
1619 python-sqlalchemy-2
1620 python-tables
1621 python-tabulate
1622 python-xarray
1623 ;; Needed to test clipboard support.
1624 which
1625 xclip
1626 xorg-server-for-tests
1627 xsel))
1628 (home-page "https://pandas.pydata.org")
1629 (synopsis "Type annotations for pandas")
1630 (description
1631 "This package contains public type stubs for @code{python-pandas},
1632following the convention of providing stubs in a separate package, as
1633specified in @acronym{PEP, Python Enhancement Proposal} 561. The stubs cover
1634the most typical use cases of @code{python-pandas}. In general, these stubs
1635are narrower than what is possibly allowed by @code{python-pandas}, but follow
1636a convention of suggesting best recommended practices for using
1637@code{python-pandas}.")
1638 (license license:bsd-3)))
1639
1640(define-public python-pandarallel
1641 (package
1642 (name "python-pandarallel")
1643 (version "1.6.5")
1644 (source
1645 (origin
1646 (method git-fetch) ; no tests in PyPI
1647 (uri (git-reference
1648 (url "https://github.com/nalepae/pandarallel/")
1649 (commit (string-append "v" version))))
1650 (file-name (git-file-name name version))
1651 (sha256
1652 (base32 "0r2wlxlwp4wia0vm15k4cp421mwa20k4k5g2ml01inprj8bl1p0p"))))
1653 (build-system pyproject-build-system)
1654 (arguments
1655 (list
1656 #:test-flags #~(list "-n" (number->string (parallel-job-count)))))
1657 (propagated-inputs
1658 (list python-dill
1659 python-pandas
1660 python-psutil))
1661 (native-inputs
1662 (list python-mkdocs-material
1663 python-numpy
1664 python-pytest
1665 python-pytest-cov
1666 python-pytest-xdist
1667 python-setuptools
1668 python-wheel))
1669 (home-page "https://nalepae.github.io/pandarallel/")
1670 (synopsis "Tool to parallelize Pandas operations across CPUs")
1671 (description
1672 "@code{pandarallel} allows any Pandas user to take advantage of their
1673multi-core computer, while Pandas uses only one core. @code{pandarallel} also
1674offers nice progress bars (available on Notebook and terminal) to get an rough
1675idea of the remaining amount of computation to be done.")
1676 (license license:bsd-3)))
1677
1678(define-public python-pandera
1679 (package
1680 (name "python-pandera")
1681 (version "0.18.0")
1682 (source
1683 (origin
1684 ;; No tests in the PyPI tarball.
1685 (method git-fetch)
1686 (uri (git-reference
1687 (url "https://github.com/unionai-oss/pandera")
1688 (commit (string-append "v" version))))
1689 (file-name (git-file-name name version))
1690 (sha256
1691 (base32 "14b5aij5zjkwvsimg0v00qvp59mhhq7ljim4qghcn432vkg9gh47"))
1692 (modules '((guix build utils)))
1693 ;; These tests require PySpark and Modin. We need to remove the entire
1694 ;; directory, since the conftest.py in these directories contain
1695 ;; imports. (See: https://github.com/pytest-dev/pytest/issues/7452)
1696 (snippet '(begin
1697 (delete-file-recursively "tests/pyspark")
1698 (delete-file-recursively "tests/modin")))))
1699 (build-system pyproject-build-system)
1700 (arguments
1701 (list
1702 #:test-flags '(list "-k"
1703 (string-append
1704 ;; Mypy functionality is experimental and relying
1705 ;; on pandas-stubs can lead to false
1706 ;; positives. These tests currently fail.
1707 "not test_python_std_list_dict_generics"
1708 " and not test_python_std_list_dict_empty_and_none"
1709 " and not test_pandas_modules_importable"
1710 " and not test_check_groups"
1711 ;; This is a test failure due to unexpected error
1712 ;; message format. It is harmless.
1713 " and not test_pandas_stubs_false_positives"))))
1714 ;; Pandera comes with a lot of extras. We test as many as possible, but do
1715 ;; not include all of them in the propagated-inputs. Currently, we have to
1716 ;; skip the pyspark and io tests due to missing packages python-pyspark
1717 ;; and python-frictionless.
1718 (propagated-inputs (list python-hypothesis ;strategies extra
1719 python-multimethod
1720 python-numpy
1721 python-packaging
1722 python-pandas
1723 python-pandas-stubs ;mypy extra
1724 python-pydantic-2
1725 python-scipy ;hypotheses extra
1726 python-typeguard
1727 python-typing-inspect
1728 python-wrapt))
1729 (native-inputs (list python-dask ;dask extra
1730 python-fastapi ;fastapi extra
1731 python-geopandas ;geopandas extra
1732 python-pyarrow ;needed to run fastapi tests
1733 python-pytest
1734 python-pytest-asyncio
1735 python-setuptools
1736 python-sphinx
1737 python-uvicorn ;needed to run fastapi tests
1738 python-wheel))
1739 (home-page "https://github.com/unionai-oss/pandera")
1740 (synopsis "Perform data validation on dataframe-like objects")
1741 (description
1742 "@code{python-pandera} provides a flexible and expressive API for
1743performing data validation on dataframe-like objects to make data processing
1744pipelines more readable and robust. Dataframes contain information that
1745@code{python-pandera} explicitly validates at runtime. This is useful in
1746production-critical data pipelines or reproducible research settings. With
1747@code{python-pandera}, you can:
1748
1749@itemize
1750@item Define a schema once and use it to validate different dataframe types.
1751@item Check the types and properties of columns.
1752@item Perform more complex statistical validation like hypothesis testing.
1753@item Seamlessly integrate with existing data pipelines via function decorators.
1754@item Define dataframe models with the class-based API with pydantic-style syntax.
1755@item Synthesize data from schema objects for property-based testing.
1756@item Lazily validate dataframes so that all validation rules are executed.
1757@item Integrate with a rich ecosystem of tools like @code{python-pydantic},
1758@code{python-fastapi} and @code{python-mypy}.
1759@end itemize")
1760 (license license:expat)))
1761
1762(define-public python-pyjanitor
1763 (package
1764 (name "python-pyjanitor")
1765 (version "0.27.0")
1766 (source
1767 (origin
1768 ;; The build requires the mkdocs directory for the description in
1769 ;; setup.py. This is not included in the PyPI tarball.
1770 (method git-fetch)
1771 (uri (git-reference
1772 (url "https://github.com/pyjanitor-devs/pyjanitor")
1773 (commit (string-append "v" version))))
1774 (file-name (git-file-name name version))
1775 (sha256
1776 (base32 "04vsg189msv8frx4zhpcg61djl7wsfvibmz0zmiih4rvkgly2cdr"))))
1777 (build-system pyproject-build-system)
1778 ;; Pyjanitor has an extensive test suite. For quick debugging, the tests
1779 ;; marked turtle can be skipped using "-m" "not turtle".
1780 (arguments
1781 (list
1782 #:test-flags '(list
1783 "-n" (number->string (parallel-job-count))
1784 ;; Tries to connect to the internet.
1785 "-k" (string-append "not test_is_connected"
1786 ;; Test files are not included
1787 " and not test_read_commandline_bad_cmd"
1788 ;; This fails due to differences in accuracy
1789 " and not test_jitter_results")
1790 ;; Test files are not included
1791 "--ignore=tests/io/test_read_csvs.py"
1792 ;; PySpark has not been packaged yet.
1793 "--ignore=tests/spark/functions/test_clean_names_spark.py"
1794 "--ignore=tests/spark/functions/test_update_where_spark.py")
1795 #:phases
1796 #~(modify-phases %standard-phases
1797 ;; Pandas 2.1.1 does not offer the BME frequency.
1798 (add-after 'unpack 'pandas-compat
1799 (lambda _
1800 (substitute* '("tests/functions/test_select_rows.py"
1801 "tests/functions/test_select_columns.py")
1802 (("freq=\"BME\"") "freq=\"BM\""))))
1803 (add-before 'check 'set-env-ci
1804 (lambda _
1805 ;; Some tests are skipped if the JANITOR_CI_MACHINE
1806 ;; variable is not set.
1807 (setenv "JANITOR_CI_MACHINE" "1"))))))
1808 (propagated-inputs (list python-multipledispatch
1809 python-natsort
1810 python-pandas-flavor
1811 python-scipy
1812 ;; Optional imports.
1813 python-biopython ;biology submodule
1814 python-unyt)) ;engineering submodule
1815 (native-inputs (list python-pytest
1816 python-pytest-xdist
1817 ;; Optional imports. We do not propagate them due to
1818 ;; their size.
1819 python-numba ;speedup of joins
1820 python-setuptools
1821 python-wheel
1822 rdkit)) ;chemistry submodule
1823 (home-page "https://github.com/pyjanitor-devs/pyjanitor")
1824 (synopsis "Tools for cleaning and transforming pandas DataFrames")
1825 (description
1826 "@code{pyjanitor} provides a set of data cleaning routines for
1827@code{pandas} DataFrames. These routines extend the method chaining API
1828defined by @code{pandas} for a subset of its methods. Originally, this
1829package was a port of the R package by the same name and it is inspired by the
1830ease-of-use and expressiveness of the @code{dplyr} package.")
1831 (license license:expat)))
1832
1833(define-public python-pymcubes
1834 (package
1835 (name "python-pymcubes")
1836 (version "0.1.6")
1837 (source
1838 (origin
1839 (method git-fetch) ; no tests in PyPI
1840 (uri (git-reference
1841 (url "https://github.com/pmneila/PyMCubes")
1842 (commit (string-append "v" version))))
1843 (file-name (git-file-name name version))
1844 (sha256
1845 (base32 "1v2qhc4pwanx6a8k843mbh45yk77n3w63sy5lzk5c3q4pkvfj1b9"))))
1846 (build-system pyproject-build-system)
1847 (arguments
1848 (list
1849 #:phases
1850 #~(modify-phases %standard-phases
1851 (add-before 'check 'prepare-test-environment
1852 (lambda _
1853 ;; FileNotFoundError: [Errno 2] No such file or directory:
1854 ;; 'output/test.obj'
1855 (mkdir "output")
1856 (invoke "python" "setup.py" "build_ext" "--inplace"))))))
1857 (native-inputs
1858 (list python-cython
1859 python-pytest
1860 python-setuptools
1861 python-wheel))
1862 (propagated-inputs
1863 (list python-pycollada
1864 python-numpy
1865 python-scipy))
1866 (home-page "https://github.com/pmneila/PyMCubes")
1867 (synopsis "Marching cubes for Python")
1868 (description
1869 "@code{PyMCubes} is an implementation of the marching cubes algorithm to
1870extract iso-surfaces from volumetric data. The volumetric data can be given
1871as a three-dimensional @code{NumPy} array or as a Python function @code{f(x,
1872y, z)}.")
1873 (license license:bsd-3)))
1874
1875(define-public python-pythran
1876 (package
1877 (name "python-pythran")
1878 (version "0.17.0")
1879 (home-page "https://github.com/serge-sans-paille/pythran")
1880 (source (origin
1881 (method git-fetch)
1882 (uri (git-reference (url home-page) (commit version)))
1883 (file-name (git-file-name name version))
1884 (sha256
1885 (base32 "1rm9lfbz5qvah1m0rr5gaaahkf1gzwlw1ysvym2l2yh0clglav94"))))
1886 (build-system pyproject-build-system)
1887 (arguments
1888 (list
1889 #:test-flags
1890 '(list (string-append "--numprocesses=" (number->string
1891 (parallel-job-count)))
1892 ;; XXX There are lots of tests of the format
1893 ;; pythran/tests/test_*.py, but they cannot easily be selected.
1894 "pythran/tests/test_typing.py")
1895 #:phases
1896 #~(modify-phases %standard-phases
1897 (add-before 'check 'pre-check
1898 (lambda* (#:key tests? #:allow-other-keys)
1899 (when tests?
1900 ;; Remove compiler flag that trips newer GCC:
1901 ;; https://github.com/serge-sans-paille/pythran/issues/908
1902 (substitute* "pythran/tests/__init__.py"
1903 (("'-Wno-absolute-value',") ""))
1904 (setenv "HOME" (getcwd))
1905 ;; This setup is modelled after the upstream CI system.
1906 (call-with-output-file ".pythranrc"
1907 (lambda (port)
1908 (format port "[compiler]\nblas=openblas~%")))))))))
1909 (native-inputs
1910 ;; For tests.
1911 (list openblas
1912 python-pytest
1913 python-pytest-xdist
1914 python-setuptools
1915 python-wheel))
1916 (propagated-inputs
1917 (list boost xsimd ;headers need to be available
1918 python-beniget python-gast python-numpy python-ply))
1919 (synopsis "Ahead of Time compiler for numeric kernels")
1920 (description
1921 "Pythran is an ahead of time compiler for a subset of the Python
1922language, with a focus on scientific computing. It takes a Python module
1923annotated with a few interface descriptions and turns it into a native
1924Python module with the same interface, but (hopefully) faster.")
1925 (license license:bsd-3)))
1926
1927(define-public python-pyts
1928 (package
1929 (name "python-pyts")
1930 (version "0.13.0")
1931 (source (origin
1932 (method url-fetch)
1933 (uri (pypi-uri "pyts" version))
1934 (sha256
1935 (base32
1936 "00pdzfkl0b4vhfdm8zas7b904jm2hhivdwv3wcmpik7l2p1yr85c"))))
1937 (build-system pyproject-build-system)
1938 (propagated-inputs
1939 (list python-joblib python-numba python-numpy
1940 python-scikit-learn
1941 python-scipy))
1942 (native-inputs
1943 (list python-pytest python-pytest-cov python-setuptools
1944 python-wheel))
1945 (home-page "https://github.com/johannfaouzi/pyts")
1946 (synopsis "Python package for time series classification")
1947 (description
1948 "This package provides a Python package for time series classification.")
1949 (license license:bsd-3)))
1950
1951(define-public python-bottleneck
1952 (package
1953 (name "python-bottleneck")
1954 (version "1.3.7")
1955 (source
1956 (origin
1957 (method url-fetch)
1958 (uri (pypi-uri "Bottleneck" version))
1959 (sha256
1960 (base32 "1y410r3scfhs6s1j1jpxig01qlyn2hr2izyh1qsdlsfl78vpwip1"))))
1961 (build-system python-build-system)
1962 (arguments
1963 `(#:phases
1964 (modify-phases %standard-phases
1965 (replace 'check
1966 (lambda* (#:key tests? #:allow-other-keys)
1967 (when tests?
1968 (invoke "python" "setup.py" "pytest")))))))
1969 (native-inputs
1970 (list python-hypothesis python-pytest python-pytest-runner))
1971 (propagated-inputs
1972 (list python-numpy))
1973 (home-page "https://github.com/pydata/bottleneck")
1974 (synopsis "Fast NumPy array functions written in C")
1975 (description
1976 "Bottleneck is a collection of fast, NaN-aware NumPy array functions
1977written in C.")
1978 (license license:bsd-2)))
1979
1980(define-public python-numpoly
1981 (package
1982 (name "python-numpoly")
1983 (version "1.2.11")
1984 (source (origin
1985 (method git-fetch) ;; PyPI is missing some Pytest fixtures
1986 (uri (git-reference
1987 (url "https://github.com/jonathf/numpoly")
1988 (commit (string-append "v" version))))
1989 (file-name (git-file-name name version))
1990 (sha256
1991 (base32
1992 "01g21v91f4d66xd0bvap0n6d6485w2fnq1636gx6h2s42550rlbd"))))
1993 (build-system pyproject-build-system)
1994 (propagated-inputs (list python-importlib-metadata python-numpy))
1995 (native-inputs (list python-pytest python-setuptools python-sympy
1996 python-wheel))
1997 (home-page "https://numpoly.readthedocs.io/en/master/")
1998 (synopsis "Polynomials as a numpy datatype")
1999 (description "Numpoly is a generic library for creating, manipulating and
2000evaluating arrays of polynomials based on @code{numpy.ndarray objects}.")
2001 ;; Tests fail with dtype mismatches on 32-bit architectures, suggesting
2002 ;; that numpoly only supports 64 bit platforms.
2003 (supported-systems '("x86_64-linux" "aarch64-linux" "powerpc64le-linux"))
2004 (license license:bsd-2)))
2005
2006(define-public python-spin
2007 (package
2008 (name "python-spin")
2009 (version "0.8")
2010 (source
2011 (origin
2012 (method url-fetch)
2013 (uri (pypi-uri "spin" version))
2014 (sha256
2015 (base32 "0ff48nagfaai3j26g1db4zq2bwdv6kj5l7xhcs2l9kzg7qzrmhr7"))))
2016 (build-system pyproject-build-system)
2017 (propagated-inputs (list python-click python-colorama python-tomli))
2018 (native-inputs (list python-pytest python-setuptools python-wheel))
2019 (home-page "https://github.com/scientific-python/spin")
2020 (synopsis "Developer tool for scientific Python libraries")
2021 (description "@code{spin} is a simple interface for common development
2022tasks. It comes with a few common build commands out the box, but can
2023easily be customized per project.
2024
2025The impetus behind developing the tool was the mass migration of scientific
2026Python libraries (SciPy, scikit-image, and NumPy, etc.) to Meson, after
2027distutils was deprecated. When many of the build and installation commands
2028changed, it made sense to abstract away the nuisance of having to re-learn
2029them.")
2030 (license license:bsd-3)))
2031
2032(define-public python-baycomp
2033 (package
2034 (name "python-baycomp")
2035 (version "1.0.2")
2036 (source
2037 (origin
2038 (method url-fetch)
2039 (uri (pypi-uri "baycomp" version))
2040 (sha256
2041 (base32 "1c1354a7b3g8slychjgyjxqdm8z40z9kviyl9n4g9kfpdg0p4d64"))))
2042 (build-system python-build-system)
2043 (propagated-inputs
2044 (list python-matplotlib python-numpy python-scipy))
2045 (home-page "https://github.com/janezd/baycomp")
2046 (synopsis "Library for comparison of Bayesian classifiers")
2047 (description
2048 "Baycomp is a library for Bayesian comparison of classifiers. Functions
2049in the library compare two classifiers on one or on multiple data sets. They
2050compute three probabilities: the probability that the first classifier has
2051higher scores than the second, the probability that differences are within the
2052region of practical equivalence (rope), or that the second classifier has
2053higher scores.")
2054 (license license:expat)))
2055
2056(define-public python-fast-histogram
2057 (package
2058 (name "python-fast-histogram")
2059 (version "0.14")
2060 (source
2061 (origin
2062 (method url-fetch)
2063 (uri (pypi-uri "fast_histogram" version))
2064 (sha256
2065 (base32 "1sk9xa85cgm4sylzblwv3qr2dmm0ic06zkwxqa2xlazjiawp629r"))))
2066 (build-system pyproject-build-system)
2067 (arguments
2068 (list
2069 #:phases
2070 #~(modify-phases %standard-phases
2071 (add-before 'check 'build-extensions
2072 (lambda _
2073 (invoke "python" "setup.py" "build_ext" "--inplace"))))))
2074 (native-inputs
2075 (list python-hypothesis
2076 python-pytest
2077 python-setuptools
2078 python-setuptools-scm
2079 python-wheel))
2080 (propagated-inputs
2081 (list python-numpy))
2082 (home-page "https://github.com/astrofrog/fast-histogram")
2083 (synopsis "Fast simple 1D and 2D histograms")
2084 (description
2085 "The fast-histogram mini-package aims to provide simple and fast
2086histogram functions for regular bins that don't compromise on performance. It
2087doesn't do anything complicated - it just implements a simple histogram
2088algorithm in C and keeps it simple. The aim is to have functions that are
2089fast but also robust and reliable. The result is a 1D histogram function here
2090that is 7-15x faster than @code{numpy.histogram}, and a 2D histogram function
2091that is 20-25x faster than @code{numpy.histogram2d}.")
2092 (license license:bsd-3)))
2093
2094(define-public python-fastcluster
2095 (package
2096 (name "python-fastcluster")
2097 (version "1.2.6")
2098 (source
2099 (origin
2100 (method url-fetch)
2101 (uri (pypi-uri "fastcluster" version))
2102 (sha256
2103 (base32 "19labbgnq85p4r4jbli2p045lgh57larhi2g2anagfxnlzpqdf5a"))))
2104 (build-system pyproject-build-system)
2105 (propagated-inputs (list python-numpy))
2106 (native-inputs (list python-scipy python-setuptools python-wheel))
2107 (home-page "https://danifold.net/fastcluster.html")
2108 (synopsis "Fast hierarchical clustering routines for R and Python")
2109 (description "The fastcluster package implements seven common hierarchical
2110clustering schemes efficiently. The package is made with two interfaces to
2111standard software: R and Python.")
2112 (license license:bsd-2)))
2113
2114(define-public python-fbpca
2115 (package
2116 (name "python-fbpca")
2117 (version "1.0")
2118 (source (origin
2119 (method url-fetch)
2120 (uri (pypi-uri "fbpca" version))
2121 (sha256
2122 (base32
2123 "1lbjqhqsdmqk86lb86q3ywf7561zmdny1dfvgwqkyrkr4ij7f1hm"))))
2124 (build-system python-build-system)
2125 (propagated-inputs
2126 (list python-numpy python-scipy))
2127 (home-page "https://fbpca.readthedocs.io/")
2128 (synopsis "Functions for principal component analysis and accuracy checks")
2129 (description
2130 "This package provides fast computations for @dfn{principal component
2131analysis} (PCA), SVD, and eigendecompositions via randomized methods")
2132 (license license:bsd-3)))
2133
2134(define-public python-geosketch
2135 (package
2136 (name "python-geosketch")
2137 (version "1.2")
2138 (source (origin
2139 (method url-fetch)
2140 (uri (pypi-uri "geosketch" version))
2141 (sha256
2142 (base32
2143 "0knch5h0p8xpm8bi3b5mxyaf1ywwimrsdmbnc1xr5icidcv9gzmv"))))
2144 (build-system python-build-system)
2145 (arguments '(#:tests? #false)) ;there are none
2146 (propagated-inputs (list python-fbpca python-numpy python-scikit-learn))
2147 (home-page "https://github.com/brianhie/geosketch")
2148 (synopsis "Geometry-preserving random sampling")
2149 (description "geosketch is a Python package that implements the geometric
2150sketching algorithm described by Brian Hie, Hyunghoon Cho, Benjamin DeMeo,
2151Bryan Bryson, and Bonnie Berger in \"Geometric sketching compactly summarizes
2152the single-cell transcriptomic landscape\", Cell Systems (2019). This package
2153provides an example implementation of the algorithm as well as scripts
2154necessary for reproducing the experiments in the paper.")
2155 (license license:expat)))
2156
2157(define-public python-einops
2158 (package
2159 (name "python-einops")
2160 (version "0.6.1")
2161 (source (origin
2162 (method git-fetch) ;PyPI misses .ipynb files required for tests
2163 (uri (git-reference
2164 (url "https://github.com/arogozhnikov/einops")
2165 (commit (string-append "v" version))))
2166 (file-name (git-file-name name version))
2167 (sha256
2168 (base32
2169 "1h8p39kd7ylg99mh620xr20hg7v78x1jnj6vxwk31rlw2dmv2dpr"))))
2170 (build-system pyproject-build-system)
2171 (arguments
2172 (list #:phases #~(modify-phases %standard-phases
2173 (add-after 'unpack 'set-backend
2174 (lambda _
2175 ;; Einops supports different backends, but we test
2176 ;; only NumPy for availability and simplicity.
2177 (setenv "EINOPS_TEST_BACKENDS" "numpy"))))))
2178 (native-inputs (list jupyter
2179 python-hatchling
2180 python-nbconvert
2181 python-nbformat
2182 python-parameterized
2183 python-pytest))
2184 (propagated-inputs (list python-numpy))
2185 (home-page "https://einops.rocks/")
2186 (synopsis "Tensor operations for different backends")
2187 (description "Einops provides a set of tensor operations for NumPy and
2188multiple deep learning frameworks.")
2189 (license license:expat)))
2190
2191(define-public python-xarray
2192 (package
2193 (name "python-xarray")
2194 (version "2023.12.0")
2195 (source (origin
2196 (method url-fetch)
2197 (uri (pypi-uri "xarray" version))
2198 (sha256
2199 (base32
2200 "0cyldwchcrmbm1y7l1ry70kk8zdh7frxci3c6iwf4iyyj34dnra5"))))
2201 (build-system pyproject-build-system)
2202 (arguments
2203 (list
2204 #:test-flags
2205 ;; This needs a more recent version of python-hypothesis
2206 '(list "--ignore=xarray/tests/test_strategies.py"
2207 ;; These are known to fail with Pandas 2
2208 "-k"
2209 (string-append "not test_datetime_conversion_warning"
2210 " and not test_timedelta_conversion_warning"
2211 ;; These expect deprecation warnings that are not
2212 ;; emitted in our case.
2213 " and not test_drop_index_labels"
2214 " and not test_rename_multiindex"))))
2215 (native-inputs
2216 (list python-setuptools python-setuptools-scm python-pytest python-wheel))
2217 (propagated-inputs
2218 (list python-numpy python-packaging python-pandas))
2219 (home-page "https://github.com/pydata/xarray")
2220 (synopsis "N-D labeled arrays and datasets")
2221 (description "Xarray (formerly xray) makes working with labelled
2222multi-dimensional arrays simple, efficient, and fun!
2223
2224Xarray introduces labels in the form of dimensions, coordinates and attributes
2225on top of raw NumPy-like arrays, which allows for a more intuitive, more
2226concise, and less error-prone developer experience. The package includes a
2227large and growing library of domain-agnostic functions for advanced analytics
2228and visualization with these data structures.")
2229 (license license:asl2.0)))
2230
2231(define-public python-xarray-dataclasses
2232 (package
2233 (name "python-xarray-dataclasses")
2234 (version "1.7.0")
2235 (source
2236 (origin
2237 (method git-fetch)
2238 (uri (git-reference
2239 (url "https://github.com/astropenguin/xarray-dataclasses/")
2240 (commit (string-append "v" version))))
2241 (file-name (git-file-name name version))
2242 (sha256
2243 (base32 "043lc1hadr5y0y16g682viiafy0hfsa7q18lqmndpyvnmcgm893z"))))
2244 (build-system pyproject-build-system)
2245 (propagated-inputs (list python-numpy python-typing-extensions
2246 python-xarray))
2247 (native-inputs (list python-pytest python-poetry-core))
2248 (home-page "https://github.com/astropenguin/xarray-dataclasses/")
2249 (synopsis "Data creation made easy by dataclass")
2250 (description "@code{xarray-dataclasses} is a Python package that makes it
2251easy to create @code{xarray}'s @code{DataArray} and @code{Datase} objects that
2252are \"typed\" (i.e. fixed dimensions, data type, coordinates, attributes, and
2253name) using the Python's @code{dataclass}.")
2254 (license license:expat)))
2255
2256;; Note that this package will be folded into xarray eventually. See
2257;; https://github.com/pydata/xarray/issues/8572 for details.
2258(define-public python-xarray-datatree
2259 (package
2260 (name "python-xarray-datatree")
2261 (version "0.0.14")
2262 (source
2263 (origin
2264 (method url-fetch)
2265 (uri (pypi-uri "xarray-datatree" version))
2266 (sha256
2267 (base32 "1x1s25s6dp1f2hck9qw8vl8hgkyy23rcwag2a9vd3w0dbgrrl5i6"))))
2268 (build-system pyproject-build-system)
2269 (propagated-inputs (list python-packaging python-xarray))
2270 ;; We need setuptools-scm to correctly record the version string.
2271 (native-inputs
2272 (list python-pytest
2273 python-setuptools
2274 python-setuptools-scm
2275 python-wheel
2276 python-zarr))
2277 (home-page "https://github.com/xarray-contrib/datatree")
2278 (synopsis "Hierarchical tree-like data structures for xarray")
2279 (description "Datatree is a prototype implementation of a tree-like
2280hierarchical data structure for @code{xarray}. Datatree is in the process of
2281being merged upstream into @code{xarray}.")
2282 (license license:asl2.0)))
2283
2284(define-public python-xarray-einstats
2285 (package
2286 (name "python-xarray-einstats")
2287 (version "0.7.0")
2288 (source (origin
2289 (method git-fetch) ; no tests in PyPI
2290 (uri (git-reference
2291 (url "https://github.com/arviz-devs/xarray-einstats")
2292 (commit (string-append "v" version))))
2293 (file-name (git-file-name name version))
2294 (sha256
2295 (base32
2296 "14c424swpdginaz4pm3nmkizxy34x19q6xq3d4spx9s9031f6n3a"))))
2297 (build-system pyproject-build-system)
2298 (native-inputs (list python-einops python-flit-core python-numba
2299 python-pytest))
2300 (propagated-inputs (list python-numpy python-scipy python-xarray))
2301 (home-page "https://einstats.python.arviz.org/en/latest/")
2302 (synopsis "Stats, linear algebra and einops for xarray")
2303 (description
2304 "@code{xarray_einstats} provides wrappers around some NumPy and SciPy
2305functions and around einops with an API and features adapted to xarray.")
2306 (license license:asl2.0)))
2307
2308(define-public python-xarray-schema
2309 (package
2310 (name "python-xarray-schema")
2311 (version "0.0.3")
2312 (source
2313 (origin
2314 (method url-fetch)
2315 (uri (pypi-uri "xarray-schema" version))
2316 (sha256
2317 (base32 "08194629696z98dkc74i6c9zmy1jicvd2ajb75q0lsf0i427cv4w"))))
2318 (build-system pyproject-build-system)
2319 (propagated-inputs (list python-numpy python-xarray))
2320 (native-inputs
2321 (list python-pytest
2322 python-setuptools
2323 python-setuptools-scm
2324 python-wheel))
2325 (home-page "https://github.com/carbonplan/xarray-schema")
2326 (synopsis "Schema validation for Xarray objects")
2327 (description "This package implements schema validation for Xarray
2328objects.")
2329 (license license:expat)))
2330
2331(define-public python-pytensor
2332 (package
2333 (name "python-pytensor")
2334 (version "2.18.1")
2335 (source (origin
2336 (method git-fetch)
2337 (uri (git-reference
2338 (url "https://github.com/pymc-devs/pytensor")
2339 (commit (string-append "rel-" version))))
2340 (file-name (git-file-name name version))
2341 (sha256
2342 (base32
2343 "0qa0y13xfm6w7ry7gp0lv84c8blyg34a9ns7ynwqyhf9majq08s5"))))
2344 (build-system pyproject-build-system)
2345 (arguments
2346 (list
2347 #:phases
2348 #~(modify-phases %standard-phases
2349 ;; Replace version manually because pytensor uses
2350 ;; versioneer, which requires git metadata.
2351 (add-after 'unpack 'versioneer
2352 (lambda _
2353 (with-output-to-file "setup.cfg"
2354 (lambda ()
2355 (display "\
2356[versioneer]
2357VCS = git
2358style = pep440
2359versionfile_source = pytensor/_version.py
2360versionfile_build = pytensor/_version.py
2361tag_prefix =
2362parentdir_prefix = pytensor-
2363")))
2364 (invoke "versioneer" "install")
2365 (substitute* "setup.py"
2366 (("versioneer.get_version\\(\\)")
2367 (string-append "\"" #$version "\"")))))
2368 (replace 'check
2369 (lambda* (#:key tests? #:allow-other-keys)
2370 (when tests?
2371 (setenv "HOME" "/tmp") ; required for most tests
2372 ;; Test discovery fails, have to call pytest by hand.
2373 ;; test_tensor_basic.py file requires JAX.
2374 (invoke "python" "-m" "pytest" "-vv"
2375 "--ignore" "tests/link/jax/test_tensor_basic.py"
2376 ;; Skip benchmark tests.
2377 "-k" (string-append
2378 "not test_elemwise_speed"
2379 " and not test_logsumexp_benchmark"
2380 " and not test_fused_elemwise_benchmark"
2381 " and not test_scan_multiple_output"
2382 " and not test_vector_taps_benchmark"
2383 " and not test_cython_performance")
2384 ;; Skip computationally intensive tests.
2385 "--ignore" "tests/scan/"
2386 "--ignore" "tests/tensor/"
2387 "--ignore" "tests/sandbox/"
2388 "--ignore" "tests/sparse/sandbox/")))))))
2389 (native-inputs (list python-cython
2390 python-pytest
2391 python-pytest-mock
2392 python-versioneer
2393 python-setuptools
2394 python-wheel))
2395 (propagated-inputs (list python-cons
2396 python-etuples
2397 python-filelock
2398 python-logical-unification
2399 python-minikanren
2400 python-numba
2401 python-numpy
2402 python-scipy
2403 python-typing-extensions))
2404 (home-page "https://pytensor.readthedocs.io/en/latest/")
2405 (synopsis
2406 "Library for mathematical expressions in multi-dimensional arrays")
2407 (description
2408 "PyTensor is a Python library that allows one to define, optimize, and
2409efficiently evaluate mathematical expressions involving multi-dimensional
2410arrays. It is a fork of the Aesara library.")
2411 (license license:bsd-3)))
2412
2413(define-public python-msgpack-numpy
2414 (package
2415 (name "python-msgpack-numpy")
2416 (version "0.4.8")
2417 (source
2418 (origin
2419 (method url-fetch)
2420 (uri (pypi-uri "msgpack-numpy" version))
2421 (sha256
2422 (base32
2423 "0sbfanbkfs6c77np4vz0ayrwnv99bpn5xgj5fnf2yhhk0lcd6ry6"))))
2424 (build-system python-build-system)
2425 (propagated-inputs
2426 (list python-msgpack python-numpy))
2427 (home-page "https://github.com/lebedov/msgpack-numpy")
2428 (synopsis
2429 "Numpy data serialization using msgpack")
2430 (description
2431 "This package provides encoding and decoding routines that enable the
2432serialization and deserialization of numerical and array data types provided
2433by numpy using the highly efficient @code{msgpack} format. Serialization of
2434Python's native complex data types is also supported.")
2435 (license license:bsd-3)))
2436
2437(define-public python-ruffus
2438 (package
2439 (name "python-ruffus")
2440 (version "2.8.4")
2441 (source
2442 (origin
2443 (method url-fetch)
2444 (uri (pypi-uri "ruffus" version))
2445 (sha256
2446 (base32
2447 "1ai673k1s94s8b6pyxai8mk17p6zvvyi87rl236fs6ls8mpdklvc"))))
2448 (build-system python-build-system)
2449 (arguments
2450 `(#:phases
2451 (modify-phases %standard-phases
2452 (delete 'check)
2453 (add-after 'install 'check
2454 (lambda* (#:key tests? inputs outputs #:allow-other-keys)
2455 (when tests?
2456 (add-installed-pythonpath inputs outputs)
2457 (with-directory-excursion "ruffus/test"
2458 (invoke "bash" "run_all_unit_tests3.cmd"))))))))
2459 (native-inputs
2460 (list python-pytest))
2461 (home-page "http://www.ruffus.org.uk")
2462 (synopsis "Light-weight computational pipeline management")
2463 (description
2464 "Ruffus is designed to allow scientific and other analyses to be
2465automated with the minimum of fuss and the least effort.")
2466 (license license:expat)))
2467
2468(define-public python-scs
2469 (package
2470 (name "python-scs")
2471 (version "3.2.4")
2472 (source
2473 (origin
2474 (method git-fetch)
2475 (uri (git-reference
2476 (url "https://github.com/bodono/scs-python")
2477 (commit "3.2.4")
2478 (recursive? #true)))
2479 (file-name (git-file-name name version))
2480 (sha256
2481 (base32 "06wd8m3ri0gaddl7qq6243g25zjlnh3da915b73jnrfh7sg1nqsj"))))
2482 (build-system pyproject-build-system)
2483 (native-inputs
2484 (list pkg-config
2485 python-pytest
2486 meson-python))
2487 (inputs
2488 (list openblas))
2489 (propagated-inputs
2490 (list python-numpy
2491 python-scipy))
2492 (home-page "https://github.com/bodono/scs-python")
2493 (synopsis "Splitting conic solver")
2494 (description "This package provides a Python interface for the
2495SCS (Splitting conic solver) library.")
2496 (license license:expat)))
2497
2498(define-public python-statannot
2499 (package
2500 (name "python-statannot")
2501 (version "0.2.3")
2502 (source
2503 (origin
2504 (method url-fetch)
2505 (uri (pypi-uri "statannot" version))
2506 (sha256
2507 (base32
2508 "1f8c2sylzr7lpjbyqxsqlp9xi8rj3d8c9hfh98x4jbb83zxc4026"))))
2509 (build-system python-build-system)
2510 (propagated-inputs
2511 (list python-numpy python-seaborn python-matplotlib python-pandas
2512 python-scipy))
2513 (home-page
2514 "https://github.com/webermarcolivier/statannot")
2515 (synopsis "Add annotations to existing plots generated by seaborn")
2516 (description
2517 "This is a Python package to compute statistical test and add statistical
2518annotations on an existing boxplots and barplots generated by seaborn.")
2519 (license license:expat)))
2520
2521(define-public python-unyt
2522 (package
2523 (name "python-unyt")
2524 (version "3.0.3")
2525 (source
2526 (origin
2527 (method url-fetch)
2528 (uri (pypi-uri "unyt" version))
2529 (sha256
2530 (base32 "0jrq2vhan2h280h6cw1sm5hys2nzmf19w4py64k3nrkc320z9mni"))))
2531 (build-system pyproject-build-system)
2532 ;; Pint is optional, but we do not propagate it due to its size.
2533 (native-inputs
2534 (list python-pint
2535 python-pytest
2536 python-setuptools
2537 python-setuptools-scm
2538 python-wheel))
2539 ;; Astropy is an optional import, but we do not include it as it creates a
2540 ;; module cycle: astronomy->python-science->astronomy.
2541 (propagated-inputs
2542 (list python-h5py ; optional import
2543 python-matplotlib ; optional import
2544 python-numpy
2545 python-sympy))
2546 (home-page "https://unyt.readthedocs.io")
2547 (synopsis "Library for working with data that has physical units")
2548 (description
2549 "@code{unyt} is a Python library working with data that has physical
2550units. It defines the @code{unyt.array.unyt_array} and
2551@code{unyt.array.unyt_quantity} classes (subclasses of NumPy’s ndarray class)
2552for handling arrays and scalars with units,respectively")
2553 (license license:bsd-3)))
2554
2555(define-public python-upsetplot
2556 (package
2557 (name "python-upsetplot")
2558 (version "0.9.0")
2559 (source
2560 (origin
2561 (method url-fetch)
2562 (uri (pypi-uri "UpSetPlot" version))
2563 (sha256
2564 (base32
2565 "14l5gcj88cclkj1mf74bcy1pxq1hgsiy27fa3vxrsk32ik1nmdwm"))))
2566 (build-system pyproject-build-system)
2567 (propagated-inputs
2568 (list python-matplotlib python-pandas))
2569 (native-inputs
2570 (list python-pytest-runner python-pytest-cov
2571 python-setuptools python-wheel))
2572 (home-page "https://upsetplot.readthedocs.io")
2573 (synopsis "Draw UpSet plots with Pandas and Matplotlib")
2574 (description
2575 "This is a Python implementation of UpSet plots by Lex et al.
2576UpSet plots are used to visualize set overlaps; like Venn diagrams but more
2577readable.")
2578 (license license:bsd-3)))
2579
2580(define-public python-vedo
2581 (package
2582 (name "python-vedo")
2583 (version "2022.2.0")
2584 (source
2585 (origin
2586 (method git-fetch)
2587 (uri (git-reference
2588 (url "https://github.com/marcomusy/vedo")
2589 (commit (string-append "v" version))))
2590 (file-name (git-file-name name version))
2591 (sha256
2592 (base32
2593 "1hhv4xc4bphhd1zrnf7r6fpf65xvkdqmb1lh51qg1xpv91h2az0h"))))
2594 (build-system python-build-system)
2595 (arguments
2596 `(#:phases
2597 (modify-phases %standard-phases
2598 (add-after 'unpack 'fix-tests
2599 ;; These tests require online data.
2600 (lambda _
2601 (substitute* "tests/common/test_actors.py"
2602 (("^st = .*") "")
2603 (("^assert isinstance\\(st\\.GetTexture\\(\\), .*") ""))
2604 (delete-file "tests/common/test_pyplot.py")))
2605 (add-after 'build 'mpi-setup
2606 ,%openmpi-setup)
2607 (replace 'check
2608 (lambda* (#:key tests? inputs outputs #:allow-other-keys)
2609 (when tests?
2610 (setenv "HOME" (getcwd))
2611 (add-installed-pythonpath inputs outputs)
2612 (with-directory-excursion "tests"
2613 (for-each (lambda (dir)
2614 (with-directory-excursion dir
2615 (invoke "./run_all.sh")))
2616 '("common" "dolfin"))))))
2617 ;; Disable the sanity check, which fails with the following error:
2618 ;;
2619 ;; ...checking requirements: ERROR: vedo==2022.2.0 DistributionNotFound(Requirement.parse('vtk<9.1.0'), {'vedo'})
2620 (delete 'sanity-check))))
2621 (native-inputs
2622 (list pkg-config
2623 python-pkgconfig))
2624 (propagated-inputs
2625 (list fenics
2626 python-deprecated
2627 python-matplotlib
2628 python-numpy
2629 vtk))
2630 (home-page "https://github.com/marcomusy/vedo")
2631 (synopsis
2632 "Analysis and visualization of 3D objects and point clouds")
2633 (description
2634 "@code{vedo} is a fast and lightweight python module for
2635scientific analysis and visualization. The package provides a wide
2636range of functionalities for working with three-dimensional meshes and
2637point clouds. It can also be used to generate high quality
2638two-dimensional renderings such as scatter plots and histograms.
2639@code{vedo} is based on @code{vtk} and @code{numpy}.")
2640 ;; vedo is released under the Expat license. Included fonts are
2641 ;; covered by the OFL license and textures by the CC0 license.
2642 ;; The earth images are in the public domain.
2643 (license (list license:expat
2644 license:silofl1.1
2645 license:cc0
2646 license:public-domain))))
2647
2648(define-public python-pandas-flavor
2649 (package
2650 (name "python-pandas-flavor")
2651 (version "0.5.0")
2652 (source
2653 (origin
2654 (method url-fetch)
2655 (uri (pypi-uri "pandas_flavor" version))
2656 (sha256
2657 (base32
2658 "0473lkbdnsag3w5x65sxwjlyq0i7z938ssxqwn2cpcml282vksx1"))))
2659 (build-system python-build-system)
2660 (propagated-inputs
2661 (list python-lazy-loader python-packaging python-pandas python-xarray))
2662 (home-page "https://github.com/pyjanitor-devs/pandas_flavor")
2663 (synopsis "Write your own flavor of Pandas")
2664 (description "Pandas 0.23 added a simple API for registering accessors
2665with Pandas objects. Pandas-flavor extends Pandas' extension API by
2666
2667@itemize
2668@item adding support for registering methods as well
2669@item making each of these functions backwards compatible with older versions
2670of Pandas
2671@end itemize")
2672 (license license:expat)))
2673
2674(define-public python-pingouin
2675 (package
2676 (name "python-pingouin")
2677 (version "0.5.4")
2678 (source
2679 ;; The PyPI tarball does not contain the tests.
2680 (origin
2681 (method git-fetch)
2682 (uri (git-reference
2683 (url "https://github.com/raphaelvallat/pingouin")
2684 (commit (string-append "v" version))))
2685 (file-name (git-file-name name version))
2686 (sha256
2687 (base32
2688 "1j3qkgvyc31604ddl952h4hwza7schg8kwkycmxvpvx7xjj7nn68"))))
2689 (build-system pyproject-build-system)
2690 (arguments
2691 (list
2692 #:test-flags
2693 ;; This one fails due to minor differences in accuracy
2694 '(list "-k" "not test_logistic_regression")
2695 #:phases
2696 '(modify-phases %standard-phases
2697 (add-after 'unpack 'loosen-requirements
2698 (lambda _
2699 (substitute* '("requirements.txt" "setup.py")
2700 ;; Remove sklearn pinning since it works fine with 1.1.2:
2701 ;; https://github.com/raphaelvallat/pingouin/pull/300
2702 (("scikit-learn<1\\.1\\.0")
2703 "scikit-learn"))))
2704 ;; On loading, Pingouin uses the outdated package to check if a newer
2705 ;; version is available on PyPI. This check adds an extra dependency
2706 ;; and is irrelevant to Guix users. So, disable it.
2707 (add-after 'unpack 'remove-outdated-check
2708 (lambda _
2709 (substitute* "setup.py"
2710 (("\"outdated\",") ""))
2711 (substitute* "pingouin/__init__.py"
2712 (("^from outdated[^\n]*") "")
2713 (("^warn_if_outdated[^\n]*") ""))))
2714 (add-after 'unpack 'sklearn-compatibility
2715 (lambda _
2716 (substitute* "pingouin/regression.py"
2717 (("kwargs\\[\"penalty\"\\] = \"none\"")
2718 "kwargs[\"penalty\"] = None")))))))
2719 (native-inputs
2720 (list python-pytest python-pytest-cov))
2721 (propagated-inputs
2722 (list python-matplotlib
2723 python-mpmath
2724 python-numpy
2725 python-pandas
2726 python-pandas-flavor
2727 python-scikit-learn
2728 python-scipy
2729 python-seaborn
2730 python-statsmodels
2731 python-tabulate))
2732 (home-page "https://pingouin-stats.org/")
2733 (synopsis "Statistical package for Python")
2734 (description "Pingouin is a statistical package written in Python 3 and
2735based mostly on Pandas and NumPy. Its features include
2736
2737@itemize
2738@item ANOVAs: N-ways, repeated measures, mixed, ancova
2739@item Pairwise post-hocs tests (parametric and non-parametric) and pairwise
2740correlations
2741@item Robust, partial, distance and repeated measures correlations
2742@item Linear/logistic regression and mediation analysis
2743@item Bayes Factors
2744@item Multivariate tests
2745@item Reliability and consistency
2746@item Effect sizes and power analysis
2747@item Parametric/bootstrapped confidence intervals around an effect size or a
2748correlation coefficient
2749@item Circular statistics
2750@item Chi-squared tests
2751@item Plotting: Bland-Altman plot, Q-Q plot, paired plot, robust correlation,
2752and more
2753@end itemize")
2754 (license license:gpl3)))
2755
2756(define-public python-pyglm
2757 (package
2758 (name "python-pyglm")
2759 (version "2.5.7")
2760 (source
2761 (origin
2762 ;; Test files are not included in the archive in pypi.
2763 (method git-fetch)
2764 (uri (git-reference
2765 (url "https://github.com/Zuzu-Typ/PyGLM")
2766 (commit version)
2767 ;; Checkout the bundled `glm` submodule. PyGLM uses the
2768 ;; currently unreleased GLM_EXT_matrix_integer feature. Can
2769 ;; maybe unbundle once [email protected] is released.
2770 (recursive? #t)))
2771 (file-name (git-file-name name version))
2772 (sha256
2773 (base32
2774 "08v0cgkwsf8rxscx5g9c5p1dy38rvak2fy3q6hg985if1nj6d9ks"))))
2775 (build-system python-build-system)
2776 (home-page "https://github.com/Zuzu-Typ/PyGLM")
2777 (synopsis "OpenGL Mathematics library for Python")
2778 (description "PyGLM is a Python extension library which brings the OpenGL
2779Mathematics (GLM) library to Python.")
2780 (license license:zlib)))
2781
2782(define-public python-dask-expr
2783 (package
2784 (name "python-dask-expr")
2785 (version "1.0.14")
2786 (source
2787 (origin
2788 (method git-fetch)
2789 (uri (git-reference
2790 (url "https://github.com/dask/dask-expr")
2791 (commit (string-append "v" version))))
2792 (file-name (git-file-name name version))
2793 (sha256
2794 (base32 "0c2q8w8wl5d2hycbjp9vavkl5f36kaz390wxlis2d8d43jnqhf0d"))))
2795 (build-system pyproject-build-system)
2796 (arguments
2797 (list
2798 #:tests? #false ;need python-distributed, which needs dask-expr.
2799 #:phases
2800 #~(modify-phases %standard-phases
2801 (add-after 'unpack 'versioneer
2802 (lambda _
2803 ;; Our version of versioneer needs setup.cfg. This is adapted
2804 ;; from pyproject.toml.
2805 (with-output-to-file "setup.cfg"
2806 (lambda ()
2807 (display "\
2808[versioneer]
2809VCS = git
2810style = pep440
2811versionfile_source = dask_expr/_version.py
2812versionfile_build = dask_expr/_version.py
2813tag_prefix =
2814parentdir_prefix = dask_expr-
2815")))
2816 (invoke "versioneer" "install")
2817 (substitute* "setup.py"
2818 (("versioneer.get_version\\(\\)")
2819 (string-append "\"" #$version "\""))))))))
2820 (propagated-inputs (list python-pandas python-pyarrow))
2821 (native-inputs
2822 ;; We use python-dask/bootstrap so that python-dask can propagate this
2823 ;; package without creating a mutually recursive dependency.
2824 (list python-dask/bootstrap
2825 python-pytest
2826 python-setuptools
2827 python-versioneer
2828 python-wheel))
2829 (home-page "https://github.com/dask/dask-expr")
2830 (synopsis "Dask DataFrames with query optimization")
2831 (description "This is a rewrite of Dask DataFrame that includes query
2832optimization and generally improved organization.")
2833 (license license:bsd-3)))
2834
2835(define-public python-distributed
2836 (package
2837 (name "python-distributed")
2838 (version "2024.4.2")
2839 (source
2840 (origin
2841 ;; The test files are not included in the archive on pypi
2842 (method git-fetch)
2843 (uri (git-reference
2844 (url "https://github.com/dask/distributed")
2845 (commit version)))
2846 (file-name (git-file-name name version))
2847 (sha256
2848 (base32
2849 "0sy9mqa8qlxsagbz8xn304csrlxhxj4b6k84yrjxdcmkp9pkx166"))))
2850 (build-system pyproject-build-system)
2851 (arguments
2852 (list
2853 #:test-flags
2854 '(list "-m"
2855 (string-append "not slow"
2856 " and not flaky"
2857 " and not gpu"
2858 " and not ipython"
2859 " and not avoid_ci")
2860 "-k"
2861 (string-append
2862 ;; These fail because they require network access,
2863 ;; specifically access to 8.8.8.8.
2864 "not "
2865 (string-join
2866 (list
2867 "TestClientSecurityLoader.test_security_loader"
2868 "test_BatchedSend"
2869 "test_allowed_failures_config"
2870 "test_async_context_manager"
2871 "test_async_with"
2872 "test_client_repr_closed_sync"
2873 "test_client_is_quiet_cluster_close"
2874 "test_close_closed"
2875 "test_close_fast_without_active_handlers"
2876 "test_close_grace_period_for_handlers"
2877 "test_close_loop_sync"
2878 "test_close_properly"
2879 "test_close_twice"
2880 "test_compression"
2881 "test_connection_pool"
2882 "test_connection_pool_close_while_connecting"
2883 "test_connection_pool_detects_remote_close"
2884 "test_connection_pool_outside_cancellation"
2885 "test_connection_pool_remove"
2886 "test_connection_pool_respects_limit"
2887 "test_connection_pool_tls"
2888 "test_counters"
2889 "test_dashboard_host"
2890 "test_dashboard_link_cluster"
2891 "test_dashboard_link_inproc"
2892 "test_deserialize_error"
2893 "test_dont_override_default_get"
2894 "test_ensure_no_new_clients"
2895 "test_errors"
2896 "test_fail_to_pickle_target_2"
2897 "test_failure_doesnt_crash"
2898 "test_file_descriptors_dont_leak"
2899 "test_finished"
2900 "test_freeze_batched_send"
2901 "test_get_client_functions_spawn_clusters"
2902 "test_host_uses_scheduler_protocol"
2903 "test_identity_inproc"
2904 "test_identity_tcp"
2905 "test_large_packets_inproc"
2906 "test_locked_comm_drop_in_replacement"
2907 "test_locked_comm_intercept_read"
2908 "test_locked_comm_intercept_write"
2909 "test_messages_are_ordered_bsend"
2910 "test_messages_are_ordered_raw"
2911 "test_mixing_clients_different_scheduler"
2912 "test_multiple_listeners"
2913 "test_no_dangling_asyncio_tasks"
2914 "test_plugin_exception"
2915 "test_plugin_internal_exception"
2916 "test_plugin_multiple_exceptions"
2917 "test_ports"
2918 "test_preload_import_time"
2919 "test_preload_manager_sequence"
2920 "test_queue_in_task"
2921 "test_quiet_client_close"
2922 "test_rebalance_sync"
2923 "test_repr_localcluster"
2924 "test_require_encryption"
2925 "test_rpc_default"
2926 "test_rpc_inproc"
2927 "test_rpc_message_lifetime_default"
2928 "test_rpc_message_lifetime_inproc"
2929 "test_rpc_message_lifetime_tcp"
2930 "test_rpc_serialization"
2931 "test_rpc_tcp"
2932 "test_rpc_tls"
2933 "test_rpc_with_many_connections_inproc"
2934 "test_rpc_with_many_connections_tcp"
2935 "test_scheduler_file"
2936 "test_security_dict_input_no_security"
2937 "test_security_loader"
2938 "test_security_loader_ignored_if_explicit_security_provided"
2939 "test_security_loader_ignored_if_returns_none"
2940 "test_send_after_stream_start"
2941 "test_send_before_close"
2942 "test_send_before_start"
2943 "test_send_recv_args"
2944 "test_send_recv_cancelled"
2945 "test_sending_traffic_jam"
2946 "test_serializers"
2947 "test_server"
2948 "test_server_comms_mark_active_handlers"
2949 "test_shutdown"
2950 "test_shutdown_localcluster"
2951 "test_teardown_failure_doesnt_crash_scheduler"
2952 "test_tell_workers_when_peers_have_left"
2953 "test_threadpoolworkers_pick_correct_ioloop"
2954 "test_tls_listen_connect"
2955 "test_tls_temporary_credentials_functional"
2956 "test_variable_in_task"
2957 "test_worker_preload_text"
2958 "test_worker_uses_same_host_as_nanny"
2959 "test_nanny_timeout") ; access to 127.0.0.1
2960 " and not ")
2961
2962 ;; This seems to want to use 64GB of memory.
2963 " and not test_computation_object_code_dask_compute"
2964
2965 ;; These fail because it doesn't find dask[distributed]
2966 " and not test_quiet_close_process"
2967
2968 ;; There is no distributed.__git_revision__ property.
2969 " and not test_git_revision"
2970
2971 ;; The system monitor did not return a dictionary containing
2972 ;; "host_disk_io.read_bps".
2973 " and not test_disk_config"
2974
2975 ;; These fail because the exception text format
2976 ;; appears to have changed.
2977 " and not test_exception_text"
2978 " and not test_worker_bad_args"
2979
2980 ;; These time out
2981 " and not test_nanny_timeout"
2982
2983 ;; These tests are rather flaky
2984 " and not test_quiet_quit_when_cluster_leaves"
2985 " and not multiple_clients_restart"
2986 " and not test_steal_twice"
2987 " and not test_task_groups_update_start_stop"
2988 " and not test_web_preload"
2989 " and not test_web_preload_worker"))
2990 #:phases
2991 #~(modify-phases %standard-phases
2992 (add-after 'unpack 'versioneer
2993 (lambda _
2994 ;; Our version of versioneer needs setup.cfg. This is adapted
2995 ;; from pyproject.toml.
2996 (with-output-to-file "setup.cfg"
2997 (lambda ()
2998 (display "\
2999[versioneer]
3000VCS = git
3001style = pep440
3002versionfile_source = distributed/_version.py
3003versionfile_build = distributed/_version.py
3004tag_prefix =
3005parentdir_prefix = distributed-
3006")))
3007 (invoke "versioneer" "install")
3008 (substitute* "setup.py"
3009 (("versioneer.get_version\\(\\)")
3010 (string-append "\"" #$version "\"")))))
3011 (add-after 'unpack 'fix-pytest-config
3012 (lambda _
3013 ;; This option is not supported by our version of pytest.
3014 (substitute* "pyproject.toml"
3015 (("--cov-config=pyproject.toml.*") ""))))
3016 (add-after 'unpack 'fix-references
3017 (lambda* (#:key outputs #:allow-other-keys)
3018 (substitute* '("distributed/comm/tests/test_ucx_config.py"
3019 "distributed/tests/test_client.py"
3020 "distributed/tests/test_queues.py"
3021 "distributed/tests/test_variable.py"
3022 "distributed/cli/tests/test_tls_cli.py"
3023 "distributed/cli/tests/test_dask_spec.py"
3024 "distributed/cli/tests/test_dask_worker.py"
3025 "distributed/cli/tests/test_dask_scheduler.py")
3026 (("\"dask-scheduler\"")
3027 (format #false "\"~a/bin/dask-scheduler\"" #$output))
3028 (("\"dask-worker\"")
3029 (format #false "\"~a/bin/dask-worker\"" #$output)))))
3030 (add-before 'check 'pre-check
3031 (lambda _
3032 (setenv "DISABLE_IPV6" "1")
3033 ;; Disable job queueing
3034 (setenv "DASK_DISTRIBUTED__SCHEDULER__WORKER_SATURATION" "inf")
3035 ;; Do not use dask-expr
3036 (setenv "DASK_DATAFRAME__QUERY_PLANNING" "False")
3037 ;; The integration tests are all problematic to some
3038 ;; degree. They either require network access or some
3039 ;; other setup. We only run the tests in
3040 ;; distributed/tests.
3041 (for-each (lambda (dir)
3042 (delete-file-recursively
3043 (string-append "distributed/" dir "/tests")))
3044 (list "cli" "comm" "dashboard" "deploy" "diagnostics"
3045 "http" "http/scheduler" "http/worker"
3046 "protocol" "shuffle"))))
3047 ;; We need to use "." here.
3048 (replace 'check
3049 (lambda* (#:key tests? test-flags #:allow-other-keys)
3050 (when tests?
3051 (apply invoke "python" "-m" "pytest" "." "-vv" test-flags)))))))
3052 (propagated-inputs
3053 (list python-click
3054 python-cloudpickle
3055 python-cryptography
3056 python-dask
3057 python-dask-expr
3058 python-msgpack
3059 python-psutil
3060 python-pyyaml
3061 python-setuptools
3062 python-sortedcontainers
3063 python-tblib
3064 python-toolz
3065 python-tornado-6
3066 python-urllib3
3067 python-zict))
3068 (native-inputs
3069 (list python-flaky
3070 python-importlib-metadata
3071 python-pytest
3072 python-pytest-timeout
3073 python-versioneer
3074 python-wheel))
3075 (home-page "https://distributed.dask.org")
3076 (synopsis "Distributed scheduler for Dask")
3077 (description "Dask.distributed is a lightweight library for distributed
3078computing in Python. It extends both the @code{concurrent.futures} and
3079@code{dask} APIs to moderate sized clusters.")
3080 (license license:bsd-3)))
3081
3082(define-public python-modin
3083 (package
3084 (name "python-modin")
3085 (version "0.32.0")
3086 (source
3087 (origin
3088 ;; The archive on pypi does not include all required files.
3089 (method git-fetch)
3090 (uri (git-reference
3091 (url "https://github.com/modin-project/modin")
3092 (commit version)))
3093 (file-name (git-file-name name version))
3094 (sha256
3095 (base32
3096 "1vb3iffgspryb6nvwiwdnypb922vkn2yvyzc1y0wwxcb0c0fl78d"))))
3097 (build-system pyproject-build-system)
3098 (arguments
3099 (list
3100 #:test-flags
3101 ;; These four tests fail because an expected error is not raised.
3102 '(list "-k" "not test_binary_bad_broadcast")
3103 #:phases
3104 '(modify-phases %standard-phases
3105 (add-after 'unpack 'loosen-requirements
3106 (lambda _
3107 (substitute* "setup.py"
3108 ;; Don't depend on a specific version of Pandas.
3109 (("pandas==") "pandas>="))))
3110 (replace 'check
3111 (lambda* (#:key tests? test-flags #:allow-other-keys)
3112 (when tests?
3113 (setenv "MODIN_ENGINE" "dask")
3114 (apply invoke "python" "-m" "pytest"
3115 "modin/tests/numpy" test-flags)
3116 (setenv "MODIN_ENGINE" "python")
3117 (apply invoke "python" "-m" "pytest"
3118 "modin/tests/numpy" test-flags)))))))
3119 (propagated-inputs
3120 (list python-cloudpickle
3121 python-dask
3122 python-distributed
3123 python-numpy
3124 python-packaging
3125 python-pandas
3126 python-s3fs))
3127 (native-inputs
3128 (list python-boto3
3129 python-coverage
3130 python-jinja2
3131 python-lxml
3132 python-matplotlib
3133 python-msgpack
3134 python-openpyxl
3135 python-psutil
3136 python-pyarrow
3137 python-pytest
3138 python-pytest-benchmark
3139 python-pytest-cov
3140 python-pytest-xdist
3141 python-scipy
3142 python-sqlalchemy
3143 python-tables
3144 python-tqdm
3145 python-xarray
3146 python-xlrd
3147 python-wheel))
3148 (home-page "https://github.com/modin-project/modin")
3149 (synopsis "Make your pandas code run faster")
3150 (description
3151 "Modin uses Ray or Dask to provide an effortless way to speed up your
3152pandas notebooks, scripts, and libraries. Unlike other distributed DataFrame
3153libraries, Modin provides seamless integration and compatibility with existing
3154pandas code.")
3155 (license license:asl2.0)))
3156
3157(define-public python-numpy-groupies
3158 (package
3159 (name "python-numpy-groupies")
3160 (version "0.9.14")
3161 (source
3162 (origin
3163 (method url-fetch)
3164 (uri (pypi-uri "numpy_groupies" version))
3165 (sha256
3166 (base32 "000qz0z78rs3l6y0dd2vzvd2lx3mczm2762whwsdnhz6c35axdq1"))))
3167 (build-system python-build-system)
3168 (native-inputs
3169 (list python-pytest
3170 python-pytest-runner
3171 python-numba
3172 python-numpy))
3173 (home-page "https://github.com/ml31415/numpy-groupies")
3174 (synopsis "Tools for group-indexing operations: aggregated sum and more")
3175 (description
3176 "This package provides optimized tools for group-indexing operations:
3177aggregated sum and more.")
3178 (license license:bsd-3)))
3179
3180(define-public python-plotnine
3181 (package
3182 (name "python-plotnine")
3183 (version "0.14.5")
3184 (source
3185 (origin
3186 (method git-fetch)
3187 (uri (git-reference
3188 (url "https://github.com/has2k1/plotnine")
3189 (commit (string-append "v" version))))
3190 (file-name (git-file-name name version))
3191 (sha256
3192 (base32 "02ph0h312qn5a9ivh2qhv0x9sybccgbidzvb8im1hikwcqp8v2fw"))))
3193 (build-system pyproject-build-system)
3194 (arguments
3195 (list
3196 #:test-flags
3197 ;; XXX: Check for any new failing tests during next update cycle.
3198 ;; These all fail because the images are considered to be too different,
3199 ;; though they really do look fine.
3200 ;; See https://github.com/has2k1/plotnine/issues/627
3201 `(list ,@(map (lambda (file) (string-append "--ignore=" file))
3202 (list "tests/test_aes.py"
3203 "tests/test_annotation_logticks.py"
3204 "tests/test_coords.py"
3205 "tests/test_facet_labelling.py"
3206 "tests/test_facets.py"
3207 "tests/test_geom_bar_col_histogram.py"
3208 "tests/test_geom_bin_2d.py"
3209 "tests/test_geom_boxplot.py"
3210 "tests/test_geom_count.py"
3211 "tests/test_geom_density_2d.py"
3212 "tests/test_geom_density.py"
3213 "tests/test_geom_dotplot.py"
3214 "tests/test_geom_freqpoly.py"
3215 "tests/test_geom_map.py"
3216 "tests/test_geom_path_line_step.py"
3217 "tests/test_geom_point.py"
3218 "tests/test_geom_raster.py"
3219 "tests/test_geom_rect_tile.py"
3220 "tests/test_geom_ribbon_area.py"
3221 "tests/test_geom_sina.py"
3222 "tests/test_geom_smooth.py"
3223 "tests/test_geom_text_label.py"
3224 "tests/test_geom_violin.py"
3225 "tests/test_layout.py"
3226 "tests/test_position.py"
3227 "tests/test_qplot.py"
3228 "tests/test_scale_internals.py"
3229 "tests/test_scale_labelling.py"
3230 "tests/test_stat_ecdf.py"
3231 "tests/test_stat_function.py"
3232 "tests/test_stat_summary.py"
3233 "tests/test_theme.py"))
3234 "-k"
3235 (string-append "not "
3236 (string-join
3237 (list
3238 ;; This triggers an unexpected but harmless
3239 ;; warning.
3240 "test_save_method"
3241 ;; This test fails to set the locale.
3242 "test_no_after_scale_warning"
3243 ;; Missing optional modules
3244 "test_non_linear_smooth"
3245 "test_non_linear_smooth_no_ci")
3246 " and not "
3247 'infix)))
3248 #:phases
3249 #~(modify-phases %standard-phases
3250 (add-before 'build 'pretend-version
3251 ;; The version string is usually derived via setuptools-scm, but
3252 ;; without the git metadata available, the version string is set to
3253 ;; '999'.
3254 (lambda _
3255 (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" #$version)))
3256 (add-before 'check 'pre-check
3257 (lambda* (#:key inputs outputs #:allow-other-keys)
3258 ;; The data files are referenced by the tests but they are not
3259 ;; installed.
3260 (copy-recursively "plotnine/data"
3261 (string-append (site-packages inputs
3262 outputs)
3263 "/plotnine/data"))
3264 (setenv "CI" "1") ;skip tests that are known to fail on CI.
3265 ;; Matplotlib needs to be able to write its configuration file
3266 ;; somewhere.
3267 (setenv "MPLCONFIGDIR" "/tmp")
3268 (setenv "TZ" "UTC")
3269 (setenv "TZDIR"
3270 (search-input-directory inputs "share/zoneinfo")))))))
3271 (propagated-inputs (list python-adjusttext
3272 python-matplotlib
3273 python-mizani
3274 python-numpy
3275 python-patsy
3276 python-scipy
3277 python-statsmodels))
3278 (native-inputs (list python-geopandas
3279 python-mock
3280 python-pandas
3281 python-pytest
3282 python-pytest-cov
3283 python-setuptools
3284 python-setuptools-scm
3285 python-wheel
3286 tzdata-for-tests))
3287 (home-page "https://github.com/has2k1/plotnine")
3288 (synopsis "Grammar of Graphics for Python")
3289 (description
3290 "Plotnine is a Python implementation of the Grammar of Graphics.
3291It is a powerful graphics concept for creating plots and visualizations in a
3292structured and declarative manner. It is inspired by the R package ggplot2
3293and aims to provide a similar API and functionality in Python.")
3294 (license license:expat)))
3295
3296(define-public python-pyvista
3297 (package
3298 (name "python-pyvista")
3299 (version "0.44.2")
3300 (source
3301 ;; The PyPI tarball does not contain the tests.
3302 (origin
3303 (method git-fetch)
3304 (uri (git-reference
3305 (url "https://github.com/pyvista/pyvista")
3306 (commit (string-append "v" version))))
3307 (file-name (git-file-name name version))
3308 (sha256
3309 (base32 "0lnh4cvf6wld7hm293015d80ny0vnsk96ckfvc2crzd1b79ch1v5"))))
3310 (build-system pyproject-build-system)
3311 (propagated-inputs
3312 (list python-imageio
3313 python-matplotlib
3314 python-meshio
3315 python-numpy
3316 python-pillow
3317 python-pooch
3318 python-scooby
3319 vtk))
3320 ;; packages needed for testing
3321 (native-inputs (list python-pytest
3322 python-scipy
3323 python-ipython
3324 python-trimesh
3325 python-tqdm))
3326 (arguments
3327 '(#:phases
3328 (modify-phases %standard-phases
3329 ;; vtk check fails in sanity-check, comment out
3330 (add-after 'unpack 'patch-pyproject
3331 (lambda _
3332 (substitute* "pyproject.toml"
3333 (("'vtk<9\\.4\\.0'," all) (string-append "#" all)))))
3334 (add-after 'unpack 'fix-failing-tests
3335 (lambda _
3336 (rename-file "tests/plotting/test_charts.py" "tests/plotting/_test_charts.py")
3337 (rename-file "tests/examples/test_download_files.py" "tests/examples/_test_download_files.py")
3338 (rename-file "tests/examples/test_downloads.py" "tests/examples/_test_downloads.py")
3339 (rename-file "tests/plotting/test_texture.py" "tests/plotting/_test_texture.py")
3340 (substitute* "tests/plotting/test_plotting.py"
3341 (("\"\"\"Determine if using mesa.\"\"\"" all)
3342 (string-append all "\n return False")))
3343 (substitute* "tests/test_meshio.py"
3344 (("cow = .*$" all) (string-append "#" all "\n"))
3345 ((", cow") ""))
3346 (substitute* "tests/core/test_dataset.py"
3347 (("test_partition") "_test_partition"))
3348 (substitute* "tests/core/test_composite.py"
3349 (("test_ensight_multi_block_io") "_test_ensight_multi_block_io"))
3350 (substitute* "tests/core/test_dataset_filters.py"
3351 (("test_connectivity_.*$" all) (string-append "_" all))
3352 (("test_compute_boundary_mesh_quality") "_test_compute_boundary_mesh_quality"))
3353 (substitute* "tests/core/test_polydata_filters.py"
3354 (("test_protein_ribbon") "_test_protein_ribbon"))
3355 (substitute* "tests/core/test_validation.py"
3356 (("test_cast_to_numpy_raises") "_test_cast_to_numpy_raises"))
3357 (substitute* "tests/plotting/test_actor.py"
3358 (("test_actor_texture") "_test_actor_texture"))
3359 (substitute* "tests/plotting/test_lookup_table.py"
3360 (("test_init_cmap") "_test_init_cmap")
3361 (("test_repr") "_test_repr"))
3362 (substitute* "tests/plotting/test_plotter.py"
3363 (("test_add_multiple") "_test_add_multiple")
3364 (("test_plot_return_img_without_cpos") "_test_plot_return_img_without_cpos")
3365 (("test_plot_return_img_with_cpos") "_test_plot_return_img_with_cpos")
3366 (("test_only_screenshots_flag") "_test_only_screenshots_flag"))
3367 (substitute* "tests/plotting/test_plotting_utilities.py"
3368 (("test_gif_reader") "_test_gif_reader"))
3369 (substitute* "tests/plotting/test_render_window_interactor.py"
3370 (("test_timer") "_test_timer")
3371 (("test_add_timer_event") "_test_add_timer_event")
3372 (("test_interpolate") "_test_interpolate"))
3373 (substitute* "tests/plotting/test_renderer.py"
3374 (("test_legend_.*$" all) (string-append "_" all)))
3375 (substitute* "tests/plotting/test_theme.py"
3376 (("test_box_axes") "_test_box_axes")
3377 (("test_load_theme") "_test_load_theme")
3378 (("test_save_before_close_callback") "_test_save_before_close_callback")
3379 (("test_user_logo") "_test_user_logo"))
3380 (substitute* "tests/core/test_geometric_sources.py"
3381 (("test_translate_direction_collinear") "_test_translate_direction_collinear"))
3382 (substitute* "tests/examples/test_dataset_loader.py"
3383 (("test_dataset_loader_one_file") "_test_dataset_loader_one_file")
3384 (("test_dataset_loader_two_files_one_loadable") "_test_dataset_loader_two_files_one_loadable")
3385 (("test_dataset_loader_two_files_both_loadable") "_test_dataset_loader_two_files_both_loadable")
3386 (("test_dataset_loader_cubemap") "_test_dataset_loader_cubemap")
3387 (("test_dataset_loader_dicom") "_test_dataset_loader_dicom")
3388 (("test_dataset_loader_from_nested_files_and_directory") "_test_dataset_loader_from_nested_files_and_directory")
3389 (("test_dataset_loader_from_nested_multiblock") "_test_dataset_loader_from_nested_multiblock")
3390 (("test_load_dataset_no_reader") "_test_load_dataset_no_reader"))
3391 (substitute* "tests/core/test_reader.py"
3392 (("test_ensightreader_arrays") "_test_ensightreader_arrays")
3393 (("test_ensightreader_timepoints") "_test_ensightreader_timepoints")
3394 (("test_ensightreader_time_sets") "_test_ensightreader_time_sets")
3395 (("test_dcmreader") "_test_dcmreader")
3396 (("test_objreader") "_test_objreader")
3397 (("test_stlreader") "_test_stlreader")
3398 (("test_tecplotreader") "_test_tecplotreader")
3399 (("test_byureader") "_test_byureader")
3400 (("test_facetreader") "_test_facetreader")
3401 (("test_plot3dmetareader") "_test_plot3dmetareader")
3402 (("test_multiblockplot3dreader") "_test_multiblockplot3dreader")
3403 (("test_binarymarchingcubesreader") "_test_binarymarchingcubesreader")
3404 (("test_pvdreader") "_test_pvdreader")
3405 (("test_pvdreader_no_time_group") "_test_pvdreader_no_time_group")
3406 (("test_pvdreader_no_part_group") "_test_pvdreader_no_part_group")
3407 (("test_openfoamreader_arrays_time") "_test_openfoamreader_arrays_time")
3408 (("test_openfoamreader_active_time") "_test_openfoamreader_active_time")
3409 (("test_openfoamreader_read_data_time_value") "_test_openfoamreader_read_data_time_value")
3410 (("test_openfoamreader_read_data_time_point") "_test_openfoamreader_read_data_time_point")
3411 (("test_openfoam_skip_zero_time") "_test_openfoam_skip_zero_time")
3412 (("test_openfoam_cell_to_point_default") "_test_openfoam_cell_to_point_default")
3413 (("test_openfoam_patch_arrays") "_test_openfoam_patch_arrays")
3414 (("test_openfoam_case_type") "_test_openfoam_case_type")
3415 (("test_read_cgns") "_test_read_cgns")
3416 (("test_bmpreader") "_test_bmpreader")
3417 (("test_demreader") "_test_demreader")
3418 (("test_jpegreader") "_test_jpegreader")
3419 (("test_meta_image_reader") "_test_meta_image_reader")
3420 (("test_nifti_reader") "_test_nifti_reader")
3421 (("test_nrrd_reader") "_test_nrrd_reader")
3422 (("test_png_reader") "_test_png_reader")
3423 (("test_pnm_reader") "_test_pnm_reader")
3424 (("test_slc_reader") "_test_slc_reader")
3425 (("test_tiff_reader") "_test_tiff_reader")
3426 (("test_hdr_reader") "_test_hdr_reader")
3427 (("test_avsucd_reader") "_test_avsucd_reader")
3428 (("test_hdf_reader") "_test_hdf_reader")
3429 (("test_xdmf_reader") "_test_xdmf_reader")
3430 (("test_fluentcffreader") "_test_fluentcffreader")
3431 (("test_gambitreader") "_test_gambitreader")
3432 (("test_gaussian_cubes_reader") "_test_gaussian_cubes_reader")
3433 (("test_gesignareader") "_test_gesignareader")
3434 (("test_pdbreader") "_test_pdbreader")
3435 (("test_particle_reader") "_test_particle_reader")
3436 (("test_prostar_reader") "_test_prostar_reader"))))
3437 ;; test phase writes files to $HOME
3438 (add-before 'check 'redirect-HOME
3439 (lambda _
3440 (setenv "HOME" "/tmp"))))))
3441 (home-page "https://docs.pyvista.org/")
3442 (synopsis "3D plotting and mesh analysis through VTK")
3443 (description
3444 "PyVista is...
3445
3446@itemize
3447@item @emph{Pythonic VTK}: a high-level API to the Visualization
3448Toolkit (VTK);
3449@item mesh data structures and filtering methods for spatial datasets;
3450@item 3D plotting made simple and built for large/complex data geometries.
3451@end itemize
3452
3453This package provides a Pythonic, well-documented interface exposing VTK's
3454powerful visualization backend to facilitate rapid prototyping, analysis, and
3455visual integration of spatially referenced datasets.")
3456 (license license:expat)))
3457
3458(define-public python-simplespectral
3459 (package
3460 (name "python-simplespectral")
3461 (version "1.0.0")
3462 (source
3463 (origin
3464 (method url-fetch)
3465 (uri (pypi-uri "SimpleSpectral" version))
3466 (sha256
3467 (base32 "0qh3xwdv9cwcqdamvglrhm586p4yaq1hd291py1fvykhk2a2d4w6"))))
3468 (build-system python-build-system)
3469 (propagated-inputs
3470 (list python-numpy python-scipy))
3471 (home-page "https://github.com/xmikos/simplespectral")
3472 (synopsis "FFT module for Python")
3473 (description
3474 "This package provides a simplified @code{scipy.signal.spectral} module
3475to do spectral analysis in Python.")
3476 (license license:expat)))
3477
3478(define-public python-traittypes
3479 (package
3480 (name "python-traittypes")
3481 (version "0.2.1")
3482 (source
3483 (origin
3484 (method url-fetch)
3485 (uri (pypi-uri "traittypes" version))
3486 (sha256
3487 (base32 "1mlv93irdrgxrhnhq3ksi9585d55bpi4mv9dha4p8gkkjiia4vxy"))))
3488 (build-system pyproject-build-system)
3489 (arguments
3490 (list
3491 ;; This one test fails because it doesn't raise an expected exception.
3492 #:test-flags '(list "-k" "not test_bad_values")
3493 #:phases
3494 '(modify-phases %standard-phases
3495 (add-after 'unpack 'numpy-compatibility
3496 (lambda _
3497 (substitute* "traittypes/tests/test_traittypes.py"
3498 (("np\\.int") "int")))))))
3499 (propagated-inputs (list python-traitlets))
3500 (native-inputs
3501 (list python-numpy
3502 python-pandas
3503 python-nose
3504 python-pytest
3505 python-setuptools
3506 python-xarray
3507 python-wheel))
3508 (home-page "https://github.com/jupyter-widgets/traittypes")
3509 (synopsis "Trait types for NumPy, SciPy and friends")
3510 (description "The goal of this package is to provide a reference
3511implementation of trait types for common data structures used in the scipy
3512stack such as numpy arrays or pandas and xarray data structures. These are
3513out of the scope of the main traitlets project but are a common requirement to
3514build applications with traitlets in combination with the scipy stack.")
3515 (license license:bsd-3)))
3516
3517(define-public python-aplus
3518 (package
3519 (name "python-aplus")
3520 (version "0.11.0")
3521 (source
3522 (origin
3523 (method url-fetch)
3524 (uri (pypi-uri "aplus" version))
3525 (sha256
3526 (base32 "1rznc26nlp641rn8gpdngfp79a3fji38yavqakxi35mx2da04msg"))))
3527 (build-system python-build-system)
3528 (home-page "https://github.com/xogeny/aplus")
3529 (synopsis "Promises/A+ for Python")
3530 (description "This package is an implementation of the Promises/A+
3531specification and test suite in Python.")
3532 (license license:expat)))
3533
3534(define-public python-clarabel
3535 (package
3536 (name "python-clarabel")
3537 (version "0.7.1")
3538 (source
3539 (origin
3540 (method url-fetch)
3541 (uri (pypi-uri "clarabel" version))
3542 (sha256
3543 (base32 "15k32ynvh45n9q905bxwamh5w5cia9bxzmwz69wbribmyhsv22m3"))
3544 (patches
3545 (search-patches "python-clarabel-blas.patch"))))
3546 (build-system cargo-build-system)
3547 (arguments
3548 (list
3549 #:imported-modules `(,@%cargo-build-system-modules
3550 ,@%pyproject-build-system-modules)
3551 #:modules '((guix build cargo-build-system)
3552 ((guix build pyproject-build-system) #:prefix py:)
3553 (guix build utils))
3554 #:phases
3555 #~(modify-phases %standard-phases
3556 (add-after 'build 'build-python-module
3557 (assoc-ref py:%standard-phases 'build))
3558 (add-after 'build-python-module 'install-python-module
3559 (assoc-ref py:%standard-phases 'install)))
3560 #:cargo-inputs
3561 `(("rust-amd" ,rust-amd-0.2)
3562 ("rust-blas" ,rust-blas-0.22)
3563 ("rust-cfg-if" ,rust-cfg-if-1)
3564 ("rust-derive-builder" ,rust-derive-builder-0.11)
3565 ("rust-enum-dispatch" ,rust-enum-dispatch-0.3) ;0.3.8
3566 ("rust-itertools" ,rust-itertools-0.11)
3567 ("rust-lapack" ,rust-lapack-0.19)
3568 ("rust-lazy-static" ,rust-lazy-static-1) ;1.4
3569 ("rust-libc" ,rust-libc-0.2)
3570 ("rust-num-derive" ,rust-num-derive-0.2)
3571 ("rust-num-traits" ,rust-num-traits-0.2)
3572 ("rust-pyo3" ,rust-pyo3-0.20)
3573 ("rust-serde" ,rust-serde-1)
3574 ("rust-serde-json" ,rust-serde-json-1)
3575 ("rust-thiserror" ,rust-thiserror-1))
3576 #:features '(list "python")
3577 #:install-source? #false))
3578 (inputs
3579 (list maturin))
3580 (native-inputs
3581 (list python-wrapper))
3582 (propagated-inputs (list python-numpy python-scipy))
3583 (home-page "https://github.com/oxfordcontrol/Clarabel.rs")
3584 (synopsis "Interior-point solver for convex conic optimisation problems")
3585 (description "Clarabel.rs is a Rust implementation of an interior point
3586numerical solver for convex optimization problems using a novel homogeneous
3587embedding.")
3588 (license license:asl2.0)))
3589
3590(define-public python-climin
3591 (package
3592 (name "python-climin")
3593 (version "0.1a1")
3594 (source (origin
3595 (method url-fetch)
3596 (uri (pypi-uri "climin" version))
3597 (sha256
3598 (base32
3599 "1wpjisd5zzi5yvjff02hnxn84822k8sdxvvd33lil2x79wdb36rv"))))
3600 (build-system python-build-system)
3601 (native-inputs (list python-nose))
3602 (propagated-inputs (list python-numpydoc python-numpy python-scipy))
3603 (home-page "https://github.com/BRML/climin")
3604 (synopsis "Optimization for machine learning")
3605 (description
3606 "@command{climin} is a Python package for optimization,
3607heavily biased to machine learning scenarios. It works on top of
3608@command{numpy} and (partially) @command{gnumpy}.")
3609 (license license:bsd-3)))
3610
3611(define-public python-corner
3612 (package
3613 (name "python-corner")
3614 (version "2.2.2")
3615 (source
3616 (origin
3617 (method git-fetch) ;no tests in PyPi archive
3618 (uri (git-reference
3619 (url "https://github.com/dfm/corner.py")
3620 (commit (string-append "v" version))))
3621 (file-name (git-file-name name version))
3622 (sha256
3623 (base32 "1i4dk4jxh0saysya2cnsfwlxwpldbdl174i9pwi4qj82av9jr2ii"))))
3624 (build-system pyproject-build-system)
3625 (arguments
3626 (list
3627 #:test-flags
3628 #~(list
3629 ;; XXX: Disable tests which failed with mismatched images, check why.
3630 "-k" (string-append "not test_labels[png]"
3631 " and not test_title_quantiles[png]"
3632 " and not test_title_quantiles_default[png]"
3633 " and not test_title_quantiles_raises[png]"
3634 " and not test_bins[png]"
3635 " and not test_bins_log[png]"
3636 " and not test_titles1[png]"
3637 " and not test_titles2[png]"
3638 " and not test_pandas[png]"
3639 " and not test_tight[png]"
3640 " and not test_extended_overplotting[png]"
3641 " and not test_reverse_overplotting[png]"
3642 " and not test_arviz[png]"
3643 " and not test_range_fig_arg[png]"))
3644 #:phases
3645 #~(modify-phases %standard-phases
3646 (add-before 'build 'pretend-version
3647 ;; XXX: Make sure you're either building from a fully intact git
3648 ;; repository or PyPI tarballs. Most other sources (such as GitHub's
3649 ;; tarballs, a git checkout without the .git folder) don't contain
3650 ;; the necessary metadata and will not work.
3651 (lambda _
3652 (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" #$version))))))
3653 (propagated-inputs
3654 (list python-matplotlib))
3655 (native-inputs
3656 (list python-arviz python-pytest python-scipy python-setuptools-scm))
3657 (home-page "http://corner.readthedocs.io/")
3658 (synopsis "Make some beautiful corner plots")
3659 (description
3660 "This Python module uses @code{matplotlib} to visualize multidimensional
3661samples using a scatterplot matrix. In these visualizations, each one- and
3662two-dimensional projection of the sample is plotted to reveal covariances.
3663corner was originally conceived to display the results of Markov Chain Monte
3664Carlo simulations and the defaults are chosen with this application in mind but
3665it can be used for displaying many qualitatively different samples.")
3666 (license license:bsd-2)))
3667
3668(define-public python-paramz
3669 (package
3670 (name "python-paramz")
3671 (version "0.9.6")
3672 (source (origin
3673 (method git-fetch)
3674 (uri (git-reference
3675 (url "https://github.com/sods/paramz")
3676 (commit (string-append "v" version))))
3677 (file-name (git-file-name name version))
3678 (sha256
3679 (base32
3680 "1ywc2jzj40m6wmq227j3snxvp4434s0m1xk1abg6v6mr87pv2sa9"))))
3681 (build-system pyproject-build-system)
3682 (native-inputs
3683 (list python-nose
3684 python-setuptools
3685 python-wheel))
3686 (propagated-inputs
3687 (list python-decorator
3688 python-numpy
3689 python-scipy
3690 python-six))
3691 (home-page "https://github.com/sods/paramz")
3692 (synopsis "The Parameterization Framework")
3693 (description
3694 "@command{paramz} is a lightweight parameterization framework
3695for parameterized model creation and handling. Its features include:
3696
3697@itemize
3698 @item Easy model creation with parameters.
3699 @item Fast optimized access of parameters for optimization routines.
3700 @item Memory efficient storage of parameters (only one copy in memory).
3701 @item Renaming of parameters.
3702 @item Intuitive printing of models and parameters.
3703 @item Gradient saving directly inside parameters.
3704 @item Gradient checking of parameters.
3705 @item Optimization of parameters.
3706 @item Jupyter notebook integration.
3707 @item Efficient storage of models, for reloading.
3708 @item Efficient caching.
3709@end itemize")
3710 (license license:bsd-3)))
3711
3712(define-public python-gpy
3713 (package
3714 (name "python-gpy")
3715 (version "1.13.1")
3716 (source (origin
3717 (method url-fetch)
3718 (uri (pypi-uri "GPy" version))
3719 (sha256
3720 (base32
3721 "05d1ry4jpp0srsrmp3qd6s0p2bjc4c0z99450pzdr79vagbfvlk4"))))
3722 (build-system pyproject-build-system)
3723 (arguments
3724 (list
3725 #:phases
3726 '(modify-phases %standard-phases
3727 (add-after 'unpack 'compatibility
3728 (lambda _
3729 ;; This file uses Python 2 statements
3730 (delete-file "GPy/testing/mpi_test__.py")
3731 (substitute* "setup.py"
3732 (("scipy>=1.3.0,<1.12.0")
3733 "scipy>=1.3.0,<=1.13.0"))
3734 ;; Use numpy.exp because scipy.ext no longer exists
3735 (substitute* "GPy/kern/src/sde_standard_periodic.py"
3736 (("sp\\.exp") "np.exp"))
3737 (substitute* "GPy/kern/src/sde_stationary.py"
3738 (("sp\\.poly1d") "np.poly1d")
3739 (("sp\\.roots") "np.roots")))))))
3740 (native-inputs
3741 (list python-cython python-matplotlib python-pods python-pytest))
3742 (propagated-inputs
3743 (list python-numpy python-paramz python-scipy python-six))
3744 (home-page "https://sheffieldml.github.io/GPy/")
3745 (synopsis "The Gaussian Process Toolbox")
3746 (description
3747 "@command{GPy} is a Gaussian Process (GP) framework written in
3748Python, from the Sheffield machine learning group. GPy implements a range of
3749machine learning algorithms based on GPs.")
3750 (license license:bsd-3)))
3751
3752(define-public python-pods
3753 (package
3754 (name "python-pods")
3755 (version "0.1.17")
3756 (source
3757 (origin
3758 (method url-fetch)
3759 (uri (pypi-uri "pods" version))
3760 (sha256
3761 (base32 "1z57jdwml2jzr2dq20p7pzx3ayhajgfd2d0xqjvgzx576hp2z1ac"))))
3762 (build-system pyproject-build-system)
3763 ;; Tests depend on Nose framework and try to download test data from
3764 ;; <https://github.com/SheffieldML/GPmat>.
3765 (arguments (list #:tests? #f))
3766 (native-inputs
3767 (list python-poetry-core))
3768 (propagated-inputs
3769 (list python-pandas
3770 python-pyyaml
3771 python-scipy
3772 python-tables))
3773 (home-page "https://github.com/lawrennd/ods")
3774 (synopsis "Python software for Open Data Science")
3775 (description "This package provides utilities and tools for open data
3776science including tools for accessing data sets in Python.")
3777 (license license:bsd-3)))
3778
3779(define-public python-pyfma
3780 (package
3781 (name "python-pyfma")
3782 (version "0.1.6")
3783 (source (origin
3784 (method git-fetch) ;for tests
3785 (uri (git-reference
3786 (url "https://github.com/nschloe/pyfma")
3787 (commit version)))
3788 (file-name (git-file-name name version))
3789 (sha256
3790 (base32
3791 "12i68jj9n1qj9phjnj6f0kmfhlsd3fqjlk9p6d4gs008azw5m8yn"))))
3792 (build-system pyproject-build-system)
3793 (propagated-inputs (list python-numpy))
3794 (native-inputs (list pybind11 python-pytest python-setuptools python-wheel))
3795 (home-page "https://github.com/nschloe/pyfma")
3796 (synopsis "Fused multiply-add for Python")
3797 (description "@code{pyfma} provides an implementation of fused
3798multiply-add which computes @code{(x*y) + z} with a single rounding.
3799This is useful for dot products, matrix multiplications, polynomial
3800evaluations (e.g., with Horner's rule), Newton's method for evaluating
3801functions, convolutions, artificial neural networks etc.")
3802 (license license:expat)))
3803
3804(define-public python-pydicom
3805 (package
3806 (name "python-pydicom")
3807 (version "2.4.4")
3808 (source (origin
3809 (method git-fetch)
3810 (uri (git-reference
3811 (url "https://github.com/pydicom/pydicom")
3812 (commit (string-append "v" version))))
3813 (file-name (git-file-name name version))
3814 (sha256
3815 (base32
3816 "0ksyyc1hbhyqy289a2frn84ss29fb7czirx3dkxx56f4ia33b4c8"))))
3817 (build-system pyproject-build-system)
3818 (arguments
3819 (list
3820 #:test-flags
3821 ;; Skip tests that require networking.
3822 #~(list "-k" (string-append
3823 "not test_jpeg_ls_pixel_data.py"
3824 " and not test_gdcm_pixel_data.py"
3825 " and not test_pillow_pixel_data.py"
3826 " and not test_rle_pixel_data.py"
3827 " and not Test_JPEG_LS_Lossless_transfer_syntax"
3828 " and not test_numpy_pixel_data.py"
3829 " and not test_data_manager.py"
3830 " and not test_handler_util.py"
3831 " and not test_overlay_np.py"
3832 " and not test_encoders_pydicom.py"
3833 " and not test_encaps.py"
3834 " and not test_reading_ds_with_known_tags_with_UN_VR"
3835 " and not TestDatasetOverlayArray"
3836 " and not TestReader"
3837 " and not test_filewriter.py"))))
3838 (native-inputs (list python-pytest python-flit-core))
3839 (inputs (list gdcm libjpeg-turbo))
3840 (propagated-inputs (list python-numpy python-pillow))
3841 (home-page "https://github.com/pydicom/pydicom")
3842 (synopsis "Python library for reading and writing DICOM data")
3843 (description "@code{python-pydicom} is a Python library for reading and
3844writing DICOM medical imaging data. It can read, modify and write DICOM
3845data.")
3846 (license license:expat)))
3847
3848(define-public python-deepdish
3849 ;; XXX: The project may no longer be compatible with the version of NumPy
3850 ;; packed in Guix (now 1.24.4), use the latest commit containing fixes.
3851 ;; See: <https://github.com/uchicago-cs/deepdish/issues/50>.
3852 ;; However, there is a maintained fork that appears to be a good
3853 ;; replacement: https://github.com/portugueslab/flammkuchen.
3854 (let ((commit "3f2dff7a03f1b31f6924b665ad5b8c299329c1cd")
3855 (revision "0"))
3856 (package
3857 (name "python-deepdish")
3858 (version (git-version "0.3.7" revision commit))
3859 (source
3860 (origin
3861 (method git-fetch)
3862 (uri (git-reference
3863 (url "https://github.com/uchicago-cs/deepdish")
3864 (commit commit)))
3865 (file-name (git-file-name name version))
3866 (sha256
3867 (base32 "1n3r6z5zd18kdmzyg1gkm9lqi573szlxbls1ck5wjn4a14ar9fw3"))))
3868 (arguments
3869 ;; Disable few failing tests to pass the build.
3870 (list
3871 #:test-flags
3872 #~(list "-k" (string-append "not test_pad"
3873 " and not test_pad_repeat_border"
3874 " and not test_pad_repeat_border_corner"
3875 " and not test_pad_to_size"))
3876 #:phases
3877 #~(modify-phases %standard-phases
3878 (add-after 'unpack 'dont-vendor-six
3879 (lambda _
3880 (delete-file "deepdish/six.py")
3881 (substitute* "deepdish/io/hdf5io.py"
3882 (("from deepdish import six") "import six"))
3883 (substitute* "deepdish/io/ls.py"
3884 (("from deepdish import io, six, __version__")
3885 "from deepdish import io, __version__
3886import six
3887")))))))
3888 (build-system pyproject-build-system)
3889 (native-inputs
3890 (list python-pytest
3891 python-pandas
3892 python-setuptools
3893 python-wheel))
3894 (propagated-inputs
3895 (list python-numpy
3896 python-scipy
3897 python-six
3898 python-tables))
3899 (home-page "https://github.com/uchicago-cs/deepdish")
3900 (synopsis "Python library for HDF5 file saving and loading")
3901 (description
3902 "Deepdish is a Python library to load and save HDF5 files.
3903The primary feature of deepdish is its ability to save and load all kinds of
3904data as HDF5. It can save any Python data structure, offering the same ease
3905of use as pickling or @code{numpy.save}, but with the language
3906interoperability offered by HDF5.")
3907 (license license:bsd-3))))
3908
3909(define-public python-simple-pid
3910 (package
3911 (name "python-simple-pid")
3912 (version "1.0.1")
3913 (source (origin
3914 (method url-fetch)
3915 (uri (pypi-uri "simple-pid" version))
3916 (sha256
3917 (base32
3918 "094mz6rmfq1h0gpns5vlxb7xf9297hlkhndw7g9k95ziqfkv7mk0"))))
3919 (build-system python-build-system)
3920 (arguments
3921 '(#:phases
3922 (modify-phases %standard-phases
3923 (replace 'check
3924 (lambda* (#:key tests? #:allow-other-keys)
3925 (when tests?
3926 (invoke "python" "-m" "unittest" "discover" "tests/")))))))
3927 (home-page "https://github.com/m-lundberg/simple-pid")
3928 (synopsis "Easy to use PID controller")
3929 (description "This package provides a simple and easy-to-use @acronym{PID,
3930proportional-integral-derivative} controller.")
3931 (license license:expat)))
3932
3933(define-public python-supersmoother
3934 (package
3935 (name "python-supersmoother")
3936 (version "0.4")
3937 (source
3938 (origin
3939 (method git-fetch) ; no package in PyPI
3940 (uri (git-reference
3941 (url "https://github.com/jakevdp/supersmoother")
3942 (commit (string-append "v" version))))
3943 (file-name (git-file-name name version))
3944 (sha256
3945 (base32 "1lkj8l2mpki6x2pxcwlrplx63lhi8h9v2rzxgjfb0cppsfr8m1wp"))))
3946 (build-system pyproject-build-system)
3947 (native-inputs
3948 (list python-pytest
3949 python-scipy
3950 python-setuptools
3951 python-wheel))
3952 (propagated-inputs
3953 (list python-numpy))
3954 (home-page "http://github.com/jakevdp/supersmoother")
3955 (synopsis "Python implementation of Friedman's Supersmoother")
3956 (description
3957 "This package provides an efficient implementation of
3958@url{https://www.slac.stanford.edu/pubs/slacpubs/3250/slac-pub-3477.pdf,
3959Friedman's SuperSmoother} based in Python. It makes use of numpy for fast
3960numerical computation.")
3961 (license license:bsd-2)))
3962
3963(define-public python-opt-einsum
3964 (package
3965 (name "python-opt-einsum")
3966 (version "3.3.0")
3967 (source (origin
3968 (method url-fetch)
3969 (uri (pypi-uri "opt_einsum" version))
3970 (sha256
3971 (base32
3972 "0jb5lia0q742d1713jk33vlj41y61sf52j6pgk7pvhxvfxglgxjr"))))
3973 (build-system python-build-system)
3974 (arguments
3975 '(#:phases
3976 (modify-phases %standard-phases
3977 (replace 'check
3978 (lambda* (#:key tests? #:allow-other-keys)
3979 (when tests?
3980 (invoke "pytest" "-vv")))))))
3981 (propagated-inputs (list python-numpy))
3982 (native-inputs (list python-pytest python-pytest-cov python-pytest-pep8))
3983 (home-page "https://github.com/dgasmith/opt_einsum")
3984 (synopsis "Optimizing numpys einsum function")
3985 (description
3986 "Optimized einsum can significantly reduce the overall execution time of
3987einsum-like expressions by optimizing the expression's contraction order and
3988dispatching many operations to canonical BLAS, cuBLAS, or other specialized
3989routines. Optimized einsum is agnostic to the backend and can handle NumPy,
3990Dask, PyTorch, Tensorflow, CuPy, Sparse, Theano, JAX, and Autograd arrays as
3991well as potentially any library which conforms to a standard API. See the
3992documentation for more information.")
3993 (license license:expat)))
3994
3995(define-public python-vaex-core
3996 (package
3997 (name "python-vaex-core")
3998 (version "4.17.1")
3999 (source
4000 (origin
4001 (method url-fetch)
4002 (uri (pypi-uri "vaex-core" version))
4003 (sha256
4004 (base32 "1rzx5px3fwi5mh1z8y91brvffk7dkhj287lnmqp8zp6836kkqhya"))
4005 (modules '((guix build utils)))
4006 (snippet
4007 ;; Remove bundled libraries
4008 '(for-each delete-file-recursively
4009 (list "vendor/boost"
4010 "vendor/pcre"
4011 "vendor/pybind11")))))
4012 (build-system pyproject-build-system)
4013 (arguments (list #:tests? #false)) ;require vaex.server and others, which require vaex-core.
4014 (inputs
4015 (list boost pcre pybind11-2.3))
4016 (propagated-inputs
4017 (list python-aplus
4018 python-blake3
4019 python-click ;XXX for dask
4020 python-cloudpickle
4021 python-dask
4022 python-filelock
4023 python-frozendict
4024 python-future
4025 python-nest-asyncio
4026 python-numpy
4027 python-pandas
4028 python-progressbar2
4029 python-pyarrow
4030 python-pydantic-2
4031 python-pydantic-settings
4032 python-pyyaml
4033 python-requests
4034 python-rich
4035 python-six
4036 python-tabulate))
4037 (native-inputs
4038 (list python-pytest python-cython-3 python-setuptools python-wheel))
4039 (home-page "https://www.github.com/maartenbreddels/vaex")
4040 (synopsis "Core of Vaex library for exploring tabular datasets")
4041 (description "Vaex is a high performance Python library for lazy
4042Out-of-Core DataFrames (similar to Pandas), to visualize and explore big
4043tabular datasets. This package provides the core modules of Vaex.")
4044 (license license:expat)))
4045
4046(define-public python-salib
4047 (package
4048 (name "python-salib")
4049 (version "1.4.7")
4050 (source (origin
4051 (method git-fetch)
4052 (uri (git-reference
4053 (url "https://github.com/SALib/SALib")
4054 (commit (string-append "v" version))))
4055 (file-name (git-file-name name version))
4056 (sha256
4057 (base32
4058 "18xfyzircsx2q2lmfc9lxb6xvkxicnc83qzghd7df1jsprr5ymch"))))
4059 (build-system pyproject-build-system)
4060 (propagated-inputs (list python-matplotlib
4061 python-multiprocess
4062 python-numpy
4063 python-pandas
4064 python-scipy))
4065 (native-inputs (list python-hatchling python-pytest python-pytest-cov))
4066 (home-page "https://salib.readthedocs.io/en/latest/")
4067 (synopsis "Tools for global sensitivity analysis")
4068 (description "SALib provides tools for global sensitivity analysis. It
4069contains Sobol', Morris, FAST, DGSM, PAWN, HDMR, Moment Independent and
4070fractional factorial methods.")
4071 (license license:expat)))
4072
4073(define-public python-pylems
4074 (package
4075 (name "python-pylems")
4076 (version "0.6.0")
4077 (source (origin
4078 (method url-fetch)
4079 (uri (pypi-uri "PyLEMS" version))
4080 (sha256
4081 (base32
4082 "074azbyivjbwi61fs5p8z9n6d8nk8xw6fmln1www13z1dccb3740"))))
4083 (build-system python-build-system)
4084 (propagated-inputs (list python-lxml))
4085 (home-page "https://github.com/LEMS/pylems")
4086 (synopsis
4087 "Python support for the Low Entropy Model Specification language (LEMS)")
4088 (description
4089 "A LEMS simulator written in Python which can be used to run
4090NeuroML2 models.")
4091 (license license:lgpl3)))
4092
4093(define-public python-pynetdicom
4094 (package
4095 (name "python-pynetdicom")
4096 (version "2.1.1")
4097 (source (origin
4098 (method url-fetch)
4099 (uri (pypi-uri "pynetdicom" version))
4100 (sha256
4101 (base32
4102 "1smzrnc93nmv8jz4np9knas74a46b1nhb3hjpf8n9vfpxypgnwcn"))))
4103 (build-system pyproject-build-system)
4104 (arguments
4105 (list
4106 #:test-flags
4107 ;; Tests takes about 10-15min to complete.
4108 ;; Skip tests that require networking.
4109 #~(list "-k" (string-append
4110 " not TestFindSCP"
4111 " and not TestQRGetServiceClass"
4112 " and not TestQRMoveServiceClass"
4113 " and not TestStoreSCP"
4114 " and not test_ae.py"
4115 " and not test_echoscp.py"
4116 " and not test_qrscp_echo.py"
4117 " and not test_storescp.py"
4118 " and not test_pr_level_patient"
4119 " and not test_pr_level_series"
4120 " and not test_scp_cancelled"))))
4121 (native-inputs (list python-codespell
4122 python-coverage
4123 python-poetry-core
4124 python-pytest
4125 python-pytest-cov
4126 python-pytest-xdist
4127 python-sphinx
4128 python-sphinx-rtd-theme))
4129 (propagated-inputs (list python-mypy
4130 python-numpydoc
4131 python-pydicom
4132 python-pyfakefs
4133 python-sqlalchemy))
4134 (home-page "https://github.com/pydicom/pynetdicom")
4135 (synopsis "Python implementation of the DICOM networking protocol")
4136 (description
4137 "@code{pynetdicom} is a Python package that implements the DICOM
4138networking protocol. It allows the easy creation of DICOM
4139@acronym{SCUs,Service Class Users} and @acronym{SCPs,Service Class
4140Providers}.")
4141 (license license:expat)))
4142
4143(define-public python-pynrrd
4144 (package
4145 (name "python-pynrrd")
4146 (version "1.0.0")
4147 (source (origin
4148 (method git-fetch)
4149 (uri (git-reference
4150 (url "https://github.com/mhe/pynrrd")
4151 (commit (string-append "v" version))))
4152 (file-name (git-file-name name version))
4153 (sha256
4154 (base32
4155 "09gdyi4kbi3512ydgqxkgr4j7b9a95qh83fk2n9s41bns4id9xj7"))))
4156 (build-system python-build-system)
4157 (propagated-inputs
4158 (list python-nptyping python-numpy python-typing-extensions))
4159 (home-page "https://github.com/mhe/pynrrd")
4160 (synopsis "Python module for reading and writing NRRD files")
4161 (description
4162 "@code{pynrrd} is a Python module for reading and writing @acronym{NRRD,
4163Nearly Raw Raster Data} files (format designed to support scientific
4164visualization and image processing involving N-dimensional raster data) into
4165and from numpy arrays.")
4166 (license license:expat)))
4167
4168(define-public python-pynsee
4169 (package
4170 (name "python-pynsee")
4171 (version "0.1.8")
4172 (source
4173 (origin
4174 (method url-fetch)
4175 (uri (pypi-uri "pynsee" version))
4176 (sha256
4177 (base32 "1w084ynwdd9f4wpcnakqc0nxcbj9gr8vppv4rd258i3dp1qq4sw5"))))
4178 (build-system pyproject-build-system)
4179 (arguments (list #:tests? #f)) ; XXX: Tests require network access.
4180 (native-inputs
4181 (list python-setuptools
4182 python-wheel))
4183 (propagated-inputs
4184 (list python-appdirs
4185 python-openpyxl
4186 python-pandas
4187 python-platformdirs
4188 python-pyarrow
4189 python-requests
4190 python-shapely
4191 python-tqdm
4192 python-unidecode
4193 python-urllib3
4194 python-xlrd))
4195 (home-page "https://pynsee.readthedocs.io")
4196 (synopsis
4197 "Tools to Easily Search and Download French Data From INSEE and IGN APIs")
4198 (description
4199 "This package provides tools to easily search and download French data
4200from INSEE and IGN APIs. This data includes more than 150 000 macroeconomic
4201series, a dozen datasets of local french data, numerous sources available on
4202@url{insee.fr}, geographical limits of administrative areas taken from IGN as
4203well as key metadata and SIRENE database containing data on all French
4204compagnies.")
4205 (license license:expat)))
4206
4207(define-public python-libneuroml
4208 (package
4209 (name "python-libneuroml")
4210 (version "0.6.5")
4211 (source (origin
4212 (method git-fetch)
4213 (uri (git-reference
4214 (url "https://github.com/NeuralEnsemble/libNeuroML.git")
4215 (commit (string-append "v" version))))
4216 (file-name (git-file-name name version))
4217 (sha256
4218 (base32
4219 "04cfff9phm19x87p86xrkhd6wlpxvdwk3rf1c3qgyncfchws0sjh"))))
4220 (build-system pyproject-build-system)
4221 (native-inputs
4222 (list python-pytest
4223 python-numpy
4224 python-setuptools
4225 python-tables
4226 python-wheel))
4227 (propagated-inputs
4228 (list python-lxml
4229 python-natsort
4230 python-networkx))
4231 (home-page "https://libneuroml.readthedocs.org/en/latest/")
4232 (synopsis
4233 "Python library for working with NeuroML descriptions of neuronal models")
4234 (description
4235 "This package provides a Python library for working with NeuroML descriptions of
4236neuronal models")
4237 (license license:bsd-3)))
4238
4239;;;
4240;;; Avoid adding new packages to the end of this file. To reduce the chances
4241;;; of a merge conflict, place them above by existing packages with similar
4242;;; functionality or similar names.
4243;;;