From d2bd37e9ed40e7c48de70a149ab2f2fb2c0023ee Mon Sep 17 00:00:00 2001 From: Sharlatan Hellseher Date: Fri, 14 Aug 2026 11:41:22 +0100 Subject: gnu: packages/python-science: Sort variables. * gnu/packages/python-science.scm: Sort all variables in alphabetical order. Adjust module footer comment. --- gnu/packages/python-science.scm | 6411 +++++++++++++++++++-------------------- 1 file changed, 3205 insertions(+), 3206 deletions(-) (limited to 'gnu/packages/python-science.scm') diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm index 0a3c0871dbb..be3b66714ea 100644 --- a/gnu/packages/python-science.scm +++ b/gnu/packages/python-science.scm @@ -1867,6 +1867,56 @@ MIGRAD algorithm and Numba accelerated functions.") functions with arbitrary round-off error and error propagation.") (license license:expat))) +(define-public python-janitor-rs + (package + (name "python-janitor-rs") + (version "0.6.1") + (source + (origin + ;; The upstream git source has no tags. + (method url-fetch) + (uri (pypi-uri "janitor_rs" version)) + (sha256 + (base32 "0xicxplz8vngbj4s6c7d08gpivns5bda85020yf1wjs8788g9m2l")))) + (build-system pyproject-build-system) + (arguments + (list + #:tests? #f ; No tests. + #:imported-modules `(,@%cargo-build-system-modules + ,@%pyproject-build-system-modules) + #:modules '(((guix build cargo-build-system) #:prefix cargo:) + (guix build pyproject-build-system) + (guix build utils)) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'prepare-cargo-build-system + (lambda args + (for-each + (lambda (phase) + (format #t "Running cargo phase: ~a~%" phase) + (apply (assoc-ref cargo:%standard-phases phase) + #:vendor-dir ".cargo/vendor" + #:cargo-target #$(cargo-triplet) + args)) + '(unpack-rust-crates + configure + check-for-pregenerated-files + patch-cargo-checksums))))))) + (native-inputs (append + (list maturin + rust + `(,rust "cargo")) + (or (and=> (%current-target-system) + (compose list make-rust-sysroot)) + '()))) + (inputs (cargo-inputs 'janitor-rs)) + (home-page "https://github.com/pyjanitor-devs/janitor-rs") + (synopsis "Rust library for faster pyjanitor") + (description + "This package provides a Rust library to improve the performance of +@code{python-pyjanitor}.") + (license license:expat))) + (define-public python-legendkit (package (name "python-legendkit") @@ -2748,6 +2798,43 @@ well as potentially any library which conforms to a standard API. See the documentation for more information.") (license license:expat))) +(define-public python-orsopy + (package + (name "python-orsopy") + (version "1.2.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/reflectivity/orsopy") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "15av7b38h9x0f09dzxb111r2kxm6an461l9ajb01r8r7mv7m5bw9")))) + (build-system pyproject-build-system) + (arguments + (list + #:test-flags + ;; These tests require network access. + #~(cons* "--ignore=orsopy/slddb/tests/test_webapi.py" + (map (lambda (test) + (string-append "--deselect=orsopy/fileio/tests/" + "test_model_language.py::" test)) + (list "TestSubStack::test_resolve_layers" + "TestMaterial::test_density_lookup_elements" + "TestSampleModel::test_resolve_to_layers"))))) + (propagated-inputs + (list python-numpy python-pyyaml python-jsonschema python-h5py)) + (native-inputs + (list python-pint python-pytest python-setuptools)) + (home-page "https://github.com/reflectivity/orsopy") + (synopsis "Open Reflectometry Standards Organization Python tools") + (description + "This package provides Python tools for the Open Reflectometry Standards +Organization (ORSO). It includes utilities for working with reflectometry +data files and the ORSO file format.") + (license license:expat))) + (define-public python-osfclient (package (name "python-osfclient") @@ -2862,3883 +2949,3833 @@ web, by sharing data and other research outputs.") numerical optimization package.") (license license:asl2.0))) -(define-public python-particle +(define-public python-pandarallel (package - (name "python-particle") - (version "1.0.0") + (name "python-pandarallel") + (version "1.6.5") (source (origin - (method url-fetch) - (uri (pypi-uri "particle" version)) + (method git-fetch) ; no tests in PyPI + (uri (git-reference + (url "https://github.com/nalepae/pandarallel/") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) (sha256 - (base32 "14h4nndm3pk97q05ic25m07ral501wl05sg8yc3ln15m3kn5s529")))) + (base32 "0r2wlxlwp4wia0vm15k4cp421mwa20k4k5g2ml01inprj8bl1p0p")) + (patches + (search-patches "python-pandarallel-fix-df-applymap.patch" + "python-pandarallel-fix-parallel_apply.patch")))) (build-system pyproject-build-system) - (propagated-inputs (list python-attrs - python-hepunits)) - (native-inputs (list python-hatch-vcs - python-hatchling - python-pandas - python-pytest - python-pytest-benchmark - python-tabulate)) - (home-page "https://github.com/scikit-hep/particle") - (synopsis "Extended PDG particle data and MC identification codes") + (arguments + (list + #:test-flags #~(list "-n" (number->string (parallel-job-count))))) + (propagated-inputs + (list python-dill + python-pandas + python-psutil)) + (native-inputs + (list python-mkdocs-material + python-numpy + python-pytest + python-pytest-xdist + python-setuptools + python-wheel)) + (home-page "https://nalepae.github.io/pandarallel/") + (synopsis "Tool to parallelize Pandas operations across CPUs") (description - "@code{Particle} provides a pythonic interface to the Particle Data Group -(PDG) particle data tables and particle identification codes, with extended -particle information and extra goodies.") + "@code{pandarallel} allows any Pandas user to take advantage of their +multi-core computer, while Pandas uses only one core. @code{pandarallel} also +offers nice progress bars (available on Notebook and terminal) to get an rough +idea of the remaining amount of computation to be done.") (license license:bsd-3))) -(define-public python-pint +(define-public python-pandas (package - (name "python-pint") - (version "0.25.3") + (name "python-pandas") + (version "3.0.3") (source (origin (method git-fetch) (uri (git-reference - (url "https://github.com/hgrecco/pint") - (commit version))) + (url "https://github.com/pandas-dev/pandas") + (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "0ra25yfvjm5fpc47wm2dk8vicpdblvjjizbs0n1ak5d65mqinv4p")))) + (base32 "1qagfjf4rrpx4xdw0bwg3q9g4k5vjplvifnx6k2frm8z2ws9hgds")))) (build-system pyproject-build-system) (arguments (list - ;; tests: 2191 passed, 142 skipped, 11 xfailed, 9 warnings, 298 subtests - ;; passed - #:test-flags #~(list "--ignore=pint/testsuite/benchmarks") + ;; tests: 185854 passed, 12827 skipped, 776 xfailed, 86 xpassed + #:test-flags + #~(list "-m" (string-join + (list "not db" "network" "single_cpu" "slow" "slow_arm") + " and not ") + "-vv" + ;; See: . + "--no-strict-data-files" + "--numprocesses" (number->string (min 4 (parallel-job-count))) + "-k" (string-join + (list "not test_git_version" + "test_show_versions_console" + ;; DeprecationWarning: Bitwise inversion '~' on bool + ;; is deprecated and will be removed in Python 3.16. + "test_scalar_unary[numexpr-pandas]" + ;; AssertionError: Series are different. + #$@(if (target-64bit?) + '() + '("test_rolling_var_numerical_issues"))) + " and not ")) #:phases #~(modify-phases %standard-phases - (add-before 'check 'pre-check + (add-after 'unpack 'patch-generate-version (lambda _ - ;; PermissionError: [Errno 13] Permission denied: - ;; '/homeless-shelter' - (setenv "HOME" "/tmp")))))) + ;; See: . + (substitute* "generate_version.py" + (("version =.*") + (format #f "version = ~s~%" #$version)) + (("git_version =.*") + (format #f "git_version = ~s~%" #$version))))) + (replace 'check + (lambda* (#:key test-flags tests? #:allow-other-keys) + (when tests? + ;; Tests don't work with "--pyargs pandas" or changing + ;; directory to output, script is taken from pyproject.toml + ;; file. + (setenv "HOME" "/tmp") + (delete-file-recursively "pandas") + (invoke "python" "-c" (format #f "~a; ~a=[~{'~a', ~}]);" + "import pandas as pd" + "pd.test(extra_args" + test-flags)))))))) + (propagated-inputs + (list python-numpy + python-dateutil + ;; XXX: Pandas lists a lot of optional dependencies which are not + ;; hard requirements, leave them listed here and commented out for + ;; the reference purpose. Try to keep closure as bare minimal as + ;; possible. + ;; + ;; [optional] + ;; python-adbc-driver-postgresql + ;; python-adbc-driver-sqlite + ;; python-beautifulsoup4 + python-bottleneck + ;; python-fastparquet + ;; python-fsspec + ;; python-gcsfs + ;; python-html5lib + ;; python-hypothesis + ;; python-jinja2 + python-lxml + ;; python-matplotlib + python-numba + python-numexpr + ;; python-odfpy + ;; python-openpyxl + ;; python-psycopg2 + ;; python-pyarrow + ;; python-pyiceberg + ;; python-pymysql + ;; python-pyqt5 + ;; python-pyreadstat + ;; python-python-calamine + ;; python-pyxlsb + ;; python-qtpy + ;; python-s3fs + ;; python-scipy + ;; python-sqlalchemy + ;; python-tables + ;; python-tabulate + ;; python-xarray + ;; python-xlrd + ;; python-xlsxwriter + #;python-zstandard)) + (inputs + (list xclip xsel)) (native-inputs - (list python-hatch-vcs - python-hatchling + (list python-hypothesis + python-meson python-pytest - python-pytest-mpl - python-pytest-subtests)) - (propagated-inputs - (list python-flexcache - python-flexparser - python-platformdirs - python-typing-extensions)) - (home-page "https://github.com/hgrecco/pint") - (synopsis "Physical quantities module") - (description - "Pint is a Python package to define, operate and manipulate physical -quantities: the product of a numerical value and a unit of measurement. It -allows arithmetic operations between them and conversions from and to -different units.") + python-pytest-localserver + python-pytest-xdist + python-pytz + python-versioneer + tzdata-for-tests)) + (home-page "https://pandas.pydata.org") + (synopsis "Data structures for data analysis, time series, and statistics") + (description + "Pandas is a Python package providing fast, flexible, and expressive data +structures designed to make working with structured (tabular, +multidimensional, potentially heterogeneous) and time series data both easy +and intuitive. It aims to be the fundamental high-level building block for +doing practical, real world data analysis in Python.") (license license:bsd-3))) -(define-public python-pyamg +(define-public python-pandas-2 (package - (name "python-pyamg") - (version "5.3.0") - (source (origin - (method url-fetch) - (uri (pypi-uri "pyamg" version)) - (modules '((guix build utils))) - (snippet - ;; Delete autogenerated files, regenerate in a phase. - #~(begin - (for-each - (lambda (file) - (delete-file (string-append "pyamg/amg_core/" file))) - '("air_bind.cpp" - "evolution_strength_bind.cpp" - "graph_bind.cpp" - "krylov_bind.cpp" - "linalg_bind.cpp" - "relaxation_bind.cpp" - "ruge_stuben_bind.cpp" - "smoothed_aggregation_bind.cpp" - "tests/bind_examples_bind.cpp")))) - (sha256 - (base32 - "02w6xy3i0qcpsfc64zw8k15mi6qykq65h3d98vi9p6fdlkqx08sk")))) + (inherit python-pandas) + (name "python-pandas") + (version "2.3.3") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/pandas-dev/pandas") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0qf4frgj31kd9i544n8v03a0bv9mgml3f7n9n1rik187q3r8ygfg")) + (patches (search-patches "python-pandas-2-no-pytz_datetime.patch")))) + (build-system pyproject-build-system) (arguments (list - ;; tests: 40 passed, 1 skipped + ;; tests: 173093 passed, 24265 skipped, 990 xfailed, 77 xpassed, 110 warnings + #:test-flags + #~(list "-m" (string-join + (list "not db" "network" "single_cpu" "slow" "slow_arm") + " and not ") + "--numprocesses" (number->string (min 4 (parallel-job-count))) + "-k" (string-join + (list "not test_git_version" + "test_parsing_tzlocal_deprecated" + "test_show_versions_console" + ;; XXX: Introduced by NumPy 2.4.6 and Cython 3.2.5: + ;; NotImplementedError + ;; See: + ;; , + ;; . + "test_categorical_block_pickle" + "test_pickle" + "test_pickle_freq" + "test_pickle_preserves_block_ndim" + "test_pickle_preserves_name" + "test_pickle_round_trip" + "test_pickle_roundtrip" + "test_pickle_roundtrip_containers" + "test_round_trip_current" + ;; AssertionError: Series are different. + #$@(if (target-64bit?) + '() + '("test_rolling_var_numerical_issues"))) + " and not ")) #:phases #~(modify-phases %standard-phases - ;; Regenerate the autogenerated files. - (add-after 'unpack 'amg-core-bind-them - (lambda _ - ;; bindthem.py heavily depends on location to produce *_bind.cpp - ;; file, make it available in tests as well. - (copy-file "pyamg/amg_core/bindthem.py" - "pyamg/amg_core/tests/bindthem.py") - (with-directory-excursion "pyamg/amg_core" - (substitute* "bindthem.py" - (("/usr/bin/env python3") (which "python3"))) - (invoke "sh" "generate.sh")) - (with-directory-excursion "pyamg/amg_core/tests" - (invoke "python" "bindthem.py" "bind_examples.h")))) - (add-before 'check 'pre-check + (add-after 'unpack 'patch-generate-version (lambda _ - (copy-recursively "pyamg/tests" "tests") - (delete-file-recursively "pyamg")))))) - (build-system pyproject-build-system) - (native-inputs - (list pybind11-2 - python-cppheaderparser - python-pytest - python-pyyaml - python-setuptools - python-setuptools-scm)) + ;; See: . + (substitute* "generate_version.py" + (("version =.*") + (format #f "version = ~s~%" #$version)) + (("git_version =.*") + (format #f "git_version = ~s~%" #$version))))) + (replace 'check + (lambda* (#:key inputs outputs test-flags tests? #:allow-other-keys) + (when tests? + (setenv "HOME" "/tmp") + (with-directory-excursion + (string-append (string-append (site-packages inputs outputs) + "/pandas")) + (apply invoke "pytest" "-vv" test-flags)))))))) (propagated-inputs (list python-numpy - python-scipy)) - (home-page "https://github.com/pyamg/pyamg") - (synopsis "Algebraic Multigrid Solvers in Python") - (description "PyAMG is a Python library of Algebraic Multigrid -(AMG) solvers. It features implementations of: -@itemize -@item Ruge-Stuben (RS) or Classical AMG -@item AMG based on Smoothed Aggregation (SA) -@item Adaptive Smoothed Aggregation (αSA) -@item Compatible Relaxation (CR) -@item Krylov methods such as CG, GMRES, FGMRES, BiCGStab, MINRES, etc. -@end itemize") - (license license:expat))) + python-dateutil + python-pytz + python-tzdata)) + (inputs + (list xclip xsel)) + (native-inputs + (list python-meson + python-lxml + python-pytest + python-pytest-asyncio + python-pytest-xdist + python-versioneer + tzdata-for-tests)))) -(define-public python-pyet +(define-public python-pandas-flavor (package - (name "python-pyet") - (version "1.3.1") + (name "python-pandas-flavor") + (version "0.8.1") (source (origin (method url-fetch) - (uri (pypi-uri "pyet" version)) + (uri (pypi-uri "pandas_flavor" version)) (sha256 - (base32 "1dblsx0bv1g453hcx5vwij1zgankwgwvhwllqkn47k578h038xvy")))) + (base32 + "0rn3pnracv8013j3f737qal3isf1brbc3mpxqhr03vik322sapr5")))) (build-system pyproject-build-system) (native-inputs - (list python-mock - python-pytest + (list python-pytest python-setuptools - python-wheel)) + python-setuptools-scm)) (propagated-inputs (list python-pandas python-xarray)) - (home-page "https://github.com/pyet-org/pyet") - (synopsis "Python package for evapotranspiration calculation") - (description - "This package provides a Python library for calculating -Evapotranspiration using various standard methods.") + (home-page "https://github.com/pyjanitor-devs/pandas_flavor") + (synopsis "Write your own flavor of Pandas") + (description "Pandas 0.23 added a simple API for registering accessors +with Pandas objects. Pandas-flavor extends Pandas' extension API by + +@itemize +@item adding support for registering methods as well +@item making each of these functions backwards compatible with older versions +of Pandas +@end itemize") (license license:expat))) -(define-public python-pykdtree - (package - (name "python-pykdtree") - (version "1.4.2") - (source - (origin - (method url-fetch) - (uri (pypi-uri "pykdtree" version)) - (sha256 - (base32 "1xb5xdp32s5ffcbbb6vlrj4i70hdknajvr9yhzx0wld52rx9caxx")))) - (build-system pyproject-build-system) +;; A bare minimal package, mainly to use in tests and reduce closure size. +;; Tests are left out in the main package to slim down native-inputs and +;; propagated-inputs. +(define-public python-pandas-minimal + (package/inherit python-pandas + (name "python-pandas-minimal") (arguments - (list - ;; FIXME: Tests are unable to import properly, but it seems to work in - ;; real conditions. - #:tests? #f - #:phases - #~(modify-phases %standard-phases - (add-after 'install 'fix-site-packages - (lambda* (#:key inputs outputs #:allow-other-keys) - (with-directory-excursion (site-packages inputs outputs) - (for-each delete-file (find-files "." "test*")))))))) + (substitute-keyword-arguments arguments + ((#:tests? _ #t) #f))) (native-inputs - (list python-cython python-pytest python-setuptools python-wheel)) + (list python-meson + python-versioneer)) (propagated-inputs - (list python-numpy)) - (home-page "https://github.com/storpipfugl/pykdtree") - (synopsis "Fast kd-tree implementation with OpenMP-enabled queries") - (description - "@code{pykdtree} is a kd-tree implementation for fast nearest neighbour -search in Python.") - (license license:lgpl3+))) + (list python-numpy + python-dateutil + python-pytz)))) -(define-public python-pynetdicom +(define-public python-pandas-stubs (package - (name "python-pynetdicom") - (version "2.1.1") - (source (origin - (method url-fetch) - (uri (pypi-uri "pynetdicom" version)) - (sha256 - (base32 - "1smzrnc93nmv8jz4np9knas74a46b1nhb3hjpf8n9vfpxypgnwcn")))) + (name "python-pandas-stubs") + ;; The versioning follows that of Pandas and uses the date of the + ;; python-pandas-stubs release. + (version "2.3.3.251219") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/pandas-dev/pandas-stubs") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1xh753wv5dbc59qp7fas323181mlblvhqmd9a4g7zzhaa2mxmzqs")))) (build-system pyproject-build-system) (arguments (list + ;; tests: 1619 passed, 12 skipped, 7 deselected #:test-flags - ;; Tests takes about 10-15min to complete, and not thread save. - ;; Skip tests that require networking. - #~(list "-k" (string-append - " not TestFindSCP" - " and not TestQRGetServiceClass" - " and not TestQRMoveServiceClass" - " and not TestStoreSCP" - " and not test_ae.py" - " and not test_echoscp.py" - " and not test_qrscp_echo.py" - " and not test_storescp.py" - " and not test_pr_level_patient" - " and not test_pr_level_series" - " and not test_scp_cancelled")))) - (native-inputs (list python-numpydoc - python-poetry-core - python-pytest)) - (propagated-inputs (list python-pydicom - python-pyfakefs - python-sqlalchemy)) - (home-page "https://github.com/pydicom/pynetdicom") - (synopsis "Python implementation of the DICOM networking protocol") + #~(list + ;; ImportError: Missing optional dependency 'python-calamine'. + "--deselect=tests/test_io.py::test_read_excel" + "--deselect=tests/test_io.py::test_excel_reader"))) + (native-inputs + (list python-beautifulsoup4 + python-fsspec + python-html5lib + python-jinja2 + python-loguru + python-lxml + python-matplotlib + python-mypy + python-numexpr + python-odfpy + python-openpyxl + python-pandas + python-poetry-core + python-pyarrow + python-pyreadstat + python-pytest + python-scipy + python-sqlalchemy-2 + python-tabulate + python-typing-extensions + python-xarray + python-xlrd + python-xlsxwriter + ;; Not packaged yet + ;; + ;; python-calamine + ;; python-poethepoet + ;; python-pyarrow-stubs + ;; python-pyrefly + ;; python-python-calamine + ;; python-pyxlsb + ;; python-scipy-stubs + ;; python-ty + ;; python-types-python-dateutil + tzdata-for-tests)) + (propagated-inputs + (list python-numpy + python-types-pytz)) + (home-page "https://pandas.pydata.org") + (synopsis "Type annotations for pandas") (description - "@code{pynetdicom} is a Python package that implements the DICOM -networking protocol. It allows the easy creation of DICOM -@acronym{SCUs,Service Class Users} and @acronym{SCPs,Service Class -Providers}.") - (license license:expat))) + "This package contains public type stubs for @code{python-pandas}, following +the convention of providing stubs in a separate package, as specified in +@acronym{PEP, Python Enhancement Proposal} 561. The stubs cover the most +typical use cases of @code{python-pandas}. In general, these stubs are +narrower than what is possibly allowed by @code{python-pandas}, but follow a +convention of suggesting best recommended practices for using +@code{python-pandas}.") + (license license:bsd-3))) -(define-public python-pyzx +(define-public python-pandera (package - (name "python-pyzx") - (version "0.9.0") + (name "python-pandera") + (version "0.31.1") (source (origin - (method git-fetch) ; no tests in PyPI - (uri (git-reference - (url "https://github.com/zxcalc/pyzx") - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) + ;; XXX: Sanity-check fails to load when switched to git-fetch. + (method url-fetch) + (uri (pypi-uri "pandera" version)) (sha256 - (base32 "1bnmz08w1bmipir1wnn1k3fw64rply7891xns22qfj6yh0j1n6rj")))) + (base32 "04qgmcfvw78ccfnmidhy3zw1i99nyjkz3b0klsd4ypgiia3a6nn7")))) (build-system pyproject-build-system) - (arguments (list #:test-flags - #~(list - ;; Ignore long running tests - "--ignore=tests/long_test.py" - "--ignore=tests/long_scalar_test.py") - #:phases - #~(modify-phases %standard-phases - (add-before 'check 'pre-check - (lambda* (#:key inputs outputs #:allow-other-keys) - (setenv "HOME" "/tmp") - ;; Matplotlib needs to be able to write its - ;; configuration file somewhere. - (setenv "MPLCONFIGDIR" "/tmp")))))) - (native-inputs (list python-pytest - python-setuptools - python-wheel)) - (propagated-inputs (list python-ipywidgets - python-lark - python-numpy - python-pyperclip - python-tqdm)) - (home-page "https://github.com/zxcalc/pyzx") - (synopsis "Quantum circuit rewriting and optimisation using the ZX-calculus") + (arguments + (list + ;; tests: 3810 passed, 22 skipped, 21 xfailed, 5923 warnings + #:test-flags + ;; With higher threads count tests randomly fail during collection. + #~(list "--numprocesses" (number->string (min 2 (parallel-job-count))) + ;; TODO: Ignore tests for not packaged python-ibis-framework, + ;; and python-pyspark. + "--ignore=tests/ibis" + "--ignore=tests/pyspark" + ;; Not compatible with Pandas 3 yet. + "--ignore=tests/modin" + ;; Tests fail to connect to 127.0.0.1:52245, connection refused. + "--deselect=tests/fastapi/test_app.py::test_items_endpoint" + "--deselect=tests/fastapi/test_app.py::test_transactions_endpoint" + "--deselect=tests/fastapi/test_app.py::test_upload_file_endpoint" + ;; frictionless is not packaged yet. + "-k" "not test_frictionless_schema_"))) + (native-inputs + (list python-joblib + python-black ;some tets depent on it + python-mypy-for-tests + python-pytest + python-pytest-asyncio + python-pytest-xdist + python-pytz + python-setuptools + python-setuptools-scm + python-sphinx ;some tets depent on it + python-uvicorn + tzdata-for-tests)) + (inputs + ;; [optional] + ;; Pandera comes with a lot of extras. We test as many as possible, but do + ;; not include all of them in the propagated-inputs. Currently, we have to + ;; skip the pyspark and io tests due to missing packages python-pyspark + ;; and python-frictionless. + (list python-dask + python-distributed + python-geopandas + python-hypothesis + ;; python-ibis-framework ;missing from Guix + ;; python-modin ;blocked by guix/guix#9336 + python-numpy + python-pandas + python-polars + ;; python-pyspark ;missing from Guix + ;; python-ray ;missing from Guix + python-scipy + python-shapely)) + (propagated-inputs + (list python-packaging + python-pydantic + python-typeguard + python-typing-extensions + python-typing-inspect)) + (home-page "https://github.com/unionai-oss/pandera") + (synopsis "Perform data validation on dataframe-like objects") (description - "PyZX is a Python tool implementing the theory of ZX-calculus for the -creation, visualisation, and automated rewriting of large-scale quantum -circuits. PyZX currently allows you to: + "@code{python-pandera} provides a flexible and expressive API for +performing data validation on dataframe-like objects to make data processing +pipelines more readable and robust. Dataframes contain information that +@code{python-pandera} explicitly validates at runtime. This is useful in +production-critical data pipelines or reproducible research settings. With +@code{python-pandera}, you can: @itemize -@item Read in quantum circuits in the file format of QASM, Quipper or Quantomatic; -@item Rewrite circuits into a pseudo-normal form using the ZX-calculus; -@item Extract new simplified circuits from these reduced graphs; -@item Visualise the ZX-graphs and rewrites using either Matplotlib, Quantomatic -or as a TikZ file for use in LaTeX documents; -@item Output the optimised circuits in QASM, QC or QUIPPER format. +@item Define a schema once and use it to validate different dataframe types. +@item Check the types and properties of columns. +@item Perform more complex statistical validation like hypothesis testing. +@item Seamlessly integrate with existing data pipelines via function decorators. +@item Define dataframe models with the class-based API with pydantic-style syntax. +@item Synthesize data from schema objects for property-based testing. +@item Lazily validate dataframes so that all validation rules are executed. +@item Integrate with a rich ecosystem of tools like @code{python-pydantic}, +@code{python-fastapi} and @code{python-mypy}. @end itemize") - (license license:asl2.0))) + (license license:expat))) -(define-public python-qdldl +(define-public python-particle (package - (name "python-qdldl") - (version "0.1.7.post5") + (name "python-particle") + (version "1.0.0") (source (origin (method url-fetch) - (uri (pypi-uri "qdldl" version)) + (uri (pypi-uri "particle" version)) (sha256 - (base32 "0vi8dgrw32qj03z2dd3zqd0d625pibq3xmlgmidfsnwvqkhrj4qb")))) + (base32 "14h4nndm3pk97q05ic25m07ral501wl05sg8yc3ln15m3kn5s529")))) (build-system pyproject-build-system) - (native-inputs - (list cmake-minimal - pybind11-2 - python-pytest - python-setuptools)) - (propagated-inputs (list python-numpy python-scipy)) - (home-page "https://github.com/oxfordcontrol/qdldl-python/") - (synopsis "QDLDL LDL factorization routine") - (description "This package provides a Python interface to the QDLDL LDL -factorization routine for quasi-definite linear system.") - (license license:asl2.0))) + (propagated-inputs (list python-attrs + python-hepunits)) + (native-inputs (list python-hatch-vcs + python-hatchling + python-pandas + python-pytest + python-pytest-benchmark + python-tabulate)) + (home-page "https://github.com/scikit-hep/particle") + (synopsis "Extended PDG particle data and MC identification codes") + (description + "@code{Particle} provides a pythonic interface to the Particle Data Group +(PDG) particle data tables and particle identification codes, with extended +particle information and extra goodies.") + (license license:bsd-3))) -(define-public python-quantities +(define-public python-pingouin (package - (name "python-quantities") - (version "0.16.4") + (name "python-pingouin") + (version "0.6.1") (source (origin - (method url-fetch) - (uri (pypi-uri "quantities" version)) + (method git-fetch) + (uri (git-reference + (url "https://github.com/raphaelvallat/pingouin") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) (sha256 - (base32 "0dmzk17hd0c6lzjlipjpc52jdifknpvxq15javn19n3f9yvxxdpm")))) + (base32 "14hxs2w51qgg67kqkxpy02kd4q8gb7vayj85kcp8qvda1q1xasfv")))) (build-system pyproject-build-system) (arguments (list - #:phases - #~(modify-phases %standard-phases - (add-before 'check 'pre-check - (lambda _ - (setenv "PY_IGNORE_IMPORTMISMATCH" "1")))))) - (native-inputs - (list python-pytest - python-setuptools - python-setuptools-scm)) - (propagated-inputs - (list python-numpy)) - (home-page "https://github.com/python-quantities/python-quantities") - (synopsis "Support for physical quantities with units, based on NumPy") - (description - "Quantities is designed to handle arithmetic and conversions of physical -quantities, which have a magnitude, dimensionality specified by various units, -and possibly an uncertainty. It builds on the NumPy library and is designed -to work with @code{numpy.ufuncs}, many of which are already supported.") - ;; OSI approved, BSD like, see doc/user/license.rst. - (license license:bsd-3))) + ;; tests: 85 passed, 3 deselected, 43 warnings + #:test-flags + #~(list + ;; These tests failed with the python-pandas update. + "--deselect=tests/test_parametric.py::TestParametric::test_ancova" + "--deselect=tests/test_parametric.py::TestParametric::test_anova" + "--deselect=tests/test_pandas.py::TestParametric::test_pandas"))) + (native-inputs + (list python-pytest + python-setuptools)) + (propagated-inputs + (list python-matplotlib + python-mpmath + python-numpy + python-pandas + python-pandas-flavor + python-scikit-learn + python-scipy + python-seaborn + python-statsmodels + python-tabulate)) + (home-page "https://pingouin-stats.org/") + (synopsis "Statistical package for Python") + (description "Pingouin is a statistical package written in Python 3 and +based mostly on Pandas and NumPy. Its features include -;; XXX: Deprecated on <2026-06-08>. -(define-deprecated/public-alias hugs (@ (gnu packages physiscs) python-qutip)) +@itemize +@item ANOVAs: N-ways, repeated measures, mixed, ancova +@item Pairwise post-hocs tests (parametric and non-parametric) and pairwise +correlations +@item Robust, partial, distance and repeated measures correlations +@item Linear/logistic regression and mediation analysis +@item Bayes Factors +@item Multivariate tests +@item Reliability and consistency +@item Effect sizes and power analysis +@item Parametric/bootstrapped confidence intervals around an effect size or a +correlation coefficient +@item Circular statistics +@item Chi-squared tests +@item Plotting: Bland-Altman plot, Q-Q plot, paired plot, robust correlation, +and more +@end itemize") + (license license:gpl3))) -(define-public python-ruffus +(define-public python-pint (package - (name "python-ruffus") - (version "2.8.4") + (name "python-pint") + (version "0.25.3") (source (origin - (method url-fetch) - (uri (pypi-uri "ruffus" version)) + (method git-fetch) + (uri (git-reference + (url "https://github.com/hgrecco/pint") + (commit version))) + (file-name (git-file-name name version)) (sha256 - (base32 "1ai673k1s94s8b6pyxai8mk17p6zvvyi87rl236fs6ls8mpdklvc")))) + (base32 "0ra25yfvjm5fpc47wm2dk8vicpdblvjjizbs0n1ak5d65mqinv4p")))) (build-system pyproject-build-system) (arguments (list + ;; tests: 2191 passed, 142 skipped, 11 xfailed, 9 warnings, 298 subtests + ;; passed + #:test-flags #~(list "--ignore=pint/testsuite/benchmarks") #:phases #~(modify-phases %standard-phases - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (with-directory-excursion "ruffus/test" - (invoke "bash" "run_all_unit_tests3.cmd")))))))) - (native-inputs (list python-pytest python-setuptools)) - (home-page "http://www.ruffus.org.uk") - (synopsis "Light-weight computational pipeline management") + (add-before 'check 'pre-check + (lambda _ + ;; PermissionError: [Errno 13] Permission denied: + ;; '/homeless-shelter' + (setenv "HOME" "/tmp")))))) + (native-inputs + (list python-hatch-vcs + python-hatchling + python-pytest + python-pytest-mpl + python-pytest-subtests)) + (propagated-inputs + (list python-flexcache + python-flexparser + python-platformdirs + python-typing-extensions)) + (home-page "https://github.com/hgrecco/pint") + (synopsis "Physical quantities module") (description - "Ruffus is designed to allow scientific and other analyses to be -automated with the minimum of fuss and the least effort.") - (license license:expat))) + "Pint is a Python package to define, operate and manipulate physical +quantities: the product of a numerical value and a unit of measurement. It +allows arithmetic operations between them and conversions from and to +different units.") + (license license:bsd-3))) -(define-public python-salib +(define-public python-plotly (package - (name "python-salib") - (version "1.5.2") + (name "python-plotly") + (version "6.8.0") (source (origin (method git-fetch) (uri (git-reference - (url "https://github.com/SALib/SALib") + (url "https://github.com/plotly/plotly.py") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "0v7l6qbxgclz644fq1vmakfasxcdhg1g019b5w47hlxqw8fx0ipl")))) + (base32 "147vgm22zrg4wcjc427mxszbb8v6vhs7hgchcm8678cy304hawvd")))) (build-system pyproject-build-system) - ;; tests: 190 passed, 1 xfailed, 28 warnings (arguments (list + ;; tests: 3039 passed, 24 skipped, 292 deselected, 4 xfailed, 556 warnings + #:test-flags + ;; Missing dependencies. + #~(list "--ignore=plotly/matplotlylib/mplexporter/tests/test_basic.py" + "--ignore=plotly/matplotlylib/mplexporter/tests/test_utils.py" + "--ignore=plotly/matplotlylib/tests/test_renderer.py" + "--ignore=tests/test_io/test_renderers.py" + "--ignore=tests/test_optional/test_kaleido/test_kaleido.py" + ;; XXX: Combination of missing packages and assertion errors. + "-k" (string-join + (list "not test_acceptance_named" + "test_colorscale_and_levels_same_length" + "test_correct_order_param" + "test_date_in_hover" + "test_dependencies_not_imported" + "test_fips_values_same_length" + "test_from_json_output_type" + "test_get_module_exists_submodule" + "test_iplot_mpl_works" + "test_iplot_works_after_you_call_init_notebook_mode" + "test_iplot_works_without_init_notebook_mode" + "test_lazy_imports" + "test_ols_trendline_slopes" + "test_overall_trendline" + "test_read_json_from_file_string" + "test_read_json_from_filelike" + "test_read_json_from_pathlib" + "test_render_mode" + "test_scope_is_not_list" + "test_trendline_enough_values" + "test_trendline_nan_values" + "test_trendline_on_timeseries" + "test_trendline_results_passthrough") + " and not ")) #:phases #~(modify-phases %standard-phases - ;; Remove this phase on the next update, it is already in master. - (add-before 'build 'fix-for-pandas-3 + (add-before 'build 'skip-npm + ;; npm is not packaged so build without it (lambda _ - (substitute* "src/SALib/analyze/sobol.py" - (("np\\.array\\(\\[0\\.0\\]\\)") - "np.float64(0.0)"))))))) + (setenv "SKIP_NPM" "T")))))) + ;; XXX: Plotly requires a long list of test only packages, do not + ;; propagate them, see: + ;; . (native-inputs - (list python-hatch-vcs + (list ;; python-anywidget ;not packaged yet in Guix + python-colorcet + python-geopandas python-hatchling - python-pytest)) - (propagated-inputs - (list python-matplotlib - python-multiprocess + python-inflect + ;; python-kaleido ;not packaged yet in Guix python-numpy - python-pandas - python-scipy)) - (home-page "https://salib.readthedocs.io/en/latest/") - (synopsis "Tools for global sensitivity analysis") - (description "SALib provides tools for global sensitivity analysis. It -contains Sobol', Morris, FAST, DGSM, PAWN, HDMR, Moment Independent and -fractional factorial methods.") + python-orjson + python-pandas-minimal + ;; python-pdfrw ;not packaged yet in Guix + python-pillow + ;; python-plotly-geo ;not packaged yet in Guix + python-polars + python-pyarrow + python-pyshp + python-pytest + python-pytz + python-scikit-image + python-scipy-minimal + python-shapely + python-statsmodels + python-xarray + tzdata-for-tests)) + (propagated-inputs + (list python-narwhals + python-packaging)) + (home-page "https://plotly.com/python/") + (synopsis "Interactive plotting library for Python") + (description + "Plotly's Python graphing library makes interactive,publication-quality +graphs online. Examples of how to make line plots, scatter plots, area +charts, bar charts, error bars, box plots, histograms, heatmaps, subplots, +multiple-axes, polar charts, and bubble charts.") (license license:expat))) -(define-public python-scikit-allel +(define-public python-plotnine (package - (name "python-scikit-allel") - (version "1.3.13") + (name "python-plotnine") + (version "0.15.7") (source (origin - (method url-fetch) - (uri (pypi-uri "scikit_allel" version)) + (method git-fetch) + (uri (git-reference + (url "https://github.com/has2k1/plotnine") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) (sha256 - (base32 "0d9yadzhsjjqkh6rz273f53iwczk0c7pv9dajzcrmfnk036b8f4s")))) + (base32 "0cf8bv9cjjdd0qa77kq6kpspwmbg8px6s5s5zplrns9awlskn8zg")))) (build-system pyproject-build-system) (arguments (list #:test-flags - '(list "-k" - (string-append - ;; AttributeError: 'Dataset' object has no attribute 'asstr' - "not test_vcf_to_hdf5" - " and not test_vcf_to_hdf5_exclude" - " and not test_vcf_to_hdf5_rename" - " and not test_vcf_to_hdf5_group" - " and not test_vcf_to_hdf5_ann" - ;; Does not work with recent hmmlearn - " and not test_roh_mhmm_0pct" - " and not test_roh_mhmm_100pct")) - #:phases - '(modify-phases %standard-phases - (add-before 'check 'build-ext - (lambda _ - (invoke "python" "setup.py" "build_ext" "--inplace")))))) - (propagated-inputs - (list python-dask python-numpy)) - (native-inputs - (list htslib - python-cython - python-h5py - python-hmmlearn - python-numexpr - python-numpy - python-pytest - python-setuptools - python-setuptools-scm - python-wheel - python-zarr)) - (home-page "https://github.com/cggh/scikit-allel") - (synopsis "Explore and analyze genetic variation data") - (description - "This package provides utilities for exploratory analysis of large scale -genetic variation data.") - (license license:expat))) - -(define-public python-scikit-base - (package - (name "python-scikit-base") - (version "1.0.2") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/sktime/skbase") - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) - (sha256 - (base32 "1436l0jr6avyhz2dg3driykn6rwskwyf57aig7x3pwak6w3il6rv")))) - (build-system pyproject-build-system) - (native-inputs - (list python-numpy - python-pandas-minimal - python-pytest - python-scikit-learn - python-scipy-minimal - python-setuptools - python-toml)) - (home-page "https://github.com/sktime/skbase") - (synopsis "Base classes for sklearn-like parametric objects") + ;; XXX: Check for any new failing tests during next update cycle. + ;; These all fail because the images are considered to be too different, + ;; though they really do look fine. + ;; See https://github.com/has2k1/plotnine/issues/627 + `(list ,@(map (lambda (file) (string-append "--ignore=" file)) + (list "tests/test_aes.py" + "tests/test_annotation_logticks.py" + "tests/test_coords.py" + "tests/test_facet_labelling.py" + "tests/test_facets.py" + "tests/test_layout.py" + "tests/test_position.py" + "tests/test_qplot.py" + "tests/test_plot_composition.py" + "tests/test_scale_internals.py" + "tests/test_scale_labelling.py" + "tests/test_theme.py")) + "--ignore-glob=tests/test_geom*.py" + "--ignore-glob=tests/test_stat*.py" + "-k" ; Other failures + (string-append "not " + (string-join + (list + ;; This triggers an unexpected but harmless + ;; warning. + "test_save_method" + ;; This test fails to set the locale. + "test_no_after_scale_warning" + ;; Missing optional modules + "test_non_linear_smooth" + "test_non_linear_smooth_no_ci") + " and not " + 'infix))) + #:phases + #~(modify-phases %standard-phases + (add-before 'check 'pre-check + (lambda* (#:key inputs outputs #:allow-other-keys) + ;; The data files are referenced by the tests but they are not + ;; installed. + (copy-recursively "plotnine/data" + (string-append (site-packages inputs + outputs) + "/plotnine/data")) + (setenv "CI" "1") ;skip tests that are known to fail on CI. + ;; Matplotlib needs to be able to write its configuration file + ;; somewhere. + (setenv "MPLCONFIGDIR" "/tmp") + (setenv "TZ" "UTC") + (setenv "TZDIR" + (search-input-directory inputs "share/zoneinfo"))))))) + (propagated-inputs (list python-adjusttext + python-matplotlib + python-mizani + python-numpy + python-patsy + python-scipy + python-statsmodels)) + (native-inputs (list python-geopandas + python-mock + python-pandas + python-pytest + python-setuptools + python-setuptools-scm + python-wheel + tzdata-for-tests)) + (home-page "https://github.com/has2k1/plotnine") + (synopsis "Grammar of Graphics for Python") (description - "@code{skbase} provides base classes for creating scikit-learn-like -parametric objects, along with tools to make it easier to build your own -packages that follow these design patterns.") - (license license:bsd-3))) - -(define-public python-scikit-build-core - (package - (name "python-scikit-build-core") - (version "0.12.2") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/scikit-build/scikit-build-core") - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) - (sha256 - (base32 "18xh572ndd0dww7czic775p6n8y5kxd072fj7xdhxwykdxr0bl2g")))) - (build-system pyproject-build-system) - (arguments - (list - ;; tests: 414 passed, 63 skipped, 75 deselected, 1 xfailed - #:test-flags #~(list "-m" "not isolated and not network"))) - (native-inputs - (list python-cattrs-minimal - python-hatch-vcs - python-hatchling - python-pypa-build - python-pytest - python-pytest-subprocess - python-virtualenv)) - (propagated-inputs - (list cmake-minimal - pybind11 - python-packaging - python-pathspec)) - (home-page "https://github.com/scikit-build/scikit-build-core") - (synopsis "Build backend for CMake based projects") - (description "Scikit-build-core is a build backend for Python that uses -CMake to build extension modules. It has a simple yet powerful static -configuration system in pyproject.toml, and supports almost unlimited -flexibility via CMake. It was initially developed to support the demanding -needs of scientific users, but can build any sort of package that uses -CMake.") - (license license:asl2.0))) - -(define-public python-scikit-build-core-bootstrap - (hidden-package - (package/inherit python-scikit-build-core - (arguments - (list #:tests? #f)) - (native-inputs - (list python-hatch-vcs - python-hatchling)) - (propagated-inputs - (list python-packaging - python-pathspec))))) + "Plotnine is a Python implementation of the Grammar of Graphics. +It is a powerful graphics concept for creating plots and visualizations in a +structured and declarative manner. It is inspired by the R package ggplot2 +and aims to provide a similar API and functionality in Python.") + (license license:expat))) -(define-public python-scikit-fem +(define-public python-pods (package - (name "python-scikit-fem") - (version "11.0.0") + (name "python-pods") + (version "0.1.17") (source (origin - (method git-fetch) ; no tests in PyPI - (uri (git-reference - (url "https://github.com/kinnala/scikit-fem") - (commit version))) - (file-name (git-file-name name version)) + (method url-fetch) + (uri (pypi-uri "pods" version)) (sha256 - (base32 "13zh57raz2qcdfhsvpdlyiba5q0s0lh5b3gmsmh4cfrncrkdh6mh")))) + (base32 "1z57jdwml2jzr2dq20p7pzx3ayhajgfd2d0xqjvgzx576hp2z1ac")))) (build-system pyproject-build-system) - (arguments - (list - #:test-flags #~(list - ;; Tests require Jax. - "--ignore=tests/test_autodiff.py" - "--ignore=tests/test_examples.py"))) + ;; Tests depend on Nose framework and try to download test data from + ;; . + (arguments (list #:tests? #f)) (native-inputs - (list python-autograd - python-pyamg - ;; python-jax ; not packed yet - python-pytest - python-shapely - python-setuptools)) + (list python-poetry-core)) (propagated-inputs - (list python-meshio - python-numpy - python-matplotlib - python-scipy)) - (home-page "https://scikit-fem.readthedocs.io/en/latest/") - (synopsis "Library for performing finite element assembly") - (description - "@code{scikit-fem} is a library for performing finite element assembly. -Its main purpose is the transformation of bilinear forms into sparse matrices -and linear forms into vectors.") + (list python-pandas + python-pyyaml + python-scipy + python-tables)) + (home-page "https://github.com/lawrennd/ods") + (synopsis "Python software for Open Data Science") + (description "This package provides utilities and tools for open data +science including tools for accessing data sets in Python.") (license license:bsd-3))) -(define-public python-scikit-fuzzy +(define-public python-polars (package - (name "python-scikit-fuzzy") - (version "0.5.0") + (name "python-polars") + (version "1.38.1") (source (origin (method url-fetch) - (uri (pypi-uri "scikit_fuzzy" version)) + (uri (pypi-uri "polars" version)) (sha256 - (base32 "0zsfyd8cpd2l82fwh3smxbwhb3bkqwlq17cbav53axma4c2k9r9f")))) + (base32 "0fc2fx2p72g01nhhhfs1fzbwz58rcj7zppascanq1y2f6kjjnfl0")))) (build-system pyproject-build-system) - (arguments - (list - #:test-flags #~(list "--pyargs" "skfuzzy"))) - (native-inputs - (list python-pytest python-setuptools python-wheel)) - (propagated-inputs - (list python-networkx python-numpy python-scipy)) - (home-page "https://github.com/scikit-fuzzy/scikit-fuzzy") - (synopsis "Fuzzy logic toolkit for SciPy") + ;; The wheel doesn't have tests. + ;; TODO On the next update, hopefully if delete-all-but has made it + ;; into guix, switch to a git-source and keep src/polars and tests + ;; subdirectories. + (arguments (list #:tests? #f)) + (propagated-inputs (list python-polars-runtime-32)) + (native-inputs (list python-setuptools)) + (home-page "https://pola.rs/") + (synopsis "Blazingly fast DataFrame library") (description - "This package implements many useful tools for projects involving fuzzy -logic, also known as grey logic.") - (license license:bsd-3))) + "Polars is a DataFrame library for manipulating structured data.") + (license license:expat))) -(define-public python-scikit-image +(define-public python-polars-runtime-32 (package - (name "python-scikit-image") - (version "0.26.0") + (name "python-polars-runtime-32") + (version "1.38.1") (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/scikit-image/scikit-image") - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) - ;; TODO: Remove patch when refreshing python-scikit-image. - ;; Prevent deprecation warning from python-pillow 12.1.1. - (patches - (search-patches "python-scikit-image-fix-python-pillow.patch")) + (method url-fetch) + (uri (pypi-uri "polars_runtime_32" version)) (sha256 - (base32 "1x90jad3jqin8ws1j1i89zrajpcbn1h87nl5yxxf5cs3b7ha13rf")))) + (base32 "1v72zkyhcziiizpymjlh2d5rwnkmvhlp18ln8brp31y5yp8hxwh4")))) (build-system pyproject-build-system) (arguments (list - #:test-flags - #~(list "--ignore=benchmarks/" - ;; RuntimeWarning: divide by zero encountered in scalar divide - ;; (see: - ;; ). - "-k" "not test_ellipse_parameter_stability"))) - (propagated-inputs - (list python-imageio - python-lazy-loader - python-networkx - python-numpy - python-packaging - python-pillow - python-scipy - python-tifffile - ;; [optional] - ;; python-astropy - ;; python-cloudpickle - ;; python-dask - ;; python-matplotlib - ;; python-pooch - ;; python-pyamg - ;; python-pywavelets - ;; python-scikit-learn - #;python-simpleitk)) + #:imported-modules `(,@%cargo-build-system-modules + ,@%pyproject-build-system-modules) + #:modules '(((guix build cargo-build-system) #:prefix cargo:) + (guix build pyproject-build-system) + (guix build utils)) + ;; There are rust tests which would be costly to run, but no python ones. + #:tests? #f + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'build-without-rust-nightly + (lambda _ + ;; Add cargo flags that allow compilation without Rust nightly. + (substitute* "pyproject.toml" + ((".*tool.maturin.*" all) + (string-append all "no-default-features = true\n" + "features = [\"full\"]\n"))))) + (add-after 'unpack 'fix-tikv-jemallocator + (lambda _ + ;; removes a patch.crates-io option that is packaged in + ;; gnu/packages/rust-sources: rust-tikv-jemallocator-for-polars + (substitute* "Cargo.toml" + (("^tikv-jemallocator.*") "")))) + ;; jemalloc needs unbundling for tikv-jemallocator-sys + (add-before 'build 'override-jemalloc + (lambda* (#:key inputs #:allow-other-keys) + (let ((jemalloc (assoc-ref inputs "jemalloc"))) + ;; This flag is needed when not using the bundled jemalloc. + ;; https://github.com/tikv/jemallocator/issues/19 + (setenv "CARGO_FEATURE_UNPREFIXED_MALLOC_ON_SUPPORTED_PLATFORMS" "1") + (setenv "JEMALLOC_OVERRIDE" + (string-append jemalloc "/lib/libjemalloc_pic.a"))))) + (add-after 'unpack 'prepare-cargo-build-system + (lambda args + (for-each + (lambda (phase) + (format #t "Running cargo phase: ~a~%" phase) + (apply (assoc-ref cargo:%standard-phases phase) + #:cargo-target #$(cargo-triplet) + args)) + '(prepare-rust-crates + unpack-rust-crates + configure + check-for-pregenerated-files + patch-cargo-checksums))))))) + (inputs + (cons* jemalloc + lz4 + (list zstd "lib") + (cargo-inputs 'python-polars-runtime-32))) (native-inputs - (list python-meson - python-pytest - python-pytest-localserver - python-pytest-pretty - python-pythran)) - (home-page "https://scikit-image.org/") - (synopsis "Image processing in Python") - (description - "Scikit-image is a collection of algorithms for image processing.") - (license license:bsd-3))) + (append + (list maturin + pkg-config + rust + `(,rust "cargo")) + (or (and=> (%current-target-system) + (compose list make-rust-sysroot)) + '()))) + (home-page "https://pola.rs/") + (synopsis "Blazingly fast DataFrame library") + (description "Polars is an analytical query engine written for DataFrames. +It is designed to be fast, easy to use and expressive.") + (properties '(("upstream-name" . "polars-runtime-32") + (tunable? . #true))) + (license license:expat))) -(define-public python-scikit-misc +(define-public python-pyamg (package - (name "python-scikit-misc") - (version "0.5.1") - (source - (origin - (method url-fetch) - (uri (pypi-uri "scikit_misc" version)) - (sha256 - (base32 "18sj7qa3kk4pqh3rzg2c64lf03nciv9cf985yh1h2kpqqndgdhf5")))) - (build-system pyproject-build-system) + (name "python-pyamg") + (version "5.3.0") + (source (origin + (method url-fetch) + (uri (pypi-uri "pyamg" version)) + (modules '((guix build utils))) + (snippet + ;; Delete autogenerated files, regenerate in a phase. + #~(begin + (for-each + (lambda (file) + (delete-file (string-append "pyamg/amg_core/" file))) + '("air_bind.cpp" + "evolution_strength_bind.cpp" + "graph_bind.cpp" + "krylov_bind.cpp" + "linalg_bind.cpp" + "relaxation_bind.cpp" + "ruge_stuben_bind.cpp" + "smoothed_aggregation_bind.cpp" + "tests/bind_examples_bind.cpp")))) + (sha256 + (base32 + "02w6xy3i0qcpsfc64zw8k15mi6qykq65h3d98vi9p6fdlkqx08sk")))) (arguments (list - #:test-flags - '(list "--pyargs" "skmisc") + ;; tests: 40 passed, 1 skipped #:phases #~(modify-phases %standard-phases - (add-after 'unpack 'fix-version + ;; Regenerate the autogenerated files. + (add-after 'unpack 'amg-core-bind-them (lambda _ - (call-with-output-file "skmisc/_version.py" - (lambda (port) - (display (string-append "__version__ = \"" #$version "\"") - port))) - (substitute* "meson.build" - (("^ version: run_command.*") - (string-append " version: '" #$version "',\n"))) - (substitute* "pyproject.toml" - (("dynamic = \\['version'\\]") - (string-append "version = \"" #$version "\"")))))))) - (native-inputs - (list gfortran - python-meson - python-spin - python-pytest - python-setuptools)) - (propagated-inputs - (list python-numpy)) - (home-page "https://has2k1.github.io/scikit-misc/stable") - (synopsis "Miscellaneous tools for scientific computing.") - (description "This package provides miscellaneous tools for data analysis -and scientific computing.") - (license license:bsd-3))) - -(define-public python-scikit-opt - (package - (name "python-scikit-opt") - (version "0.6.6") - (source - (origin - (method url-fetch) - (uri (pypi-uri "scikit-opt" version)) - (sha256 - (base32 "0ycqizgsj7q57asc1bphzhf1fx9zqn0vx5rli7q541bas64hfqiy")))) + ;; bindthem.py heavily depends on location to produce *_bind.cpp + ;; file, make it available in tests as well. + (copy-file "pyamg/amg_core/bindthem.py" + "pyamg/amg_core/tests/bindthem.py") + (with-directory-excursion "pyamg/amg_core" + (substitute* "bindthem.py" + (("/usr/bin/env python3") (which "python3"))) + (invoke "sh" "generate.sh")) + (with-directory-excursion "pyamg/amg_core/tests" + (invoke "python" "bindthem.py" "bind_examples.h")))) + (add-before 'check 'pre-check + (lambda _ + (copy-recursively "pyamg/tests" "tests") + (delete-file-recursively "pyamg")))))) (build-system pyproject-build-system) (native-inputs - (list python-pytest - python-setuptools)) + (list pybind11-2 + python-cppheaderparser + python-pytest + python-pyyaml + python-setuptools + python-setuptools-scm)) (propagated-inputs (list python-numpy - python-pytorch python-scipy)) - (home-page "https://github.com/guofei9987/scikit-opt") - (synopsis "Swarm intelligence algorithms in Python") - (description - "Scikit-opt (or sko) is a Python module implementing @dfn{swarm -intelligence} algorithms: genetic algorithm, particle swarm optimization, -simulated annealing, ant colony algorithm, immune algorithm, artificial fish -swarm algorithm.") + (home-page "https://github.com/pyamg/pyamg") + (synopsis "Algebraic Multigrid Solvers in Python") + (description "PyAMG is a Python library of Algebraic Multigrid +(AMG) solvers. It features implementations of: +@itemize +@item Ruge-Stuben (RS) or Classical AMG +@item AMG based on Smoothed Aggregation (SA) +@item Adaptive Smoothed Aggregation (αSA) +@item Compatible Relaxation (CR) +@item Krylov methods such as CG, GMRES, FGMRES, BiCGStab, MINRES, etc. +@end itemize") (license license:expat))) -(define-public python-scikit-optimize - ;; XXX: The project might be not maintained, see - ;; . +(define-public python-pydicom (package - (name "python-scikit-optimize") - (version "0.10.2") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/holgern/scikit-optimize") - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) - (sha256 - (base32 "0pc6avzxz8l32km5jvv3maih0a5x2akxybvxl2hdg04qz2l0kz8b")))) + (name "python-pydicom") + (version "2.4.4") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/pydicom/pydicom") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0ksyyc1hbhyqy289a2frn84ss29fb7czirx3dkxx56f4ia33b4c8")))) (build-system pyproject-build-system) (arguments (list - ;; tests: 398 passed, 1 skipped, 179 warnings #:test-flags - #~(list "--numprocesses" (number->string (parallel-job-count)) - "-k" (string-join - ;; XXX: As the project is not actively maintained, review - ;; failing test when a fresh release is available. - (list "not test_acq_optimizer" - "test_acq_optimizer_with_time_api" - "test_categorical_init_vals" - "test_consistent_x_iter_dimensions" - "test_early_stopping_delta_x" - "test_early_stopping_delta_x_empty_result_object" - "test_early_stopping_delta_y" - "test_early_stopping_delta_y_with_x0" - "test_exhaust_initial_calls" - "test_fixed_random_states" - "test_init_points_and_models" - "test_init_vals" - "test_init_vals_and_models" - "test_minimizer_api" - "test_minimizer_api_random_only" - "test_minimizer_space_constraint" - "test_minimizer_with_space" - "test_mixed_spaces" - "test_optimizer_base_estimator_string_smoke" - "test_optimizer_base_estimator_string_smoke_njobs" - "test_per_second_api" - "test_repeated_x" - "test_tree_based_minimize") - " and not ")))) + ;; Skip tests that require networking. + #~(list "-k" (string-append + "not test_jpeg_ls_pixel_data.py" + " and not test_gdcm_pixel_data.py" + " and not test_pillow_pixel_data.py" + " and not test_rle_pixel_data.py" + " and not Test_JPEG_LS_Lossless_transfer_syntax" + " and not test_numpy_pixel_data.py" + " and not test_data_manager.py" + " and not test_handler_util.py" + " and not test_overlay_np.py" + " and not test_encoders_pydicom.py" + " and not test_encaps.py" + " and not test_reading_ds_with_known_tags_with_UN_VR" + " and not TestDatasetOverlayArray" + " and not TestReader" + " and not test_filewriter.py")))) + (native-inputs (list python-pytest python-flit-core)) + (inputs (list gdcm libjpeg-turbo)) + (propagated-inputs (list python-numpy python-pillow)) + (home-page "https://github.com/pydicom/pydicom") + (synopsis "Python library for reading and writing DICOM data") + (description "@code{python-pydicom} is a Python library for reading and +writing DICOM medical imaging data. It can read, modify and write DICOM +data.") + (license license:expat))) + +(define-public python-pyet + (package + (name "python-pyet") + (version "1.3.1") + (source + (origin + (method url-fetch) + (uri (pypi-uri "pyet" version)) + (sha256 + (base32 "1dblsx0bv1g453hcx5vwij1zgankwgwvhwllqkn47k578h038xvy")))) + (build-system pyproject-build-system) (native-inputs - (list python-pytest - python-pytest-xdist - python-setuptools)) + (list python-mock + python-pytest + python-setuptools + python-wheel)) (propagated-inputs - (list python-joblib - python-matplotlib - python-numpy - python-pyaml - python-scikit-learn - python-scipy)) - (home-page "https://scikit-optimize.github.io/") - (synopsis "Sequential model-based optimization toolbox") + (list python-pandas + python-xarray)) + (home-page "https://github.com/pyet-org/pyet") + (synopsis "Python package for evapotranspiration calculation") (description - "Scikit-Optimize, or @code{skopt}, is a simple and efficient library to -minimize (very) expensive and noisy black-box functions. It implements -several methods for sequential model-based optimization. @code{skopt} aims to -be accessible and easy to use in many contexts.") - (license license:bsd-3))) + "This package provides a Python library for calculating +Evapotranspiration using various standard methods.") + (license license:expat))) -(define-public python-scikit-surprise +(define-public python-pyjanitor (package - (name "python-scikit-surprise") - (version "1.1.5") + (name "python-pyjanitor") + (version "0.32.23") (source (origin (method git-fetch) (uri (git-reference - (url "https://github.com/NicolasHug/Surprise") + (url "https://github.com/pyjanitor-devs/pyjanitor") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "1jw05xb8w7d5vx0v8gjd51a5bp1zwqy5adcpaf8fy5mfrdjn6hpp")))) + (base32 "1mvgabsn5jl2aidh2mcqdmh60p2g514nb5sxwskhz1q57pk4m0w9")))) (build-system pyproject-build-system) + ;; Pyjanitor has an extensive test suite. For quick debugging, the tests + ;; marked turtle can be skipped using "-m" "not turtle". (arguments (list - ;; tests: 82 passed + ;; tests: 1030 passed, 2 skipped, 42 xfailed, 6 xpassed, 594 warnings + #:test-flags + ;; The tests take quite long, so consider adding the "-n" line and + ;; adding python-pytest-xdist to the native-inputs when testing. + ;; However, the tests are not deterministic, enen they are enabled in + ;; project's CI (.github/workflows/tests.yml), when ran with "-n, + ;; --numprocesses" , so disable again before committing. + #~(list ;; "--numprocesses" (number->string (min 8 (parallel-job-count))) + ;; Test files are not included. + "--ignore=tests/io/test_read_csvs.py" + ;; Polars has not been packaged yet. + "--ignore=tests/polars/" + ;; PySpark has not been packaged yet. + "--ignore=tests/spark/" + ;; Flaky test (fails for performance reasons) + "--deselect=tests/math/test_ecdf.py::test_ecdf_string" + ;; Tries to connect to the internet. + "-k" (string-append "not test_is_connected" + ;; Test files are not included. + " and not test_read_commandline_bad_cmd" + ;; XXX: Fatal Python error: Segmentation fault + " and not test_maccs_keys_fingerprint" + " and not test_morgan_fingerprint_counts" + " and not test_morgan_fingerprint_bits" + ;; AssertionError: DataFrame.iloc[:, 1] + ;; (column name="cities") are different + " and not test_various_sorted")) #:phases #~(modify-phases %standard-phases - (add-before 'sanity-check 'set-home + (add-before 'check 'set-env-ci (lambda _ - ;; Change from /homeless-shelter to /tmp for write - ;; permission. - (setenv "HOME" "/tmp")))))) - (native-inputs - (list python-cython - python-pandas-minimal - python-pytest - python-setuptools)) - (propagated-inputs - (list python-joblib - python-numpy - python-scikit-learn)) - (home-page "https://surpriselib.com/") - (synopsis "Recommender system library for Scikit-learn") + ;; Some tests are skipped if the JANITOR_CI_MACHINE + ;; variable is not set. + (setenv "JANITOR_CI_MACHINE" "1")))))) + (propagated-inputs (list python-janitor-rs + python-multipledispatch + python-natsort + python-pandas-flavor + python-scipy + ;; [optional] + python-biopython + python-unyt)) + (native-inputs (list python-numba + python-openpyxl + python-pytest + ;;python-pytest-xdist ;only for -n when testing + ;; TODO: Remove python-requests and inject its target + ;; data to make the package behaviour reproducible. + python-requests + python-setuptools + rdkit)) + (home-page "https://github.com/pyjanitor-devs/pyjanitor") + (synopsis "Tools for cleaning and transforming Pandas DataFrames") (description - "This package provides a Python library for building and analyzing -recommender systems that deal with explicit rating data. It was designed with -the following purposes in mind: -@itemize -@item Provide tools to handle downloaded or user-provided datasets. -@item Provide ready-to-use prediction algorithms and similarity measures. -@item Provide a base for creating custom algorithms. -@item Provide tools to evaluate, analyse and compare algorithm performance. -@item Provide documentation with precise details regarding library algorithms. -@end itemize") - (license license:bsd-3))) + "@code{pyjanitor} provides a set of data cleaning routines for +@code{pandas} DataFrames. These routines extend the method chaining API +defined by @code{pandas} for a subset of its methods. Originally, this +package was a port of the R package by the same name and it is inspired by the +ease-of-use and expressiveness of the @code{dplyr} package.") + (license license:expat))) -(define-public python-scikit-survival +(define-public python-pykdtree (package - (name "python-scikit-survival") - (version "0.26.0") + (name "python-pykdtree") + (version "1.4.2") (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/sebp/scikit-survival") - (commit (string-append "v" version)) - ;; TODO: This package contains a copy of Eigen in - ;; sksurv/linear_model/src. It would be good to figure out - ;; how to use our own Eigen package. - (recursive? #true))) - (file-name (git-file-name name version)) + (method url-fetch) + (uri (pypi-uri "pykdtree" version)) (sha256 - (base32 "0r0xi9saz247ph6bgrc3iknq0m60d8rs4sl4mdv4s1zja80w1cp8")))) + (base32 "1xb5xdp32s5ffcbbb6vlrj4i70hdknajvr9yhzx0wld52rx9caxx")))) (build-system pyproject-build-system) (arguments (list - ;; tests: 1013 passed, 105 warnings - #:test-flags - #~(list "--durations=10" ;to help in spotting long running tests - "--numprocesses" (number->string (min 4 (parallel-job-count)))))) - (propagated-inputs - (list python-ecos - python-joblib - python-numexpr - python-numpy - python-osqp - python-pandas - python-scikit-learn - python-scipy)) + ;; FIXME: Tests are unable to import properly, but it seems to work in + ;; real conditions. + #:tests? #f + #:phases + #~(modify-phases %standard-phases + (add-after 'install 'fix-site-packages + (lambda* (#:key inputs outputs #:allow-other-keys) + (with-directory-excursion (site-packages inputs outputs) + (for-each delete-file (find-files "." "test*")))))))) (native-inputs - (list python-cython - python-packaging - python-pytest - python-pytest-xdist - python-setuptools - python-setuptools-scm)) - (home-page "https://github.com/sebp/scikit-survival") - (synopsis "Survival analysis built on top of scikit-learn") - (description "Scikit-survival is a Python module for survival analysis -built on top of scikit-learn. It allows doing survival analysis while -utilizing the power of scikit-learn, e.g., for pre-processing or doing -cross-validation.") - (license license:gpl3+))) + (list python-cython python-pytest python-setuptools python-wheel)) + (propagated-inputs + (list python-numpy)) + (home-page "https://github.com/storpipfugl/pykdtree") + (synopsis "Fast kd-tree implementation with OpenMP-enabled queries") + (description + "@code{pykdtree} is a kd-tree implementation for fast nearest neighbour +search in Python.") + (license license:lgpl3+))) -(define-public python-scipy +(define-public python-pylems (package - (name "python-scipy") - (version "1.17.1") - ;; TODO: PyPI archive bundles extra in subprojects: - ;; - https://github.com/boostorg/math - ;; - https://github.com/scipy/HiGHS - ;; - https://github.com/scipy/xsf - ;; - qhull + (name "python-pylems") + (version "0.6.9") (source (origin - (method url-fetch) - (uri (pypi-uri "scipy" version)) + (method git-fetch) + (uri (git-reference + (url "https://github.com/LEMS/pylems") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) (sha256 - (base32 "1h4pn8i33cf5jzlh6hs6sjg10i8x1ch35y5f4v11d26bv09f1n4m")))) + (base32 "0gimdx89cdla1b6zzkdrmj979nn2zy2475qvpwxxas0iv27ql0vj")))) + (build-system pyproject-build-system) + (arguments + ;; Disable tests that require networking + (list #:test-flags #~(list "./lems/test" "-k" "not test_load_write_xml"))) + (native-inputs (list python-setuptools python-pytest)) + (propagated-inputs (list python-lxml python-matplotlib)) + (home-page "https://github.com/LEMS/pylems") + (synopsis + "Python support for the Low Entropy Model Specification language (LEMS)") + (description "A @acronym{LEMS, Low Entropy Model Specification} simulator +written in Python which can be used to run NeuroML2 models.") + (license license:lgpl3))) + +(define-public python-pymcubes + (package + (name "python-pymcubes") + (version "0.1.6") + (source + (origin + (method git-fetch) ; no tests in PyPI + (uri (git-reference + (url "https://github.com/pmneila/PyMCubes") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1v2qhc4pwanx6a8k843mbh45yk77n3w63sy5lzk5c3q4pkvfj1b9")))) (build-system pyproject-build-system) (arguments (list - ;; tests: 81362 passed, 7493 skipped, 313 xfailed, 28 xpassed, 225 warnings - #:configure-flags - ''(("setup-args" . #("-Duse-system-libraries=all"))) - #:test-flags - #~(list "--durations=10" - "--numprocesses" (number->string (min 8 (parallel-job-count))) - "--pyargs" "scipy" - "-k" (string-join - ;; Network access is required. - (list "not test_ascent" - "test_electrocardiogram" - "test_existence_all" - "test_face" - ;; pycparser.ply.yacc.YaccError: Unable to build parser - "test_callbacks" - "test_bad_callbacks" - ;; AssertionError: Items are not equal: ACTUAL: - ;; np.complex128(inf+nanj) DESIRED: (inf+0j) - "test_expm1_complex" - ;; Bad results (X out of Y) for the following points - ;; (in output 0): - "test_spherical_in_complex" - "test_spherical_jn_complex" - "test_spherical_kn" - "test_spherical_yn_complex" - ;; Not equal to tolerance <...> - "test_log1p_complex" - "test_negative_real_gh14582[spherical_in-False]" - "test_negative_real_gh14582[spherical_in-True]" - "test_negative_real_gh14582[spherical_jn-False" - "test_negative_real_gh14582[spherical_jn-True]" - "test_negative_real_gh14582[spherical_yn-False]" - "test_negative_real_gh14582[spherical_yn-True]") - " and not ")) #:phases #~(modify-phases %standard-phases - (add-after 'set-paths 'hide-gfortran - ;; See: . - (lambda* (#:key inputs #:allow-other-keys) - (let ((gfortran #$(this-package-native-input "gfortran"))) - (setenv "CPLUS_INCLUDE_PATH" - (string-join - (delete (string-append gfortran "/include/c++") - (string-split (getenv "CPLUS_INCLUDE_PATH") #\:)) - ":"))))) - (replace 'check - (lambda* (#:key test-flags tests? #:allow-other-keys) - (when tests? - ;; Step out of the source directory to avoid interference. - ;; See: <.github/workflows/linux.yml> for any other possible - ;; tests setup. - (with-directory-excursion "/tmp" - (setenv "HOME" "/tmp") - (setenv "PYTHONOPTIMIZE" "2") - (apply invoke "pytest" "-vv" test-flags)))))))) + (add-before 'check 'prepare-test-environment + (lambda _ + ;; FileNotFoundError: [Errno 2] No such file or directory: + ;; 'output/test.obj' + (mkdir "output") + (invoke "python" "setup.py" "build_ext" "--inplace")))))) (native-inputs - (list gfortran - pkg-config - python-hypothesis - python-meson - python-mpmath - python-pooch + (list python-cython python-pytest - python-pytest-timeout - python-pytest-xdist - python-pythran - python-threadpoolctl)) - (inputs - (list boost - openblas - pybind11 - qhull - xsimd)) + python-setuptools + python-wheel)) (propagated-inputs - (list python-numpy)) - (home-page "https://scipy.org/") - (synopsis "The Scipy library provides efficient numerical routines") - (description "The SciPy library is one of the core packages that make up -the SciPy stack. It provides many user-friendly and efficient numerical -routines such as routines for numerical integration and optimization.") + (list python-pycollada + python-numpy + python-scipy)) + (home-page "https://github.com/pmneila/PyMCubes") + (synopsis "Marching cubes for Python") + (description + "@code{PyMCubes} is an implementation of the marching cubes algorithm to +extract iso-surfaces from volumetric data. The volumetric data can be given +as a three-dimensional @code{NumPy} array or as a Python function @code{f(x, +y, z)}.") (license license:bsd-3))) -;; A bare minimal package, mainly to use in tests and reduce closure -;; size. Tests are left out in the main package to slim down native-inputs. -(define-public python-scipy-minimal - (package/inherit python-scipy - (name "python-scipy-minimal") - (arguments - (substitute-keyword-arguments arguments - ((#:tests? _ #t) #f))) - (native-inputs - (list gfortran - pkg-config - python-meson - python-pythran)))) - -(define-public python-simple-pid +(define-public python-pynetdicom (package - (name "python-simple-pid") - (version "2.0.1") + (name "python-pynetdicom") + (version "2.1.1") (source (origin (method url-fetch) - (uri (pypi-uri "simple_pid" version)) + (uri (pypi-uri "pynetdicom" version)) (sha256 (base32 - "17p9bgka5yv5lbnbk374yjccrlizm572wv3xb479072lahf7cwap")))) + "1smzrnc93nmv8jz4np9knas74a46b1nhb3hjpf8n9vfpxypgnwcn")))) (build-system pyproject-build-system) - (native-inputs - (list python-pytest python-setuptools python-wheel)) - (home-page "https://github.com/m-lundberg/simple-pid") - (synopsis "Easy to use PID controller") - (description "This package provides a simple and easy-to-use @acronym{PID, -proportional-integral-derivative} controller.") + (arguments + (list + #:test-flags + ;; Tests takes about 10-15min to complete, and not thread save. + ;; Skip tests that require networking. + #~(list "-k" (string-append + " not TestFindSCP" + " and not TestQRGetServiceClass" + " and not TestQRMoveServiceClass" + " and not TestStoreSCP" + " and not test_ae.py" + " and not test_echoscp.py" + " and not test_qrscp_echo.py" + " and not test_storescp.py" + " and not test_pr_level_patient" + " and not test_pr_level_series" + " and not test_scp_cancelled")))) + (native-inputs (list python-numpydoc + python-poetry-core + python-pytest)) + (propagated-inputs (list python-pydicom + python-pyfakefs + python-sqlalchemy)) + (home-page "https://github.com/pydicom/pynetdicom") + (synopsis "Python implementation of the DICOM networking protocol") + (description + "@code{pynetdicom} is a Python package that implements the DICOM +networking protocol. It allows the easy creation of DICOM +@acronym{SCUs,Service Class Users} and @acronym{SCPs,Service Class +Providers}.") (license license:expat))) -(define-public python-snakemake-interface-common +(define-public python-pynrrd (package - (name "python-snakemake-interface-common") - (version "1.17.4") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/snakemake/snakemake-interface-common") - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) - (sha256 - (base32 "19fyqs048zdvrmq5sdayzch850kwsyv2x6xn57cjjzcm4zpjrh9w")))) + (name "python-pynrrd") + (version "1.1.3") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/mhe/pynrrd") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1l0hjbqzf5i1bmpxpblpyyqkhci3mb5n07x6hqf2a91hggfyrvda")))) (build-system pyproject-build-system) - (arguments - (list #:phases - #~(modify-phases %standard-phases - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "python3" "tests/tests.py"))))))) - (native-inputs (list python-poetry-core python-pytest)) - (propagated-inputs (list python-argparse-dataclass python-configargparse)) - (home-page "https://github.com/snakemake/snakemake-interface-common") - (synopsis "Common functions and classes for Snakemake and its plugins") - (description "This package provides common functions and classes -for Snakemake and its plugins.") + (native-inputs + (list python-pytest python-setuptools)) + (propagated-inputs + (list python-numpy)) + (home-page "https://github.com/mhe/pynrrd") + (synopsis "Python module for reading and writing NRRD files") + (description + "@code{pynrrd} is a Python module for reading and writing @acronym{NRRD, +Nearly Raw Raster Data} files (format designed to support scientific +visualization and image processing involving N-dimensional raster data) into +and from numpy arrays.") (license license:expat))) -(define-public python-snakemake-interface-executor-plugins +(define-public python-pynsee (package - (name "python-snakemake-interface-executor-plugins") - (version "9.3.3") + (name "python-pynsee") + (version "0.1.8") (source (origin - (method git-fetch) - (uri (git-reference - (url (string-append "https://github.com/snakemake/" - "snakemake-interface-executor-plugins")) - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) + (method url-fetch) + (uri (pypi-uri "pynsee" version)) (sha256 - (base32 "1kjjcgkk1rbavb687x5ayw35ayhsnhpg9262k317x911wqpsj2fm")))) + (base32 "1w084ynwdd9f4wpcnakqc0nxcbj9gr8vppv4rd258i3dp1qq4sw5")))) (build-system pyproject-build-system) - (arguments - (list - #:phases - #~(modify-phases %standard-phases - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "python3" "tests/tests.py"))))))) - (propagated-inputs (list python-argparse-dataclass - python-snakemake-interface-common - python-throttler)) - (native-inputs (list python-poetry-core python-pytest)) - (home-page (string-append "https://github.com/snakemake/" - "python-snakemake-interface-executor-plugins")) - (synopsis "Interface for Snakemake executor plugins") + (arguments (list #:tests? #f)) ; XXX: Tests require network access. + (native-inputs + (list python-setuptools + python-wheel)) + (propagated-inputs + (list python-appdirs + python-openpyxl + python-pandas + python-platformdirs + python-pyarrow + python-requests + python-shapely + python-tqdm + python-unidecode + python-urllib3 + python-xlrd)) + (home-page "https://pynsee.readthedocs.io") + (synopsis + "Tools to Easily Search and Download French Data From INSEE and IGN APIs") (description - "This package provides a stable interface for interactions between Snakemake and -its executor plugins.") + "This package provides tools to easily search and download French data +from INSEE and IGN APIs. This data includes more than 150 000 macroeconomic +series, a dozen datasets of local french data, numerous sources available on +@url{insee.fr}, geographical limits of administrative areas taken from IGN as +well as key metadata and SIRENE database containing data on all French +compagnies.") (license license:expat))) -(define-public python-snakemake-interface-report-plugins +(define-public python-pyqtgraph (package - (name "python-snakemake-interface-report-plugins") - (version "1.1.0") + (name "python-pyqtgraph") + (version "0.13.7") (source (origin - (method git-fetch) - (uri (git-reference - (url (string-append "https://github.com/snakemake/" - "snakemake-interface-report-plugins")) - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) + (method url-fetch) + (uri (pypi-uri "pyqtgraph" version)) (sha256 - (base32 "0i6z9vk6nv2m3jsym0glrb7h9isdlfza2yq14vbqcslybdi9ykfa")))) + (base32 "1qyr461hcvhgy02slfkgrbip2xwa8zz6dvmi1476v6f66lclzy34")))) (build-system pyproject-build-system) (arguments - (list - #:tests? #f ;circular dependency on snakemake - #:phases - #~(modify-phases %standard-phases - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "python3" "tests/tests.py"))))))) - (propagated-inputs (list python-snakemake-interface-common python-pytest)) - (native-inputs (list python-poetry-core)) - (home-page (string-append "https://github.com/snakemake/" - "python-snakemake-interface-report-plugins")) - (synopsis "Interface for Snakemake report plugins") - (description "This package provides a stable interface for interactions -between Snakemake and its report plugins.") + ;; tests: 949 passed, 1356 skipped, 2 deselected, 8 xfailed, 130 warnings + (list #:test-flags + ;; Failed: CALL ERROR: Exceptions caught in Qt event loop. + #~(list "--deselect=tests/exporters/test_svg.py::test_plotscene" + ;; The test_reload test fails. It suggests to disable + ;; assert rewriting in Pytest, but it still doesn't pass. + "-k" "not test_reload" + ;; Run unit tets only. + "tests") + #:phases + #~(modify-phases %standard-phases + (add-before 'check 'set-qpa + (lambda _ + (setenv "QT_QPA_PLATFORM" "offscreen")))))) + (native-inputs + (list python-pytest + ;; Do not propagate Qt5/Qt6 let the user of the package to select + ;; any supported one, see + ;; + ;; . + python-pyqt-6 + python-pytest-qt + python-setuptools)) + (propagated-inputs + (list python-h5py + python-numpy + python-pyopengl + python-scipy)) + (home-page "https://www.pyqtgraph.org") + (synopsis "Scientific graphics and GUI library for Python") + (description + "PyQtGraph is a Pure-python graphics library for PyQt5, PyQt6, PySide2 +and PySide6. It is intended for use in mathematics, scientific or engineering +applications.") (license license:expat))) -(define-public python-snakemake-interface-software-deployment-plugins +(define-public python-pytensor (package - (name "python-snakemake-interface-software-deployment-plugins") - (version "0.6.1") - (source - (origin - (method git-fetch) - (uri (git-reference - (url (string-append "https://github.com/snakemake/" - "snakemake-interface-software-deployment-plugins")) - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) - (sha256 - (base32 "0b4kkznfyfck9f92pkimhyl13ljisfn67rsilm1a5inq2ywpmxba")))) + (name "python-pytensor") + (version "3.2.4") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/pymc-devs/pytensor") + (commit (string-append "rel-" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0wqklzah9rysxnmf34zrj4njc1k79r9n9kbi1cnm6qj2dds6bm3d")))) (build-system pyproject-build-system) (arguments (list + ;; tests: 1906 passed, 2581 skipped, 34 deselected, 12 xfailed, 274 warnings + #:test-flags + ;; XXX: Full test suite takes about 20-30min to complete in single + ;; thread, attempt to run tests in parallel with pytest-xdist fails even + ;; so upstream provides a support for that, try to figure out how to + ;; improve it. + ;; + ;; Upstream implements a script, showing slow tests which may be used to + ;; exclude even more hanging/slow ones, see: + ;; . + ;; + #~(list "--benchmark-disable" + "--benchmark-skip" + "--durations=50" + ;; Skip computationally intensive tests. + "--ignore=tests/scan/" + "--ignore=tests/tensor/" + "--ignore=tests/sandbox/" + "--ignore=tests/sparse/sandbox/" + ;; A mixture of assertions are not equal in these tests. + "--deselect=tests/link/numba/test_nlinalg.py::test_Eigh[x0-L-None]" + #$@(map (lambda (test) + (string-append "--deselect=tests/graph/rewriting/" + "test_basic.py::" + test)) + ;; Tests fail with similar errors: AssertionError: + ;; assert 'FunctionGraph(Op1(Op2(x, y), z))' == + ;; 'FunctionGraph(Op4(z, y))' + (list "TestPatternNodeRewriter::test_replace_output" + "TestPatternNodeRewriter::test_nested_out_pattern" + "TestPatternNodeRewriter::test_unification_1" + "TestPatternNodeRewriter::test_replace_subgraph" + "TestPatternNodeRewriter::test_no_recurse" + "TestPatternNodeRewriter::test_multiple" + "TestPatternNodeRewriter::test_nested_even" + "TestPatternNodeRewriter::test_nested_odd" + "TestPatternNodeRewriter::test_expand" + "TestPatternNodeRewriter::test_ambiguous" + "TestPatternNodeRewriter::test_constant" + "TestPatternNodeRewriter::test_constraints" + "TestPatternNodeRewriter::test_match_same" + "TestPatternNodeRewriter::test_eq" + "TestEquilibrium::test_1" + "TestEquilibrium::test_2" + "TestEquilibrium::test_low_use_ratio" + ;; A mixture of assertions are not equal: + "TestPatternNodeRewriter::test_allow_multiple_clients" + "TestPatternNodeRewriter::test_op_pattern" + "test_patternsub_values_eq_approx[out_pattern0-True]" + "test_patternsub_values_eq_approx[out_pattern0-False]" + "test_patternsub_values_eq_approx[x-True]" + "test_patternsub_values_eq_approx[x-False]" + "test_patternsub_multi_output_nodes")) + #$@(map (lambda (test) + (string-append "--deselect=tests/graph/" test)) + (list "rewriting/test_kanren.py::test_kanren_basic" + "rewriting/test_kanren.py::test_KanrenRelationSub_filters" + "rewriting/test_kanren.py::test_KanrenRelationSub_dot" + "rewriting/test_unify.py::test_unify_Variable" + "rewriting/test_unify.py::test_ConstrainedVar" + "rewriting/test_unify.py::test_unify_OpPattern" + "test_destroyhandler.py::test_misc"))) #:phases #~(modify-phases %standard-phases - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "python3" "tests/tests.py"))))))) - (propagated-inputs (list python-argparse-dataclass - python-snakemake-interface-common)) - (native-inputs (list python-poetry-core)) - (home-page (string-append "https://github.com/snakemake/" - "snakemake-interface-software-deployment-plugins")) - (synopsis "Interface for Snakemake software deployment plugins") + (add-before 'check 'pre-check + (lambda _ + ;; It is required for most tests. + (setenv "HOME" "/tmp") + ;; This would otherwise interfere with finding the installed + ;; pytensor when running tests. + (delete-file-recursively "pytensor")))))) + (native-inputs (list python-cython + python-pytest + python-pytest-benchmark + python-pytest-mock + python-pytest-xdist + python-versioneer + python-setuptools)) + (propagated-inputs (list python-cons + python-etuples + python-filelock + python-logical-unification + python-minikanren + python-numba + python-numpy + python-scipy + ;; [optional] + ;; python-jaxlib + ;; python-jax + #;python-llvmlite)) + (home-page "https://pytensor.readthedocs.io/en/latest/") + (synopsis + "Library for mathematical expressions in multi-dimensional arrays") (description - "This package provides a stable interface for interactions between Snakemake and -its software deployment plugins.") - (license license:expat))) + "PyTensor is a Python library that allows one to define, optimize, and +efficiently evaluate mathematical expressions involving multi-dimensional +arrays. It is a fork of the Aesara library.") + (license license:bsd-3))) -(define-public python-snakemake-interface-storage-plugins +(define-public python-pytest-pyvista (package - (name "python-snakemake-interface-storage-plugins") - (version "3.6.0") + (name "python-pytest-pyvista") + (version "0.3.2") (source (origin - (method git-fetch) - (uri (git-reference - (url (string-append "https://github.com/snakemake/" - "snakemake-interface-storage-plugins")) - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) + (method url-fetch) + (uri (pypi-uri "pytest_pyvista" version)) (sha256 - (base32 "1dh52nkvq9zhh28xmbbq74kzhzagcy48d3vgb39bd3ckjz8libgy")))) + (base32 "0hgk3a5wwymk3k7ih4lsmkd44dfnsd842zv5859izqxkw74j2xpn")))) (build-system pyproject-build-system) (arguments (list - #:tests? #f ;circular dependency on snakemake - #:phases - #~(modify-phases %standard-phases - (add-after 'unpack 'relax-requirements - (lambda _ - (substitute* "pyproject.toml" - (("wrapt = \".*\"") - "wrapt = \"*\"")))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "python3" "tests/tests.py"))))))) - (propagated-inputs (list python-reretry python-snakemake-interface-common - python-throttler python-wrapt)) - (native-inputs (list python-poetry-core python-pytest)) - (home-page (string-append "https://github.com/snakemake/" - "snakemake-interface-storage-plugins")) - (synopsis "Interface for Snakemake storage plugins") - (description - "This package provides a stable interface for interactions between -Snakemake and its storage plugins.") - (license license:expat))) - -(define-public python-snakemake-executor-plugin-slurm-jobstep - (package - (name "python-snakemake-executor-plugin-slurm-jobstep") - (version "0.3.0") - (home-page "https://github.com/snakemake/snakemake-executor-plugin-slurm-jobstep") - (source - (origin - (method git-fetch) - (uri (git-reference - (url home-page) - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) - (sha256 - (base32 "0ly15ywmbfcm5z7jy7dxiidpw3immsdd2k80vrm4pza721irxcar")))) - (build-system pyproject-build-system) - (arguments - (list #:phases - #~(modify-phases %standard-phases - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "python3" "tests/tests.py"))))))) - (native-inputs (list python-poetry-core - snakemake)) - (synopsis "Snakemake executor plugin: slurm-jobstep") - (description "A Snakemake executor plugin for running srun jobs inside of -SLURM jobs (meant for internal use by python-snakemake-executor-plugin-slurm).") + ;; No tests included in the PyPI tarball. + #:tests? #f)) + (propagated-inputs (list python-numpy python-pillow python-pytest-8)) + (native-inputs (list python-flit-core)) + (home-page "https://github.com/pyvista/pytest-pyvista") + (synopsis "Pytest plugin for comparing PyVista plot images") + (description "This package provides a Pytest plugin that facilitates +the comparison of images produced by PyVista, generating cached images from +tests and comparing subsequent results against that cache.") (license license:expat))) -(define-public python-snakemake-executor-plugin-slurm +(define-public python-pythran (package - (name "python-snakemake-executor-plugin-slurm") - (version "1.7.0") - (home-page "https://github.com/snakemake/snakemake-executor-plugin-slurm/") + (name "python-pythran") + ;; 0.18.1 (2025-11-15), released version does not support gast 0.7.0 and + ;; beniget 0.5.0. + (properties '((commit . "1159b80a09ece110a369729507ba5d0bc8e895b2") + (revision . "0"))) + (version (git-version "0.18.1" + (assoc-ref properties 'revision) + (assoc-ref properties 'commit))) (source (origin (method git-fetch) (uri (git-reference - (url home-page) - (commit (string-append "v" version)))) + (url "https://github.com/serge-sans-paille/pythran") + (commit (assoc-ref properties 'commit)))) (file-name (git-file-name name version)) (sha256 - (base32 "0x7ghrkvmxqbcjl69hxp5axa1av3s0mdc0i9xjg8qjnd3hgd82r3")))) + (base32 "0w9vbfqsazrl7zv4b7mh8alib4kihk9gn6xmxp2w39jg5wpk2bdi")))) (build-system pyproject-build-system) (arguments - (list #:phases - #~(modify-phases %standard-phases - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "python3" "tests/tests.py"))))))) - (native-inputs (list python-pandas - python-poetry-core - python-pytest - python-snakemake-executor-plugin-slurm-jobstep - snakemake)) - (synopsis "Snakemake executor plugin: slurm") - (description "A Snakemake executor plugin for running SLURM jobs.") - (license license:expat))) - -(define-public python-sparse - (package - (name "python-sparse") - (version "0.18.0") - (source - (origin - (method url-fetch) - (uri (pypi-uri "sparse" version)) - (sha256 - (base32 - "1x5zkgbsgmpr6nis0k2y5vrsg7l61ly2zishnijcgh0fxdhjdyap")))) - (build-system pyproject-build-system) - (propagated-inputs - (list python-numba python-numpy python-scipy)) + (list + ;; FIXME: find more reliable tests file(s), all tests from + ;; test_typing.py fail with error: ModuleNotFoundError: No module named + ;; 'distutils.msvccompiler'. + #:tests? #f + #:phases + #~(modify-phases %standard-phases + (add-before 'build 'unvendor-xsimd + (lambda _ + (delete-file-recursively "pythran/xsimd") + (symlink #$(package-source + (this-package-input "xsimd")) + "pythran/xsimd")))))) (native-inputs - (list python-dask - python-pytest - python-setuptools - python-setuptools-scm)) - (home-page "https://github.com/pydata/sparse/") - (synopsis "Library for multi-dimensional sparse arrays") + (list python-setuptools)) + (propagated-inputs + (list boost ;headers need to be available + xsimd + python-beniget + python-gast + python-numpy + python-ply)) + (home-page "https://github.com/serge-sans-paille/pythran") + (synopsis "Ahead of Time compiler for numeric kernels") (description - "This package implements sparse arrays of arbitrary dimension on top of -@code{numpy} and @code{scipy.sparse}. Sparse array is a matrix in which most -of the elements are zero. @code{python-sparse} generalizes the -@code{scipy.sparse.coo_matrix} and @code{scipy.sparse.dok_matrix} layouts, but -extends beyond just rows and columns to an arbitrary number of dimensions. -Additionally, this project maintains compatibility with the -@code{numpy.ndarray} interface rather than the @code{numpy.matrix} interface -used in @code{scipy.sparse}. These differences make this project useful in -certain situations where @code{scipy.sparse} matrices are not well suited, but -it should not be considered a full replacement. It lacks layouts that are not -easily generalized like @dfn{compressed sparse row/column}(CSR/CSC) and -depends on @code{scipy.sparse} for some computations.") + "Pythran is an ahead of time compiler for a subset of the Python +language, with a focus on scientific computing. It takes a Python module +annotated with a few interface descriptions and turns it into a native +Python module with the same interface, but (hopefully) faster.") (license license:bsd-3))) -(define-public python-tdda +(define-public python-pyts + (let ((commit "4f3d97bcb1016d33dbfaef68c0931756a4552410") + (revision "0")) + (package + (name "python-pyts") + (version (git-version "0.13.0" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/johannfaouzi/pyts") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "16hlxwajdz44qs8vi7bhiania2b3201fv3pqiwsx79rb554bvl66")))) + (build-system pyproject-build-system) + (arguments + (list + #:test-flags + #~(list "--pyargs" "pyts" + ;; Most likely a flaky test. + "--deselect=preprocessing/transformer.py::\ +pyts.preprocessing.transformer.QuantileTransformer") + #:phases + #~(modify-phases %standard-phases + ;; See https://github.com/johannfaouzi/pyts/issues/168 + (add-after 'unpack 'fix-scikit-learn-compat + (lambda _ + (substitute* (list "pyts/metrics/dtw.py" + "pyts/preprocessing/imputer.py" + "pyts/preprocessing/transformer.py") + (("force_all_finite=") + "ensure_all_finite="))))))) + (propagated-inputs + (list python-joblib + python-numba + python-numpy + python-scikit-learn + python-scipy)) + (native-inputs + (list python-pytest python-setuptools)) + (home-page "https://github.com/johannfaouzi/pyts") + (synopsis "Python package for time series classification") + (description + "pyts is a Python package for time series classification. It aims to +make time series classification easily accessible by providing preprocessing +and utility tools, and implementations of state-of-the-art algorithms. Most +of these algorithms transform time series, thus pyts provides several tools to +perform these transformations.") + (license license:bsd-3)))) + +(define-public python-pyvista (package - (name "python-tdda") - (version "3.2.03") + (name "python-pyvista") + (version "0.46.5") (source (origin (method git-fetch) (uri (git-reference - (url "https://github.com/tdda/tdda") - (commit (string-append "v" version)))) + (url "https://github.com/pyvista/pyvista") + (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "1rqh1pa17n5al0b3blqr4h9qn4x6wxnxw6ilc2lk72k027cxmv84")))) + (base32 "0553bp4fhbar9z0ybjv1mw1jhb5rhrr4v6q2bzmia0ww0dn8fc69")))) (build-system pyproject-build-system) (arguments (list + ;; tests: 5891 passed, 623 skipped, 355 deselected, 3 xfailed, 167 warnings #:test-flags - #~(list - ;; Failures probably due to a dependency mismatch (e.g. pandas). - ;; Not investigated further as this is a leaf package. - ;; tdda is actively maintained, so will probably be fixed. - (string-append "--deselect=tdda/test_tdda.py::" - "TestCommonConstraints::" - "testSimpleAllCorrectVerificationFromCSVFile") - (string-append "--deselect=tdda/test_tdda.py::" - "TestCommonConstraints::" - "testSimpleAllNotCorrectVerificationFromCSVFile") - ;; Not further investigated, results in: AssertionError: - ;; '~homeless-shelter/foo.csv' != '/homeless-shelter/foo.csv' - (string-append "--deselect=tdda/test_tdda.py::" - "TestTDDAUtils::test_handle_tilde_strings")))) - (native-inputs - (list python-pytest - python-setuptools - tzdata-for-tests)) - (propagated-inputs - (list python-chardet - python-numpy - python-pandas - python-polars - python-pyarrow - python-pyyaml - python-regex - python-requests - python-rich - python-tomli - python-tomli-w)) - (home-page "https://tdda.readthedocs.io/en/stable") - (synopsis "Test-driven data analysis library for Python") - (description - "The TDDA Python module provides command-line and Python API support -for the overall process of data analysis, through tools that perform -reference testing, constraint discovery for data, automatic inference -of regular expressions from text data and automatic test generation.") - (license license:expat))) - -(define-public python-traittypes - (package - (name "python-traittypes") - (version "0.2.1") - (source - (origin - (method url-fetch) - (uri (pypi-uri "traittypes" version)) - (sha256 - (base32 "1mlv93irdrgxrhnhq3ksi9585d55bpi4mv9dha4p8gkkjiia4vxy")))) - (build-system pyproject-build-system) - (arguments - (list - ;; This one test fails because it doesn't raise an expected exception. - #:test-flags '(list "-k" "not test_bad_values") - #:phases - '(modify-phases %standard-phases - (add-after 'unpack 'numpy-compatibility - (lambda _ - (substitute* "traittypes/tests/test_traittypes.py" - (("np\\.int") "int"))))))) - (propagated-inputs (list python-traitlets)) - (native-inputs - (list python-numpy - python-pandas - python-pynose - python-pytest - python-setuptools - python-xarray)) - (home-page "https://github.com/jupyter-widgets/traittypes") - (synopsis "Trait types for NumPy, SciPy and friends") - (description "The goal of this package is to provide a reference -implementation of trait types for common data structures used in the scipy -stack such as numpy arrays or pandas and xarray data structures. These are -out of the scope of the main traitlets project but are a common requirement to -build applications with traitlets in combination with the scipy stack.") - (license license:bsd-3))) - -(define-public python-trimesh - (package - (name "python-trimesh") - (version "4.5.3") - (source - (origin - (method git-fetch) ; no tests in PyPI - (uri (git-reference - (url "https://github.com/mikedh/trimesh") - (commit version))) - (file-name (git-file-name name version)) - (sha256 - (base32 "17fyapp8nffnnf95bmcvllvg41fjlpvlv6qndbm048hnyayixxld")))) - (build-system pyproject-build-system) - (arguments - (list - #:test-flags - ;; XXX: When more optional modules are available review - ;; disabled tests once again. - ;; - ;; Disable tests requiring optional, not packed modules. - #~(list "-k" (string-join - (list "not test_bezier_example" - "test_discrete" - "test_dxf" - "test_ply_path_bezier" - "test_ply_path_line" - "test_ply_path_multi" - "test_revolve" - "test_screw" - "test_simple_closed" - "test_simple_extrude" - "test_simple_open" - "test_slice_onplane" - "test_spline_3D" - "test_svg" - ;; Following tests require network: - "test_fuze" - "test_remote") + ;; TODO: Find out what's going on with skipped tests. + #~(list "--ignore=tests/plotting/test_charts.py" + "--ignore=tests/examples/test_download_files.py" + "--ignore=tests/examples/test_downloads.py" + "--ignore=tests/plotting/test_texture.py" + ;; Tries to download data from GitHub at collection time. + "--ignore=tests/core/test_dataobject_filters.py" + ;; Tries to download data from GitHub at collection time. + "--ignore=tests/core/test_dataset_filters.py" + ;; Tries to download data from GitHub at collection time. + "--ignore=tests/plotting/test_plotter.py" + "-k" (string-join + (list "not test_actor_texture" + "test_add_multiple" + "test_add_timer_event" + "test_avsucd_reader" + "test_binarymarchingcubesreader" + "test_bmpreader" + "test_box_axes" + "test_byureader" + "test_cast_to_numpy_raises" + "test_compute_boundary_mesh_quality" + "test_connectivity_" + "test_dataset_loader_cubemap" + "test_dataset_loader_dicom" + "test_dataset_loader_from_nested_files_and_directory" + "test_dataset_loader_from_nested_multiblock" + "test_dataset_loader_one_file" + "test_dataset_loader_two_files_both_loadable" + "test_dataset_loader_two_files_one_loadable" + "test_dcmreader" + "test_demreader" + "test_ensight_multi_block_io" + "test_ensightreader_arrays" + "test_ensightreader_time_sets" + "test_ensightreader_timepoints" + "test_facetreader" + "test_fluentcffreader" + "test_gambitreader" + "test_gaussian_cubes_reader" + "test_gesignareader" + "test_gif_reader" + "test_hdf_reader" + "test_hdr_reader" + "test_init_cmap" + "test_interpolate" + "test_jpegreader" + "test_legend_" + "test_load_dataset_no_reader" + "test_load_theme" + "test_meta_image_reader" + "test_multiblockplot3dreader" + "test_nifti_reader" + "test_nrrd_reader" + "test_objreader" + "test_only_screenshots_flag" + "test_openfoam_case_type" + "test_openfoam_cell_to_point_default" + "test_openfoam_patch_arrays" + "test_openfoam_skip_zero_time" + "test_openfoamreader_active_time" + "test_openfoamreader_arrays_time" + "test_openfoamreader_read_data_time_point" + "test_openfoamreader_read_data_time_value" + "test_particle_reader" + "test_partition" + "test_pdbreader" + "test_plot3dmetareader" + "test_plot_return_img_with_cpos" + "test_plot_return_img_without_cpos" + "test_png_reader" + "test_pnm_reader" + "test_prostar_reader" + "test_protein_ribbon" + "test_pvdreader" + "test_pvdreader_no_part_group" + "test_pvdreader_no_time_group" + "test_read_cgns" + "test_repr" + "test_save_before_close_callback" + "test_slc_reader" + "test_stlreader" + "test_tecplotreader" + "test_tiff_reader" + "test_timer" + "test_translate_direction_collinear" + "test_user_logo" + "test_xdmf_reader" + ;; XXX: incompatible with Numpy@2 + ;; Drop when updating along with vtk. + "test_check_subdtype_changes_type" + ;; These tests try to download data from GitHub. + "test_read_exodus" + "test_nek5000_reader" + "test_exodus_reader_ext" + "test_exodus_reader_core" + "test_exodus_blocks" + "test_download_dataset_texture" + "test_structured_grid_cast_to_explicit_structured_grid" + "test_pad_image_multi_component_with_scalar" + "test_pad_image_raises" + "test_points_to_cells_and_cells_to_points_dimensions" + ;; These tests download cow.vtp from GitHub. + "test_meshio[cow_ugrid]" + "test_meshio[points_only]" + ;; Looks for pyproject.toml in installed package. + "test_max_positional_args_matches_pyproject") " and not ")) #:phases #~(modify-phases %standard-phases - ;; XXX: It struggles to load and fails with error: AttributeError: - ;; module 'trimesh' has no attribute '__main__'. - (delete 'sanity-check)))) + ;; vtk check fails in sanity-check, comment out + (add-after 'unpack 'patch-pyproject + (lambda _ + (substitute* "pyproject.toml" + (("'vtk[^']*'," all) (string-append "#" all))))) + (add-after 'unpack 'fix-failing-tests + (lambda _ + (substitute* "tests/plotting/test_plotting.py" + (("\"\"\"Determine if using mesa.\"\"\"" all) + (string-append all "\n return False"))) + (substitute* "tests/test_meshio.py" + (("cow = .*$" all) (string-append "#" all "\n")) + ((", cow") "")))) + ;; test phase writes files to $HOME + (add-before 'check 'redirect-HOME + (lambda _ + (setenv "HOME" "/tmp")))))) (native-inputs - (list python-pyinstrument - python-pytest)) + (list nss-certs-for-test + python-aiohttp + python-ipython + python-mypy + python-pandas + python-pytest-8 + python-pytest-cases + python-pytest-mock + python-pytest-pyvista + python-scipy + python-tqdm + python-trimesh + which + xorg-server-for-tests)) (propagated-inputs - (list ;; python-cascadio ; not packed yet, optional - python-chardet - python-colorlog - python-httpx - python-jsonschema - python-lxml - ;; python-mapbox-earcut ; not packed yet, optional - ;; python-manifold3d ; not packed yet, optional + (list python-cmcrameri + python-cmocean + python-colorcet + python-imageio + python-matplotlib python-meshio - python-networkx python-numpy - ;; python-openctm ; not packed yet, optional python-pillow - python-psutil - python-pycollada - python-pyglet - python-requests - python-rtree - python-scikit-image - python-scipy - python-setuptools - python-shapely - ;; python-svg-path ; not packed yet, optional - python-sympy - ;; python-vhacdx ; not packed yet, optional - ;; python-xatlas ; not packed yet, optional - python-xxhash)) - (home-page "https://github.com/mikedh/trimesh") - (synopsis "Python library for loading and using triangular meshes") + python-pooch + python-scooby + vtk-9.5)) + (home-page "https://docs.pyvista.org/") + (synopsis "3D plotting and mesh analysis through VTK") (description - "Trimesh is a pure Python library for loading and using triangular meshes -with an emphasis on watertight surfaces. The goal of the library is to -provide a full featured and well tested Trimesh object which allows for easy -manipulation and analysis, in the style of the Polygon object in the Shapely -library.") - (license license:expat))) + "PyVista is... -(define-public python-tspex - (package - (name "python-tspex") - ;; 0.6.3 is not tagged; must be this one, as it is the latest, from the - ;; day of the release, and the commit message is "Bump to 0.6.3". - (properties '((commit . "d393ff497b7c14d673e792bd6c84ddd734be1239") - (revision . "0"))) - (version (git-version "0.6.3" - (assoc-ref properties 'revision) - (assoc-ref properties 'commit))) - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/apcamargo/tspex") - (commit (assoc-ref properties 'commit)))) - (file-name (git-file-name name version)) - (sha256 - (base32 "0khhnahhn0jp9y14q6wgq0xqadqszwn1iq3y562bhfmv09f4j1ik")))) - (build-system pyproject-build-system) - (arguments - (list - #:phases - #~(modify-phases %standard-phases - ;; The seaborn styles have different names. - (add-after 'unpack 'fix-seaborn - (lambda _ - (substitute* (find-files "." ".py$") - (("seaborn-") "seaborn-v0_8-"))))))) - (native-inputs - (list python-pytest - python-setuptools)) - (propagated-inputs - (list python-matplotlib - python-numpy - python-pandas - python-seaborn - python-xlrd)) - (home-page "https://apcamargo.github.io/tspex/") - (synopsis "Calculate tissue-specificity metrics for gene expression") - (description - "This package provides a Python package for calculating -tissue-specificity metrics for gene expression.") - (license license:gpl3+))) - -(define-public python-pandas - (package - (name "python-pandas") - (version "3.0.3") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/pandas-dev/pandas") - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) - (sha256 - (base32 "1qagfjf4rrpx4xdw0bwg3q9g4k5vjplvifnx6k2frm8z2ws9hgds")))) - (build-system pyproject-build-system) - (arguments - (list - ;; tests: 185854 passed, 12827 skipped, 776 xfailed, 86 xpassed - #:test-flags - #~(list "-m" (string-join - (list "not db" "network" "single_cpu" "slow" "slow_arm") - " and not ") - "-vv" - ;; See: . - "--no-strict-data-files" - "--numprocesses" (number->string (min 4 (parallel-job-count))) - "-k" (string-join - (list "not test_git_version" - "test_show_versions_console" - ;; DeprecationWarning: Bitwise inversion '~' on bool - ;; is deprecated and will be removed in Python 3.16. - "test_scalar_unary[numexpr-pandas]" - ;; AssertionError: Series are different. - #$@(if (target-64bit?) - '() - '("test_rolling_var_numerical_issues"))) - " and not ")) - #:phases - #~(modify-phases %standard-phases - (add-after 'unpack 'patch-generate-version - (lambda _ - ;; See: . - (substitute* "generate_version.py" - (("version =.*") - (format #f "version = ~s~%" #$version)) - (("git_version =.*") - (format #f "git_version = ~s~%" #$version))))) - (replace 'check - (lambda* (#:key test-flags tests? #:allow-other-keys) - (when tests? - ;; Tests don't work with "--pyargs pandas" or changing - ;; directory to output, script is taken from pyproject.toml - ;; file. - (setenv "HOME" "/tmp") - (delete-file-recursively "pandas") - (invoke "python" "-c" (format #f "~a; ~a=[~{'~a', ~}]);" - "import pandas as pd" - "pd.test(extra_args" - test-flags)))))))) - (propagated-inputs - (list python-numpy - python-dateutil - ;; XXX: Pandas lists a lot of optional dependencies which are not - ;; hard requirements, leave them listed here and commented out for - ;; the reference purpose. Try to keep closure as bare minimal as - ;; possible. - ;; - ;; [optional] - ;; python-adbc-driver-postgresql - ;; python-adbc-driver-sqlite - ;; python-beautifulsoup4 - python-bottleneck - ;; python-fastparquet - ;; python-fsspec - ;; python-gcsfs - ;; python-html5lib - ;; python-hypothesis - ;; python-jinja2 - python-lxml - ;; python-matplotlib - python-numba - python-numexpr - ;; python-odfpy - ;; python-openpyxl - ;; python-psycopg2 - ;; python-pyarrow - ;; python-pyiceberg - ;; python-pymysql - ;; python-pyqt5 - ;; python-pyreadstat - ;; python-python-calamine - ;; python-pyxlsb - ;; python-qtpy - ;; python-s3fs - ;; python-scipy - ;; python-sqlalchemy - ;; python-tables - ;; python-tabulate - ;; python-xarray - ;; python-xlrd - ;; python-xlsxwriter - #;python-zstandard)) - (inputs - (list xclip xsel)) - (native-inputs - (list python-hypothesis - python-meson - python-pytest - python-pytest-localserver - python-pytest-xdist - python-pytz - python-versioneer - tzdata-for-tests)) - (home-page "https://pandas.pydata.org") - (synopsis "Data structures for data analysis, time series, and statistics") - (description - "Pandas is a Python package providing fast, flexible, and expressive data -structures designed to make working with structured (tabular, -multidimensional, potentially heterogeneous) and time series data both easy -and intuitive. It aims to be the fundamental high-level building block for -doing practical, real world data analysis in Python.") - (license license:bsd-3))) - -(define-public python-pandas-2 - (package - (inherit python-pandas) - (name "python-pandas") - (version "2.3.3") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/pandas-dev/pandas") - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) - (sha256 - (base32 "0qf4frgj31kd9i544n8v03a0bv9mgml3f7n9n1rik187q3r8ygfg")) - (patches (search-patches "python-pandas-2-no-pytz_datetime.patch")))) - (build-system pyproject-build-system) - (arguments - (list - ;; tests: 173093 passed, 24265 skipped, 990 xfailed, 77 xpassed, 110 warnings - #:test-flags - #~(list "-m" (string-join - (list "not db" "network" "single_cpu" "slow" "slow_arm") - " and not ") - "--numprocesses" (number->string (min 4 (parallel-job-count))) - "-k" (string-join - (list "not test_git_version" - "test_parsing_tzlocal_deprecated" - "test_show_versions_console" - ;; XXX: Introduced by NumPy 2.4.6 and Cython 3.2.5: - ;; NotImplementedError - ;; See: - ;; , - ;; . - "test_categorical_block_pickle" - "test_pickle" - "test_pickle_freq" - "test_pickle_preserves_block_ndim" - "test_pickle_preserves_name" - "test_pickle_round_trip" - "test_pickle_roundtrip" - "test_pickle_roundtrip_containers" - "test_round_trip_current" - ;; AssertionError: Series are different. - #$@(if (target-64bit?) - '() - '("test_rolling_var_numerical_issues"))) - " and not ")) - #:phases - #~(modify-phases %standard-phases - (add-after 'unpack 'patch-generate-version - (lambda _ - ;; See: . - (substitute* "generate_version.py" - (("version =.*") - (format #f "version = ~s~%" #$version)) - (("git_version =.*") - (format #f "git_version = ~s~%" #$version))))) - (replace 'check - (lambda* (#:key inputs outputs test-flags tests? #:allow-other-keys) - (when tests? - (setenv "HOME" "/tmp") - (with-directory-excursion - (string-append (string-append (site-packages inputs outputs) - "/pandas")) - (apply invoke "pytest" "-vv" test-flags)))))))) - (propagated-inputs - (list python-numpy - python-dateutil - python-pytz - python-tzdata)) - (inputs - (list xclip xsel)) - (native-inputs - (list python-meson - python-lxml - python-pytest - python-pytest-asyncio - python-pytest-xdist - python-versioneer - tzdata-for-tests)))) +@itemize +@item @emph{Pythonic VTK}: a high-level API to the Visualization +Toolkit (VTK); +@item mesh data structures and filtering methods for spatial datasets; +@item 3D plotting made simple and built for large/complex data geometries. +@end itemize -;; A bare minimal package, mainly to use in tests and reduce closure size. -;; Tests are left out in the main package to slim down native-inputs and -;; propagated-inputs. -(define-public python-pandas-minimal - (package/inherit python-pandas - (name "python-pandas-minimal") - (arguments - (substitute-keyword-arguments arguments - ((#:tests? _ #t) #f))) - (native-inputs - (list python-meson - python-versioneer)) - (propagated-inputs - (list python-numpy - python-dateutil - python-pytz)))) +This package provides a Pythonic, well-documented interface exposing VTK's +powerful visualization backend to facilitate rapid prototyping, analysis, and +visual integration of spatially referenced datasets.") + (license license:expat))) -(define-public python-pandas-stubs +(define-public python-pyvistaqt (package - (name "python-pandas-stubs") - ;; The versioning follows that of Pandas and uses the date of the - ;; python-pandas-stubs release. - (version "2.3.3.251219") + (name "python-pyvistaqt") + (version "0.11.3") (source (origin (method git-fetch) (uri (git-reference - (url "https://github.com/pandas-dev/pandas-stubs") - (commit (string-append "v" version)))) + (url "https://github.com/pyvista/pyvistaqt") + (commit version))) (file-name (git-file-name name version)) (sha256 - (base32 "1xh753wv5dbc59qp7fas323181mlblvhqmd9a4g7zzhaa2mxmzqs")))) + (base32 "04f9cd98k463pdrpi8jby411x9mc0ih62gl0nv0h9w3r7pwl61yl")))) (build-system pyproject-build-system) (arguments (list - ;; tests: 1619 passed, 12 skipped, 7 deselected - #:test-flags - #~(list - ;; ImportError: Missing optional dependency 'python-calamine'. - "--deselect=tests/test_io.py::test_read_excel" - "--deselect=tests/test_io.py::test_excel_reader"))) - (native-inputs - (list python-beautifulsoup4 - python-fsspec - python-html5lib - python-jinja2 - python-loguru - python-lxml - python-matplotlib - python-mypy - python-numexpr - python-odfpy - python-openpyxl - python-pandas - python-poetry-core - python-pyarrow - python-pyreadstat - python-pytest - python-scipy - python-sqlalchemy-2 - python-tabulate - python-typing-extensions - python-xarray - python-xlrd - python-xlsxwriter - ;; Not packaged yet - ;; - ;; python-calamine - ;; python-poethepoet - ;; python-pyarrow-stubs - ;; python-pyrefly - ;; python-python-calamine - ;; python-pyxlsb - ;; python-scipy-stubs - ;; python-ty - ;; python-types-python-dateutil - tzdata-for-tests)) - (propagated-inputs - (list python-numpy - python-types-pytz)) - (home-page "https://pandas.pydata.org") - (synopsis "Type annotations for pandas") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'fix-pytest + (lambda _ + (substitute* "tests/conftest.py" + (("pytest.skip") + "pytest.mark.skipif")))) + (add-before 'check 'before-check + (lambda _ + ;; Testing requires write access. + (setenv "HOME" "/tmp") + ;; Testing requires a running xorg server. + (system "Xvfb :99 -screen 0 1024x768x24 &") + (setenv "DISPLAY" ":99.0")))))) + (propagated-inputs (list python-pyvista python-qtpy)) + (native-inputs (list python-ipython + python-matplotlib + python-numpy + python-pyqt-6 + python-pytest + python-pytest-qt + python-setuptools + python-sphinx-gallery + xorg-server)) + (home-page "https://github.com/pyvista/pyvistaqt") + (synopsis "Qt support for PyVista") (description - "This package contains public type stubs for @code{python-pandas}, following -the convention of providing stubs in a separate package, as specified in -@acronym{PEP, Python Enhancement Proposal} 561. The stubs cover the most -typical use cases of @code{python-pandas}. In general, these stubs are -narrower than what is possibly allowed by @code{python-pandas}, but follow a -convention of suggesting best recommended practices for using -@code{python-pandas}.") - (license license:bsd-3))) + "@code{pyvistaqt} is a helper module for @code{pyvista} to enable you to +plot using Qt by placing a vtk-widget into a background renderer. This can be +quite useful when you desire to update your plot in real-time.") + (license license:expat))) -(define-public python-pandarallel +(define-public python-pyzx (package - (name "python-pandarallel") - (version "1.6.5") + (name "python-pyzx") + (version "0.9.0") (source (origin (method git-fetch) ; no tests in PyPI (uri (git-reference - (url "https://github.com/nalepae/pandarallel/") + (url "https://github.com/zxcalc/pyzx") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "0r2wlxlwp4wia0vm15k4cp421mwa20k4k5g2ml01inprj8bl1p0p")) - (patches - (search-patches "python-pandarallel-fix-df-applymap.patch" - "python-pandarallel-fix-parallel_apply.patch")))) + (base32 "1bnmz08w1bmipir1wnn1k3fw64rply7891xns22qfj6yh0j1n6rj")))) + (build-system pyproject-build-system) + (arguments (list #:test-flags + #~(list + ;; Ignore long running tests + "--ignore=tests/long_test.py" + "--ignore=tests/long_scalar_test.py") + #:phases + #~(modify-phases %standard-phases + (add-before 'check 'pre-check + (lambda* (#:key inputs outputs #:allow-other-keys) + (setenv "HOME" "/tmp") + ;; Matplotlib needs to be able to write its + ;; configuration file somewhere. + (setenv "MPLCONFIGDIR" "/tmp")))))) + (native-inputs (list python-pytest + python-setuptools + python-wheel)) + (propagated-inputs (list python-ipywidgets + python-lark + python-numpy + python-pyperclip + python-tqdm)) + (home-page "https://github.com/zxcalc/pyzx") + (synopsis "Quantum circuit rewriting and optimisation using the ZX-calculus") + (description + "PyZX is a Python tool implementing the theory of ZX-calculus for the +creation, visualisation, and automated rewriting of large-scale quantum +circuits. PyZX currently allows you to: + +@itemize +@item Read in quantum circuits in the file format of QASM, Quipper or Quantomatic; +@item Rewrite circuits into a pseudo-normal form using the ZX-calculus; +@item Extract new simplified circuits from these reduced graphs; +@item Visualise the ZX-graphs and rewrites using either Matplotlib, Quantomatic +or as a TikZ file for use in LaTeX documents; +@item Output the optimised circuits in QASM, QC or QUIPPER format. +@end itemize") + (license license:asl2.0))) + +(define-public python-qdldl + (package + (name "python-qdldl") + (version "0.1.7.post5") + (source + (origin + (method url-fetch) + (uri (pypi-uri "qdldl" version)) + (sha256 + (base32 "0vi8dgrw32qj03z2dd3zqd0d625pibq3xmlgmidfsnwvqkhrj4qb")))) (build-system pyproject-build-system) - (arguments - (list - #:test-flags #~(list "-n" (number->string (parallel-job-count))))) - (propagated-inputs - (list python-dill - python-pandas - python-psutil)) (native-inputs - (list python-mkdocs-material - python-numpy + (list cmake-minimal + pybind11-2 python-pytest - python-pytest-xdist - python-setuptools - python-wheel)) - (home-page "https://nalepae.github.io/pandarallel/") - (synopsis "Tool to parallelize Pandas operations across CPUs") - (description - "@code{pandarallel} allows any Pandas user to take advantage of their -multi-core computer, while Pandas uses only one core. @code{pandarallel} also -offers nice progress bars (available on Notebook and terminal) to get an rough -idea of the remaining amount of computation to be done.") - (license license:bsd-3))) + python-setuptools)) + (propagated-inputs (list python-numpy python-scipy)) + (home-page "https://github.com/oxfordcontrol/qdldl-python/") + (synopsis "QDLDL LDL factorization routine") + (description "This package provides a Python interface to the QDLDL LDL +factorization routine for quasi-definite linear system.") + (license license:asl2.0))) -(define-public python-pandera +(define-public python-quantities (package - (name "python-pandera") - (version "0.31.1") + (name "python-quantities") + (version "0.16.4") (source (origin - ;; XXX: Sanity-check fails to load when switched to git-fetch. (method url-fetch) - (uri (pypi-uri "pandera" version)) + (uri (pypi-uri "quantities" version)) (sha256 - (base32 "04qgmcfvw78ccfnmidhy3zw1i99nyjkz3b0klsd4ypgiia3a6nn7")))) + (base32 "0dmzk17hd0c6lzjlipjpc52jdifknpvxq15javn19n3f9yvxxdpm")))) (build-system pyproject-build-system) (arguments (list - ;; tests: 3810 passed, 22 skipped, 21 xfailed, 5923 warnings - #:test-flags - ;; With higher threads count tests randomly fail during collection. - #~(list "--numprocesses" (number->string (min 2 (parallel-job-count))) - ;; TODO: Ignore tests for not packaged python-ibis-framework, - ;; and python-pyspark. - "--ignore=tests/ibis" - "--ignore=tests/pyspark" - ;; Not compatible with Pandas 3 yet. - "--ignore=tests/modin" - ;; Tests fail to connect to 127.0.0.1:52245, connection refused. - "--deselect=tests/fastapi/test_app.py::test_items_endpoint" - "--deselect=tests/fastapi/test_app.py::test_transactions_endpoint" - "--deselect=tests/fastapi/test_app.py::test_upload_file_endpoint" - ;; frictionless is not packaged yet. - "-k" "not test_frictionless_schema_"))) - (native-inputs - (list python-joblib - python-black ;some tets depent on it - python-mypy-for-tests - python-pytest - python-pytest-asyncio - python-pytest-xdist - python-pytz - python-setuptools - python-setuptools-scm - python-sphinx ;some tets depent on it - python-uvicorn - tzdata-for-tests)) - (inputs - ;; [optional] - ;; Pandera comes with a lot of extras. We test as many as possible, but do - ;; not include all of them in the propagated-inputs. Currently, we have to - ;; skip the pyspark and io tests due to missing packages python-pyspark - ;; and python-frictionless. - (list python-dask - python-distributed - python-geopandas - python-hypothesis - ;; python-ibis-framework ;missing from Guix - ;; python-modin ;blocked by guix/guix#9336 - python-numpy - python-pandas - python-polars - ;; python-pyspark ;missing from Guix - ;; python-ray ;missing from Guix - python-scipy - python-shapely)) + #:phases + #~(modify-phases %standard-phases + (add-before 'check 'pre-check + (lambda _ + (setenv "PY_IGNORE_IMPORTMISMATCH" "1")))))) + (native-inputs + (list python-pytest + python-setuptools + python-setuptools-scm)) (propagated-inputs - (list python-packaging - python-pydantic - python-typeguard - python-typing-extensions - python-typing-inspect)) - (home-page "https://github.com/unionai-oss/pandera") - (synopsis "Perform data validation on dataframe-like objects") + (list python-numpy)) + (home-page "https://github.com/python-quantities/python-quantities") + (synopsis "Support for physical quantities with units, based on NumPy") (description - "@code{python-pandera} provides a flexible and expressive API for -performing data validation on dataframe-like objects to make data processing -pipelines more readable and robust. Dataframes contain information that -@code{python-pandera} explicitly validates at runtime. This is useful in -production-critical data pipelines or reproducible research settings. With -@code{python-pandera}, you can: + "Quantities is designed to handle arithmetic and conversions of physical +quantities, which have a magnitude, dimensionality specified by various units, +and possibly an uncertainty. It builds on the NumPy library and is designed +to work with @code{numpy.ufuncs}, many of which are already supported.") + ;; OSI approved, BSD like, see doc/user/license.rst. + (license license:bsd-3))) -@itemize -@item Define a schema once and use it to validate different dataframe types. -@item Check the types and properties of columns. -@item Perform more complex statistical validation like hypothesis testing. -@item Seamlessly integrate with existing data pipelines via function decorators. -@item Define dataframe models with the class-based API with pydantic-style syntax. -@item Synthesize data from schema objects for property-based testing. -@item Lazily validate dataframes so that all validation rules are executed. -@item Integrate with a rich ecosystem of tools like @code{python-pydantic}, -@code{python-fastapi} and @code{python-mypy}. -@end itemize") - (license license:expat))) +;; XXX: Deprecated on <2026-06-08>. +(define-deprecated/public-alias hugs (@ (gnu packages physiscs) python-qutip)) -(define-public python-janitor-rs +(define-public python-ruffus (package - (name "python-janitor-rs") - (version "0.6.1") + (name "python-ruffus") + (version "2.8.4") (source (origin - ;; The upstream git source has no tags. (method url-fetch) - (uri (pypi-uri "janitor_rs" version)) + (uri (pypi-uri "ruffus" version)) (sha256 - (base32 "0xicxplz8vngbj4s6c7d08gpivns5bda85020yf1wjs8788g9m2l")))) + (base32 "1ai673k1s94s8b6pyxai8mk17p6zvvyi87rl236fs6ls8mpdklvc")))) (build-system pyproject-build-system) (arguments (list - #:tests? #f ; No tests. - #:imported-modules `(,@%cargo-build-system-modules - ,@%pyproject-build-system-modules) - #:modules '(((guix build cargo-build-system) #:prefix cargo:) - (guix build pyproject-build-system) - (guix build utils)) #:phases #~(modify-phases %standard-phases - (add-after 'unpack 'prepare-cargo-build-system - (lambda args - (for-each - (lambda (phase) - (format #t "Running cargo phase: ~a~%" phase) - (apply (assoc-ref cargo:%standard-phases phase) - #:vendor-dir ".cargo/vendor" - #:cargo-target #$(cargo-triplet) - args)) - '(unpack-rust-crates - configure - check-for-pregenerated-files - patch-cargo-checksums))))))) - (native-inputs (append - (list maturin - rust - `(,rust "cargo")) - (or (and=> (%current-target-system) - (compose list make-rust-sysroot)) - '()))) - (inputs (cargo-inputs 'janitor-rs)) - (home-page "https://github.com/pyjanitor-devs/janitor-rs") - (synopsis "Rust library for faster pyjanitor") + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (with-directory-excursion "ruffus/test" + (invoke "bash" "run_all_unit_tests3.cmd")))))))) + (native-inputs (list python-pytest python-setuptools)) + (home-page "http://www.ruffus.org.uk") + (synopsis "Light-weight computational pipeline management") (description - "This package provides a Rust library to improve the performance of -@code{python-pyjanitor}.") + "Ruffus is designed to allow scientific and other analyses to be +automated with the minimum of fuss and the least effort.") (license license:expat))) -(define-public python-pyjanitor +(define-public python-salib (package - (name "python-pyjanitor") - (version "0.32.23") + (name "python-salib") + (version "1.5.2") (source (origin (method git-fetch) (uri (git-reference - (url "https://github.com/pyjanitor-devs/pyjanitor") - (commit (string-append "v" version)))) + (url "https://github.com/SALib/SALib") + (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "1mvgabsn5jl2aidh2mcqdmh60p2g514nb5sxwskhz1q57pk4m0w9")))) + (base32 "0v7l6qbxgclz644fq1vmakfasxcdhg1g019b5w47hlxqw8fx0ipl")))) (build-system pyproject-build-system) - ;; Pyjanitor has an extensive test suite. For quick debugging, the tests - ;; marked turtle can be skipped using "-m" "not turtle". + ;; tests: 190 passed, 1 xfailed, 28 warnings (arguments (list - ;; tests: 1030 passed, 2 skipped, 42 xfailed, 6 xpassed, 594 warnings - #:test-flags - ;; The tests take quite long, so consider adding the "-n" line and - ;; adding python-pytest-xdist to the native-inputs when testing. - ;; However, the tests are not deterministic, enen they are enabled in - ;; project's CI (.github/workflows/tests.yml), when ran with "-n, - ;; --numprocesses" , so disable again before committing. - #~(list ;; "--numprocesses" (number->string (min 8 (parallel-job-count))) - ;; Test files are not included. - "--ignore=tests/io/test_read_csvs.py" - ;; Polars has not been packaged yet. - "--ignore=tests/polars/" - ;; PySpark has not been packaged yet. - "--ignore=tests/spark/" - ;; Flaky test (fails for performance reasons) - "--deselect=tests/math/test_ecdf.py::test_ecdf_string" - ;; Tries to connect to the internet. - "-k" (string-append "not test_is_connected" - ;; Test files are not included. - " and not test_read_commandline_bad_cmd" - ;; XXX: Fatal Python error: Segmentation fault - " and not test_maccs_keys_fingerprint" - " and not test_morgan_fingerprint_counts" - " and not test_morgan_fingerprint_bits" - ;; AssertionError: DataFrame.iloc[:, 1] - ;; (column name="cities") are different - " and not test_various_sorted")) #:phases #~(modify-phases %standard-phases - (add-before 'check 'set-env-ci + ;; Remove this phase on the next update, it is already in master. + (add-before 'build 'fix-for-pandas-3 (lambda _ - ;; Some tests are skipped if the JANITOR_CI_MACHINE - ;; variable is not set. - (setenv "JANITOR_CI_MACHINE" "1")))))) - (propagated-inputs (list python-janitor-rs - python-multipledispatch - python-natsort - python-pandas-flavor - python-scipy - ;; [optional] - python-biopython - python-unyt)) - (native-inputs (list python-numba - python-openpyxl - python-pytest - ;;python-pytest-xdist ;only for -n when testing - ;; TODO: Remove python-requests and inject its target - ;; data to make the package behaviour reproducible. - python-requests - python-setuptools - rdkit)) - (home-page "https://github.com/pyjanitor-devs/pyjanitor") - (synopsis "Tools for cleaning and transforming Pandas DataFrames") + (substitute* "src/SALib/analyze/sobol.py" + (("np\\.array\\(\\[0\\.0\\]\\)") + "np.float64(0.0)"))))))) + (native-inputs + (list python-hatch-vcs + python-hatchling + python-pytest)) + (propagated-inputs + (list python-matplotlib + python-multiprocess + python-numpy + python-pandas + python-scipy)) + (home-page "https://salib.readthedocs.io/en/latest/") + (synopsis "Tools for global sensitivity analysis") + (description "SALib provides tools for global sensitivity analysis. It +contains Sobol', Morris, FAST, DGSM, PAWN, HDMR, Moment Independent and +fractional factorial methods.") + (license license:expat))) + +(define-public python-scikit-allel + (package + (name "python-scikit-allel") + (version "1.3.13") + (source + (origin + (method url-fetch) + (uri (pypi-uri "scikit_allel" version)) + (sha256 + (base32 "0d9yadzhsjjqkh6rz273f53iwczk0c7pv9dajzcrmfnk036b8f4s")))) + (build-system pyproject-build-system) + (arguments + (list + #:test-flags + '(list "-k" + (string-append + ;; AttributeError: 'Dataset' object has no attribute 'asstr' + "not test_vcf_to_hdf5" + " and not test_vcf_to_hdf5_exclude" + " and not test_vcf_to_hdf5_rename" + " and not test_vcf_to_hdf5_group" + " and not test_vcf_to_hdf5_ann" + ;; Does not work with recent hmmlearn + " and not test_roh_mhmm_0pct" + " and not test_roh_mhmm_100pct")) + #:phases + '(modify-phases %standard-phases + (add-before 'check 'build-ext + (lambda _ + (invoke "python" "setup.py" "build_ext" "--inplace")))))) + (propagated-inputs + (list python-dask python-numpy)) + (native-inputs + (list htslib + python-cython + python-h5py + python-hmmlearn + python-numexpr + python-numpy + python-pytest + python-setuptools + python-setuptools-scm + python-wheel + python-zarr)) + (home-page "https://github.com/cggh/scikit-allel") + (synopsis "Explore and analyze genetic variation data") + (description + "This package provides utilities for exploratory analysis of large scale +genetic variation data.") + (license license:expat))) + +(define-public python-scikit-base + (package + (name "python-scikit-base") + (version "1.0.2") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/sktime/skbase") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1436l0jr6avyhz2dg3driykn6rwskwyf57aig7x3pwak6w3il6rv")))) + (build-system pyproject-build-system) + (native-inputs + (list python-numpy + python-pandas-minimal + python-pytest + python-scikit-learn + python-scipy-minimal + python-setuptools + python-toml)) + (home-page "https://github.com/sktime/skbase") + (synopsis "Base classes for sklearn-like parametric objects") (description - "@code{pyjanitor} provides a set of data cleaning routines for -@code{pandas} DataFrames. These routines extend the method chaining API -defined by @code{pandas} for a subset of its methods. Originally, this -package was a port of the R package by the same name and it is inspired by the -ease-of-use and expressiveness of the @code{dplyr} package.") - (license license:expat))) + "@code{skbase} provides base classes for creating scikit-learn-like +parametric objects, along with tools to make it easier to build your own +packages that follow these design patterns.") + (license license:bsd-3))) -(define-public python-pymcubes +(define-public python-scikit-build-core (package - (name "python-pymcubes") - (version "0.1.6") + (name "python-scikit-build-core") + (version "0.12.2") (source (origin - (method git-fetch) ; no tests in PyPI + (method git-fetch) (uri (git-reference - (url "https://github.com/pmneila/PyMCubes") - (commit (string-append "v" version)))) + (url "https://github.com/scikit-build/scikit-build-core") + (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "1v2qhc4pwanx6a8k843mbh45yk77n3w63sy5lzk5c3q4pkvfj1b9")))) + (base32 "18xh572ndd0dww7czic775p6n8y5kxd072fj7xdhxwykdxr0bl2g")))) (build-system pyproject-build-system) (arguments (list - #:phases - #~(modify-phases %standard-phases - (add-before 'check 'prepare-test-environment - (lambda _ - ;; FileNotFoundError: [Errno 2] No such file or directory: - ;; 'output/test.obj' - (mkdir "output") - (invoke "python" "setup.py" "build_ext" "--inplace")))))) + ;; tests: 414 passed, 63 skipped, 75 deselected, 1 xfailed + #:test-flags #~(list "-m" "not isolated and not network"))) (native-inputs - (list python-cython + (list python-cattrs-minimal + python-hatch-vcs + python-hatchling + python-pypa-build python-pytest - python-setuptools - python-wheel)) + python-pytest-subprocess + python-virtualenv)) (propagated-inputs - (list python-pycollada - python-numpy - python-scipy)) - (home-page "https://github.com/pmneila/PyMCubes") - (synopsis "Marching cubes for Python") - (description - "@code{PyMCubes} is an implementation of the marching cubes algorithm to -extract iso-surfaces from volumetric data. The volumetric data can be given -as a three-dimensional @code{NumPy} array or as a Python function @code{f(x, -y, z)}.") - (license license:bsd-3))) + (list cmake-minimal + pybind11 + python-packaging + python-pathspec)) + (home-page "https://github.com/scikit-build/scikit-build-core") + (synopsis "Build backend for CMake based projects") + (description "Scikit-build-core is a build backend for Python that uses +CMake to build extension modules. It has a simple yet powerful static +configuration system in pyproject.toml, and supports almost unlimited +flexibility via CMake. It was initially developed to support the demanding +needs of scientific users, but can build any sort of package that uses +CMake.") + (license license:asl2.0))) -(define-public python-pythran +(define-public python-scikit-build-core-bootstrap + (hidden-package + (package/inherit python-scikit-build-core + (arguments + (list #:tests? #f)) + (native-inputs + (list python-hatch-vcs + python-hatchling)) + (propagated-inputs + (list python-packaging + python-pathspec))))) + +(define-public python-scikit-fem (package - (name "python-pythran") - ;; 0.18.1 (2025-11-15), released version does not support gast 0.7.0 and - ;; beniget 0.5.0. - (properties '((commit . "1159b80a09ece110a369729507ba5d0bc8e895b2") - (revision . "0"))) - (version (git-version "0.18.1" - (assoc-ref properties 'revision) - (assoc-ref properties 'commit))) + (name "python-scikit-fem") + (version "11.0.0") (source (origin - (method git-fetch) + (method git-fetch) ; no tests in PyPI (uri (git-reference - (url "https://github.com/serge-sans-paille/pythran") - (commit (assoc-ref properties 'commit)))) + (url "https://github.com/kinnala/scikit-fem") + (commit version))) (file-name (git-file-name name version)) (sha256 - (base32 "0w9vbfqsazrl7zv4b7mh8alib4kihk9gn6xmxp2w39jg5wpk2bdi")))) + (base32 "13zh57raz2qcdfhsvpdlyiba5q0s0lh5b3gmsmh4cfrncrkdh6mh")))) (build-system pyproject-build-system) (arguments (list - ;; FIXME: find more reliable tests file(s), all tests from - ;; test_typing.py fail with error: ModuleNotFoundError: No module named - ;; 'distutils.msvccompiler'. - #:tests? #f - #:phases - #~(modify-phases %standard-phases - (add-before 'build 'unvendor-xsimd - (lambda _ - (delete-file-recursively "pythran/xsimd") - (symlink #$(package-source - (this-package-input "xsimd")) - "pythran/xsimd")))))) + #:test-flags #~(list + ;; Tests require Jax. + "--ignore=tests/test_autodiff.py" + "--ignore=tests/test_examples.py"))) (native-inputs - (list python-setuptools)) + (list python-autograd + python-pyamg + ;; python-jax ; not packed yet + python-pytest + python-shapely + python-setuptools)) (propagated-inputs - (list boost ;headers need to be available - xsimd - python-beniget - python-gast + (list python-meshio python-numpy - python-ply)) - (home-page "https://github.com/serge-sans-paille/pythran") - (synopsis "Ahead of Time compiler for numeric kernels") + python-matplotlib + python-scipy)) + (home-page "https://scikit-fem.readthedocs.io/en/latest/") + (synopsis "Library for performing finite element assembly") (description - "Pythran is an ahead of time compiler for a subset of the Python -language, with a focus on scientific computing. It takes a Python module -annotated with a few interface descriptions and turns it into a native -Python module with the same interface, but (hopefully) faster.") + "@code{scikit-fem} is a library for performing finite element assembly. +Its main purpose is the transformation of bilinear forms into sparse matrices +and linear forms into vectors.") (license license:bsd-3))) -(define-public python-pyts - (let ((commit "4f3d97bcb1016d33dbfaef68c0931756a4552410") - (revision "0")) - (package - (name "python-pyts") - (version (git-version "0.13.0" revision commit)) - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/johannfaouzi/pyts") - (commit commit))) - (file-name (git-file-name name version)) - (sha256 - (base32 "16hlxwajdz44qs8vi7bhiania2b3201fv3pqiwsx79rb554bvl66")))) - (build-system pyproject-build-system) - (arguments - (list - #:test-flags - #~(list "--pyargs" "pyts" - ;; Most likely a flaky test. - "--deselect=preprocessing/transformer.py::\ -pyts.preprocessing.transformer.QuantileTransformer") - #:phases - #~(modify-phases %standard-phases - ;; See https://github.com/johannfaouzi/pyts/issues/168 - (add-after 'unpack 'fix-scikit-learn-compat - (lambda _ - (substitute* (list "pyts/metrics/dtw.py" - "pyts/preprocessing/imputer.py" - "pyts/preprocessing/transformer.py") - (("force_all_finite=") - "ensure_all_finite="))))))) - (propagated-inputs - (list python-joblib - python-numba - python-numpy - python-scikit-learn - python-scipy)) - (native-inputs - (list python-pytest python-setuptools)) - (home-page "https://github.com/johannfaouzi/pyts") - (synopsis "Python package for time series classification") - (description - "pyts is a Python package for time series classification. It aims to -make time series classification easily accessible by providing preprocessing -and utility tools, and implementations of state-of-the-art algorithms. Most -of these algorithms transform time series, thus pyts provides several tools to -perform these transformations.") - (license license:bsd-3)))) - -(define-public python-spin +(define-public python-scikit-fuzzy (package - (name "python-spin") - (version "0.8") - (source - (origin - (method url-fetch) - (uri (pypi-uri "spin" version)) - (sha256 - (base32 "0ff48nagfaai3j26g1db4zq2bwdv6kj5l7xhcs2l9kzg7qzrmhr7")))) - (build-system pyproject-build-system) - (propagated-inputs (list python-click python-colorama python-tomli)) - (native-inputs (list python-pytest python-setuptools python-wheel)) - (home-page "https://github.com/scientific-python/spin") - (synopsis "Developer tool for scientific Python libraries") - (description "@code{spin} is a simple interface for common development -tasks. It comes with a few common build commands out the box, but can -easily be customized per project. + (name "python-scikit-fuzzy") + (version "0.5.0") + (source + (origin + (method url-fetch) + (uri (pypi-uri "scikit_fuzzy" version)) + (sha256 + (base32 "0zsfyd8cpd2l82fwh3smxbwhb3bkqwlq17cbav53axma4c2k9r9f")))) + (build-system pyproject-build-system) + (arguments + (list + #:test-flags #~(list "--pyargs" "skfuzzy"))) + (native-inputs + (list python-pytest python-setuptools python-wheel)) + (propagated-inputs + (list python-networkx python-numpy python-scipy)) + (home-page "https://github.com/scikit-fuzzy/scikit-fuzzy") + (synopsis "Fuzzy logic toolkit for SciPy") + (description + "This package implements many useful tools for projects involving fuzzy +logic, also known as grey logic.") + (license license:bsd-3))) -The impetus behind developing the tool was the mass migration of scientific -Python libraries (SciPy, scikit-image, and NumPy, etc.) to Meson, after -distutils was deprecated. When many of the build and installation commands -changed, it made sense to abstract away the nuisance of having to re-learn -them.") - (license license:bsd-3))) +(define-public python-scikit-image + (package + (name "python-scikit-image") + (version "0.26.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/scikit-image/scikit-image") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + ;; TODO: Remove patch when refreshing python-scikit-image. + ;; Prevent deprecation warning from python-pillow 12.1.1. + (patches + (search-patches "python-scikit-image-fix-python-pillow.patch")) + (sha256 + (base32 "1x90jad3jqin8ws1j1i89zrajpcbn1h87nl5yxxf5cs3b7ha13rf")))) + (build-system pyproject-build-system) + (arguments + (list + #:test-flags + #~(list "--ignore=benchmarks/" + ;; RuntimeWarning: divide by zero encountered in scalar divide + ;; (see: + ;; ). + "-k" "not test_ellipse_parameter_stability"))) + (propagated-inputs + (list python-imageio + python-lazy-loader + python-networkx + python-numpy + python-packaging + python-pillow + python-scipy + python-tifffile + ;; [optional] + ;; python-astropy + ;; python-cloudpickle + ;; python-dask + ;; python-matplotlib + ;; python-pooch + ;; python-pyamg + ;; python-pywavelets + ;; python-scikit-learn + #;python-simpleitk)) + (native-inputs + (list python-meson + python-pytest + python-pytest-localserver + python-pytest-pretty + python-pythran)) + (home-page "https://scikit-image.org/") + (synopsis "Image processing in Python") + (description + "Scikit-image is a collection of algorithms for image processing.") + (license license:bsd-3))) -(define-public python-uhi +(define-public python-scikit-misc (package - (name "python-uhi") - (version "0.5.0") + (name "python-scikit-misc") + (version "0.5.1") (source (origin (method url-fetch) - (uri (pypi-uri "uhi" version)) + (uri (pypi-uri "scikit_misc" version)) (sha256 - (base32 "0753b7yw0zi06g4azafnk3w8i3q6js9i6wwg3pya464gygrbnncm")))) + (base32 "18sj7qa3kk4pqh3rzg2c64lf03nciv9cf985yh1h2kpqqndgdhf5")))) (build-system pyproject-build-system) - (propagated-inputs (list python-numpy)) - (native-inputs (list python-boost-histogram - python-fastjsonschema - python-hatch-vcs - python-hatchling - python-pytest)) - (home-page "https://github.com/scikit-hep/uhi") - (synopsis "Universal Histogram Interface") - (description "This is a package meant primarily for documenting histogram -indexing and the PlottableHistogram Protocol and any future cross-library -standards. It also contains the code for the PlottableHistogram Protocol, to -be used in type checking libraries wanting to conform to the protocol. It is -not usually a runtime dependency, but only a type checking, testing, and/or -docs dependency in support of other libraries.") + (arguments + (list + #:test-flags + '(list "--pyargs" "skmisc") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'fix-version + (lambda _ + (call-with-output-file "skmisc/_version.py" + (lambda (port) + (display (string-append "__version__ = \"" #$version "\"") + port))) + (substitute* "meson.build" + (("^ version: run_command.*") + (string-append " version: '" #$version "',\n"))) + (substitute* "pyproject.toml" + (("dynamic = \\['version'\\]") + (string-append "version = \"" #$version "\"")))))))) + (native-inputs + (list gfortran + python-meson + python-spin + python-pytest + python-setuptools)) + (propagated-inputs + (list python-numpy)) + (home-page "https://has2k1.github.io/scikit-misc/stable") + (synopsis "Miscellaneous tools for scientific computing.") + (description "This package provides miscellaneous tools for data analysis +and scientific computing.") (license license:bsd-3))) -(define-public python-unyt +(define-public python-scikit-opt (package - (name "python-unyt") - (version "3.1.0") + (name "python-scikit-opt") + (version "0.6.6") (source (origin (method url-fetch) - (uri (pypi-uri "unyt" version)) + (uri (pypi-uri "scikit-opt" version)) (sha256 - (base32 "07g5rasgikp8a4x0cylz8xxzgh3536djdjppcadiqlhygyl845bp")))) + (base32 "0ycqizgsj7q57asc1bphzhf1fx9zqn0vx5rli7q541bas64hfqiy")))) (build-system pyproject-build-system) - ;; tests: 764 passed, 37 skipped, 2 xfailed (native-inputs - (list python-flit-core - python-pytest)) + (list python-pytest + python-setuptools)) (propagated-inputs (list python-numpy - python-packaging - python-sympy)) - (home-page "https://unyt.readthedocs.io") - (synopsis "Library for working with data that has physical units") + python-pytorch + python-scipy)) + (home-page "https://github.com/guofei9987/scikit-opt") + (synopsis "Swarm intelligence algorithms in Python") (description - "@code{unyt} is a Python library working with data that has physical -units. It defines the @code{unyt.array.unyt_array} and -@code{unyt.array.unyt_quantity} classes (subclasses of NumPy’s ndarray class) -for handling arrays and scalars with units,respectively") - (license license:bsd-3))) + "Scikit-opt (or sko) is a Python module implementing @dfn{swarm +intelligence} algorithms: genetic algorithm, particle swarm optimization, +simulated annealing, ant colony algorithm, immune algorithm, artificial fish +swarm algorithm.") + (license license:expat))) -(define-public python-uproot +(define-public python-scikit-optimize + ;; XXX: The project might be not maintained, see + ;; . (package - (name "python-uproot") - (version "5.6.4") + (name "python-scikit-optimize") + (version "0.10.2") (source (origin - (method url-fetch) - (uri (pypi-uri "uproot" version)) + (method git-fetch) + (uri (git-reference + (url "https://github.com/holgern/scikit-optimize") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) (sha256 - (base32 "024k5kjwcd2nw5hfxhpl0x9p5aq0qrg0nlh9v24vr39rcqadh52a")))) + (base32 "0pc6avzxz8l32km5jvv3maih0a5x2akxybvxl2hdg04qz2l0kz8b")))) (build-system pyproject-build-system) (arguments (list + ;; tests: 398 passed, 1 skipped, 179 warnings #:test-flags - #~(list - ;; conftest.py is not required and it imports modules we do not use. - "--noconftest" - ;; There is no easy way to skip tests that require the network, so - ;; just run a handful of tests that pass. - "tests/test_0351_write_TList.py" - "tests/test_0352_write_THashList.py" - "tests/test_0439_check_awkward_before_numpy.py" - "tests/test_0976_path_object_split.py" - "tests/test_1198_coalesce.py" - "tests/test_1264_write_NumPy_array_of_strings.py" - "tests/test_1318_dont_compare_big_endian_in_awkward.py") + #~(list "--numprocesses" (number->string (parallel-job-count)) + "-k" (string-join + ;; XXX: As the project is not actively maintained, review + ;; failing test when a fresh release is available. + (list "not test_acq_optimizer" + "test_acq_optimizer_with_time_api" + "test_categorical_init_vals" + "test_consistent_x_iter_dimensions" + "test_early_stopping_delta_x" + "test_early_stopping_delta_x_empty_result_object" + "test_early_stopping_delta_y" + "test_early_stopping_delta_y_with_x0" + "test_exhaust_initial_calls" + "test_fixed_random_states" + "test_init_points_and_models" + "test_init_vals" + "test_init_vals_and_models" + "test_minimizer_api" + "test_minimizer_api_random_only" + "test_minimizer_space_constraint" + "test_minimizer_with_space" + "test_mixed_spaces" + "test_optimizer_base_estimator_string_smoke" + "test_optimizer_base_estimator_string_smoke_njobs" + "test_per_second_api" + "test_repeated_x" + "test_tree_based_minimize") + " and not ")))) + (native-inputs + (list python-pytest + python-pytest-xdist + python-setuptools)) + (propagated-inputs + (list python-joblib + python-matplotlib + python-numpy + python-pyaml + python-scikit-learn + python-scipy)) + (home-page "https://scikit-optimize.github.io/") + (synopsis "Sequential model-based optimization toolbox") + (description + "Scikit-Optimize, or @code{skopt}, is a simple and efficient library to +minimize (very) expensive and noisy black-box functions. It implements +several methods for sequential model-based optimization. @code{skopt} aims to +be accessible and easy to use in many contexts.") + (license license:bsd-3))) + +(define-public python-scikit-surprise + (package + (name "python-scikit-surprise") + (version "1.1.5") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/NicolasHug/Surprise") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1jw05xb8w7d5vx0v8gjd51a5bp1zwqy5adcpaf8fy5mfrdjn6hpp")))) + (build-system pyproject-build-system) + (arguments + (list + ;; tests: 82 passed #:phases #~(modify-phases %standard-phases - (add-after 'unpack 'set-version + (add-before 'sanity-check 'set-home (lambda _ - ;; Version is determined dynamically from .git. - (substitute* "pyproject.toml" - (("\\[project\\]") - (string-append "[project]" "\n" "version = \"" - #$version "\"")) - (("\"version\"") ""))))))) + ;; Change from /homeless-shelter to /tmp for write + ;; permission. + (setenv "HOME" "/tmp")))))) (native-inputs - (list python-hatch-vcs + (list python-cython + python-pandas-minimal python-pytest - python-pytest-timeout python-setuptools)) (propagated-inputs - (list python-awkward - python-cramjam - python-fsspec + (list python-joblib python-numpy - python-packaging - python-xxhash)) - (home-page "https://uproot.readthedocs.io") - (synopsis "ROOT I/O in Python using NumPy") + python-scikit-learn)) + (home-page "https://surpriselib.com/") + (synopsis "Recommender system library for Scikit-learn") (description - "Uproot is a Python library for reading and writing ROOT files. It uses -NumPy and does not depend on C++ ROOT.") + "This package provides a Python library for building and analyzing +recommender systems that deal with explicit rating data. It was designed with +the following purposes in mind: +@itemize +@item Provide tools to handle downloaded or user-provided datasets. +@item Provide ready-to-use prediction algorithms and similarity measures. +@item Provide a base for creating custom algorithms. +@item Provide tools to evaluate, analyse and compare algorithm performance. +@item Provide documentation with precise details regarding library algorithms. +@end itemize") (license license:bsd-3))) -(define-public python-upsetplot +(define-public python-scikit-survival (package - (name "python-upsetplot") - ;; Latest release is incompatible with Pandas 3 and NumPy 2.4. - (properties '((commit . "e9603da19d321c047f88d404f687e82be415e52c") - (revision . "1"))) - (version (git-version "0.9.0" - (assoc-ref properties 'revision) - (assoc-ref properties 'commit))) + (name "python-scikit-survival") + (version "0.26.0") (source (origin (method git-fetch) (uri (git-reference - ;; Using a fork of https://github.com/jnothman/UpSetPlot - ;; original source that is updated for Pandas 3 compatibility, - ;; see . - (url "https://github.com/kevinpetersavage/UpSetPlot") - (commit (assoc-ref properties 'commit)))) + (url "https://github.com/sebp/scikit-survival") + (commit (string-append "v" version)) + ;; TODO: This package contains a copy of Eigen in + ;; sksurv/linear_model/src. It would be good to figure out + ;; how to use our own Eigen package. + (recursive? #true))) (file-name (git-file-name name version)) (sha256 - (base32 "155g0x4z0zdfri528spws5mad4d24vadsc827iy92f5br7vbf3j3")))) + (base32 "0r0xi9saz247ph6bgrc3iknq0m60d8rs4sl4mdv4s1zja80w1cp8")))) (build-system pyproject-build-system) + (arguments + (list + ;; tests: 1013 passed, 105 warnings + #:test-flags + #~(list "--durations=10" ;to help in spotting long running tests + "--numprocesses" (number->string (min 4 (parallel-job-count)))))) (propagated-inputs - (list python-matplotlib python-pandas)) + (list python-ecos + python-joblib + python-numexpr + python-numpy + python-osqp + python-pandas + python-scikit-learn + python-scipy)) (native-inputs - (list python-pytest python-setuptools)) - (home-page "https://upsetplot.readthedocs.io") - (synopsis "Draw UpSet plots with Pandas and Matplotlib") - (description - "This is a Python implementation of UpSet plots by Lex et al. -UpSet plots are used to visualize set overlaps; like Venn diagrams but more -readable.") - (license license:bsd-3))) + (list python-cython + python-packaging + python-pytest + python-pytest-xdist + python-setuptools + python-setuptools-scm)) + (home-page "https://github.com/sebp/scikit-survival") + (synopsis "Survival analysis built on top of scikit-learn") + (description "Scikit-survival is a Python module for survival analysis +built on top of scikit-learn. It allows doing survival analysis while +utilizing the power of scikit-learn, e.g., for pre-processing or doing +cross-validation.") + (license license:gpl3+))) -(define-public python-vaex-core +(define-public python-scipy (package - (name "python-vaex-core") - (version "4.19.0") + (name "python-scipy") + (version "1.17.1") + ;; TODO: PyPI archive bundles extra in subprojects: + ;; - https://github.com/boostorg/math + ;; - https://github.com/scipy/HiGHS + ;; - https://github.com/scipy/xsf + ;; - qhull (source (origin - (method git-fetch) - (uri (git-reference - (url "https://www.github.com/maartenbreddels/vaex") - (commit (string-append "core-v" version)))) - (file-name (git-file-name name version)) + (method url-fetch) + (uri (pypi-uri "scipy" version)) (sha256 - (base32 "1m6h6m0vm8vdx2nk26nvlbyfvlj0g9ph8cdh38258gn18fd2db0l")) - (patches - (search-patches "python-vaex-core-fix-tsl-use.patch")) - (modules '((guix build utils) - (ice-9 ftw))) - (snippet - #~(begin - ;; Delete everything except for vaex-core itself: - (define (delete-except exception) - (lambda (file) - (unless (member file `("." ".." ,exception)) - (delete-file-recursively file)))) - (for-each (delete-except "packages") (scandir ".")) - (with-directory-excursion "packages" - (for-each (delete-except "vaex-core") (scandir "."))) - (for-each (lambda (file) - (unless (member file '("." "..")) - (rename-file - (string-append "packages/vaex-core/" file) - file))) - (scandir "packages/vaex-core")) - (delete-file-recursively "packages") - (delete-file-recursively "vendor"))))) + (base32 "1h4pn8i33cf5jzlh6hs6sjg10i8x1ch35y5f4v11d26bv09f1n4m")))) (build-system pyproject-build-system) (arguments (list - ;; TODO: Require vaex.server and others, which require vaex-core; - ;; implement bootstrapping. - #:tests? #f + ;; tests: 81362 passed, 7493 skipped, 313 xfailed, 28 xpassed, 225 warnings + #:configure-flags + ''(("setup-args" . #("-Duse-system-libraries=all"))) + #:test-flags + #~(list "--durations=10" + "--numprocesses" (number->string (min 8 (parallel-job-count))) + "--pyargs" "scipy" + "-k" (string-join + ;; Network access is required. + (list "not test_ascent" + "test_electrocardiogram" + "test_existence_all" + "test_face" + ;; pycparser.ply.yacc.YaccError: Unable to build parser + "test_callbacks" + "test_bad_callbacks" + ;; AssertionError: Items are not equal: ACTUAL: + ;; np.complex128(inf+nanj) DESIRED: (inf+0j) + "test_expm1_complex" + ;; Bad results (X out of Y) for the following points + ;; (in output 0): + "test_spherical_in_complex" + "test_spherical_jn_complex" + "test_spherical_kn" + "test_spherical_yn_complex" + ;; Not equal to tolerance <...> + "test_log1p_complex" + "test_negative_real_gh14582[spherical_in-False]" + "test_negative_real_gh14582[spherical_in-True]" + "test_negative_real_gh14582[spherical_jn-False" + "test_negative_real_gh14582[spherical_jn-True]" + "test_negative_real_gh14582[spherical_yn-False]" + "test_negative_real_gh14582[spherical_yn-True]") + " and not ")) #:phases #~(modify-phases %standard-phases - (add-after 'unpack 'relax-requirements - (lambda _ - (substitute* "setup.py" - ;; "dask!=2022.4.0,<2024.9"; there is a note "fingerprinting - ;; in no longer deterministic as of 2024.9.0" which may be - ;; resolved in 2024.12.1. - ((",<2024.9") "") - ;; There is no a fresh version supporting Pandas 3 yet, built - ;; has passed but sanity-check fails. - (("pandas>=1.0,<3") "pandas>=1.0")))) - (add-before 'build 'patch-missing-include - (lambda _ - ;; See: . - ;; TODO: Update to the latest version including the fix. - (substitute* "src/string_utils.hpp" - (("#include ") - "#include \n#include "))))))) + (add-after 'set-paths 'hide-gfortran + ;; See: . + (lambda* (#:key inputs #:allow-other-keys) + (let ((gfortran #$(this-package-native-input "gfortran"))) + (setenv "CPLUS_INCLUDE_PATH" + (string-join + (delete (string-append gfortran "/include/c++") + (string-split (getenv "CPLUS_INCLUDE_PATH") #\:)) + ":"))))) + (replace 'check + (lambda* (#:key test-flags tests? #:allow-other-keys) + (when tests? + ;; Step out of the source directory to avoid interference. + ;; See: <.github/workflows/linux.yml> for any other possible + ;; tests setup. + (with-directory-excursion "/tmp" + (setenv "HOME" "/tmp") + (setenv "PYTHONOPTIMIZE" "2") + (apply invoke "pytest" "-vv" test-flags)))))))) (native-inputs - (list pybind11 - python-cython - python-setuptools)) + (list gfortran + pkg-config + python-hypothesis + python-meson + python-mpmath + python-pooch + python-pytest + python-pytest-timeout + python-pytest-xdist + python-pythran + python-threadpoolctl)) (inputs (list boost - pcre - string-view-lite - tsl-hopscotch-map)) + openblas + pybind11 + qhull + xsimd)) (propagated-inputs - (list python-aplus - python-blake3 - python-cloudpickle - python-dask - python-filelock - python-frozendict - python-future - python-nest-asyncio - python-numpy - python-pandas - python-pyarrow - python-pydantic - python-pyyaml - python-rich - python-six ;hard dependency - python-tabulate - ;; [optional] - python-diskcache - python-fsspec - ;; python-gcsfs ;not packaged yet in Guix - python-graphviz - python-h5py - python-httpx - ;; python-ipyvolume ;not packaged yet in Guix - python-psutil - python-s3fs)) - (home-page "https://www.github.com/maartenbreddels/vaex") - (synopsis "Core of Vaex library for exploring tabular datasets") - (description "Vaex is a high performance Python library for lazy -Out-of-Core DataFrames (similar to Pandas), to visualize and explore big -tabular datasets. This package provides the core modules of Vaex.") - (license license:expat))) + (list python-numpy)) + (home-page "https://scipy.org/") + (synopsis "The Scipy library provides efficient numerical routines") + (description "The SciPy library is one of the core packages that make up +the SciPy stack. It provides many user-friendly and efficient numerical +routines such as routines for numerical integration and optimization.") + (license license:bsd-3))) -(define-public python-vector +;; A bare minimal package, mainly to use in tests and reduce closure +;; size. Tests are left out in the main package to slim down native-inputs. +(define-public python-scipy-minimal + (package/inherit python-scipy + (name "python-scipy-minimal") + (arguments + (substitute-keyword-arguments arguments + ((#:tests? _ #t) #f))) + (native-inputs + (list gfortran + pkg-config + python-meson + python-pythran)))) + +(define-public python-scs (package - (name "python-vector") - (version "1.8.0") + (name "python-scs") + (version "3.2.10") (source (origin - (method url-fetch) - (uri (pypi-uri "vector" version)) + (method git-fetch) + (uri (git-reference + (url "https://github.com/bodono/scs-python") + (commit version))) + (file-name (git-file-name name version)) (sha256 - (base32 "19jc889z6jxfyyqya5c6sx0hps6j5zgj0shp6k552f264jg5xyaq")))) + (base32 "1wg1g6das5hs53z3sjn2m8646023d14q9shmwfb38n23baqi468g")))) (build-system pyproject-build-system) (arguments (list - ;; tests: 813 passed, 3 skipped, 1 deselected - #:test-flags - ;; assert array([2.]) == array([-2.]) - #~(list "--deselect=tests/test_issues.py::test_issue_443" ))) + ;; tests: 26 passed + #:phases + #~(modify-phases %standard-phases + (add-after 'ensure-no-mtimes-pre-1980 'substitute-git-submodules + (lambda _ + (rmdir "scs_source") + (symlink #$(package-source + (this-package-native-input "scs")) + "scs_source") + (rmdir "scs/pythoncapi-compat") + (symlink #$(package-source + (this-package-native-input "pythoncapi-compat")) + "scs/pythoncapi-compat")))))) (native-inputs - (list ;; python-dask-awkward ;not packaged yet in Guix - python-hatch-vcs - python-hatchling - ;; python-jax ;not packaged yet in Guix - python-notebook - python-optree - python-papermill + (list pkg-config + python-meson python-pytest - #;python-spark-parse)) ;not packaged yet in Guix + pythoncapi-compat + scs)) + (inputs + (list lapack + openblas)) (propagated-inputs (list python-numpy - python-packaging - ;; [optional] - python-awkward - python-numba - python-sympy)) - (home-page "https://github.com/scikit-hep/vector") - (synopsis "Arrays of 2D, 3D, and Lorentz vectors") - (description "Vector is a Python library for 2D and 3D spatial vectors, as -well as 4D space-time vectors. It is especially intended for performing -geometric calculations on arrays of vectors, rather than one vector at a time -in a Python @code{for} loop.") - (license license:bsd-3))) + python-scipy)) + (home-page "https://github.com/bodono/scs-python") + (synopsis "Splitting conic solver") + (description "This package provides a Python interface for the +SCS (Splitting conic solver) library.") + (license license:expat))) -(define-public python-vedo +(define-public python-simple-pid (package - (name "python-vedo") - (version "2025.5.4") + (name "python-simple-pid") + (version "2.0.1") + (source (origin + (method url-fetch) + (uri (pypi-uri "simple_pid" version)) + (sha256 + (base32 + "17p9bgka5yv5lbnbk374yjccrlizm572wv3xb479072lahf7cwap")))) + (build-system pyproject-build-system) + (native-inputs + (list python-pytest python-setuptools python-wheel)) + (home-page "https://github.com/m-lundberg/simple-pid") + (synopsis "Easy to use PID controller") + (description "This package provides a simple and easy-to-use @acronym{PID, +proportional-integral-derivative} controller.") + (license license:expat))) + +(define-public python-simplespectral + (package + (name "python-simplespectral") + (version "1.0.0") (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/marcomusy/vedo") - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) + (method url-fetch) + (uri (pypi-uri "SimpleSpectral" version)) (sha256 - (base32 "17lrx30pdag0d3d5a2cycfylsbhad4ywikza784h2fg95w77y1va")))) + (base32 "0qh3xwdv9cwcqdamvglrhm586p4yaq1hd291py1fvykhk2a2d4w6")))) (build-system pyproject-build-system) (arguments - (list - ;; XXX: The whole test suite depends on the data from - ;; providing samples which need to be - ;; downloaded during tests, find the way how to enable it. - #:tests? #f - #:phases - #~(modify-phases %standard-phases - (add-after 'unpack 'relax-requirements - ;; vtk does not provide Python metadata. - ;; - ;; ...checking requirements: ERROR: vedo==2025.5.4 - ;; DistributionNotFound(Requirement.parse('vtk'), {'vedo'}) - (lambda _ - (substitute* "pyproject.toml" - (("\"vtk\",") ""))))))) + (list #:tests? #f)) ;No tests, also not in git repository. (native-inputs - (list pkg-config - python-pkgconfig - python-setuptools - python-wheel)) + (list python-setuptools)) (propagated-inputs - (list python-deprecated - python-matplotlib - python-numpy - python-pygments - vtk)) - (home-page "https://github.com/marcomusy/vedo") - (synopsis - "Analysis and visualization of 3D objects and point clouds") + (list python-numpy python-scipy)) + (home-page "https://github.com/xmikos/simplespectral") + (synopsis "FFT module for Python") (description - "@code{vedo} is a fast and lightweight python module for -scientific analysis and visualization. The package provides a wide -range of functionalities for working with three-dimensional meshes and -point clouds. It can also be used to generate high quality -two-dimensional renderings such as scatter plots and histograms. -@code{vedo} is based on @code{vtk} and @code{numpy}.") - ;; vedo is released under the Expat license. Included fonts are - ;; covered by the OFL license and textures by the CC0 license. - ;; The earth images are in the public domain. - (license (list license:expat - license:silofl1.1 - license:cc0 - license:public-domain)))) + "This package provides a simplified @code{scipy.signal.spectral} module +to do spectral analysis in Python.") + (license license:expat))) -(define-public python-xarray +(define-public python-snakemake-executor-plugin-slurm (package - (name "python-xarray") - (version "2026.04.0") + (name "python-snakemake-executor-plugin-slurm") + (version "1.7.0") + (home-page "https://github.com/snakemake/snakemake-executor-plugin-slurm/") (source (origin (method git-fetch) (uri (git-reference - (url "https://github.com/pydata/xarray") + (url home-page) (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "1ma0k5gw5frldms4zrgp5ww0l1m5h5620ks5sdljbjz4wqbsf9di")))) + (base32 "0x7ghrkvmxqbcjl69hxp5axa1av3s0mdc0i9xjg8qjnd3hgd82r3")))) (build-system pyproject-build-system) (arguments - (list - ;; tests: 7500 passed, 9135 skipped, 24 xfailed, 6 xpassed, 45 warnings - #:test-flags - #~(list "--numprocesses" (number->string (min 8 (parallel-job-count))) - ;; Regression in Pandas 3.0.3. - ;; See: . - (string-append "--deselect=properties/test_pandas_roundtrip.py" - "::test_roundtrip_pandas_dataframe_datetime") - ;; See: . - (string-append "--deselect=xarray/tests/test_dataset.py" - "::TestDataset::test_repr")) - #:phases - #~(modify-phases %standard-phases - (add-after 'unpack 'fix-pytest-config - (lambda _ - (substitute* "pyproject.toml" - ((".*--mypy-.*") ""))))))) - (native-inputs - (list python-pytest - python-pytest-asyncio - python-pytest-xdist - python-pytz - python-setuptools - python-setuptools-scm - tzdata-for-tests)) - (propagated-inputs - (list python-numpy - python-packaging - python-pandas - ;; [optional] - python-bottleneck - ;; python-cartopy - ;; python-cftime - ;; python-dask - ;; python-flox - ;; python-fsspec - ;; python-h5netcdf - ;; python-matplotlib - ;; python-nc-time-axis - ;; python-netcdf4 - python-numba - ;; python-numbagg ;blocked by guix/guix#9344 - ;; python-opt-einsum - ;; python-pooch - ;; python-pydap - python-scipy-minimal ;to slim down closure size - ;; python-seaborn - ;; python-sparse - #;python-zarr)) - (home-page "https://github.com/pydata/xarray") - (synopsis "N-D labeled arrays and datasets") - (description "Xarray (formerly xray) makes working with labelled -multi-dimensional arrays simple, efficient, and fun! - -Xarray introduces labels in the form of dimensions, coordinates and attributes -on top of raw NumPy-like arrays, which allows for a more intuitive, more -concise, and less error-prone developer experience. The package includes a -large and growing library of domain-agnostic functions for advanced analytics -and visualization with these data structures.") - (license license:asl2.0))) + (list #:phases + #~(modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "python3" "tests/tests.py"))))))) + (native-inputs (list python-pandas + python-poetry-core + python-pytest + python-snakemake-executor-plugin-slurm-jobstep + snakemake)) + (synopsis "Snakemake executor plugin: slurm") + (description "A Snakemake executor plugin for running SLURM jobs.") + (license license:expat))) -(define-public python-xarray-dataclass +(define-public python-snakemake-executor-plugin-slurm-jobstep (package - (name "python-xarray-dataclass") - (version "3.0.0") + (name "python-snakemake-executor-plugin-slurm-jobstep") + (version "0.3.0") + (home-page "https://github.com/snakemake/snakemake-executor-plugin-slurm-jobstep") (source (origin (method git-fetch) (uri (git-reference - (url "https://github.com/xarray-contrib/xarray-dataclass/") + (url home-page) (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "1q3y9gbzrp1mh48y7gggqgggwnarxdn32h907mfax1hi9ap6ywil")))) - (build-system pyproject-build-system) - (native-inputs - (list python-pytest - python-hatchling)) - (propagated-inputs - (list python-numpy - python-typing-extensions - python-xarray)) - (home-page "https://github.com/xarray-contrib/xarray-dataclass/") - (synopsis "Xarray data creation by data classes") - (description - "xarray-dataclass is a Python package that makes it easy to create -@url{https://xarray.pydata.org/en/stable/index.html, xarray}'s DataArray and -Dataset objects that are \"typed\" (i.e. fixed dimensions, data type, -coordinates, attributes, and name) using -@url{https://docs.python.org/3/library/dataclasses.html, the Python's -dataclass}. It's a successor of not maintained -https://github.com/astropenguin/xarray-dataclasses.") + (base32 "0ly15ywmbfcm5z7jy7dxiidpw3immsdd2k80vrm4pza721irxcar")))) + (build-system pyproject-build-system) + (arguments + (list #:phases + #~(modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "python3" "tests/tests.py"))))))) + (native-inputs (list python-poetry-core + snakemake)) + (synopsis "Snakemake executor plugin: slurm-jobstep") + (description "A Snakemake executor plugin for running srun jobs inside of +SLURM jobs (meant for internal use by python-snakemake-executor-plugin-slurm).") (license license:expat))) -(define-public python-xarray-dataclasses +(define-public python-snakemake-interface-common (package - (name "python-xarray-dataclasses") - (version "1.7.0") + (name "python-snakemake-interface-common") + (version "1.17.4") (source (origin (method git-fetch) (uri (git-reference - (url "https://github.com/astropenguin/xarray-dataclasses/") + (url "https://github.com/snakemake/snakemake-interface-common") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "043lc1hadr5y0y16g682viiafy0hfsa7q18lqmndpyvnmcgm893z")))) + (base32 "19fyqs048zdvrmq5sdayzch850kwsyv2x6xn57cjjzcm4zpjrh9w")))) (build-system pyproject-build-system) - (propagated-inputs (list python-numpy python-typing-extensions - python-xarray)) - (native-inputs (list python-pytest python-poetry-core)) - (home-page "https://github.com/astropenguin/xarray-dataclasses/") - (synopsis "Data creation made easy by dataclass") - (description "@code{xarray-dataclasses} is a Python package that makes it -easy to create @code{xarray}'s @code{DataArray} and @code{Datase} objects that -are \"typed\" (i.e. fixed dimensions, data type, coordinates, attributes, and -name) using the Python's @code{dataclass}.") + (arguments + (list #:phases + #~(modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "python3" "tests/tests.py"))))))) + (native-inputs (list python-poetry-core python-pytest)) + (propagated-inputs (list python-argparse-dataclass python-configargparse)) + (home-page "https://github.com/snakemake/snakemake-interface-common") + (synopsis "Common functions and classes for Snakemake and its plugins") + (description "This package provides common functions and classes +for Snakemake and its plugins.") (license license:expat))) -(define-public python-xarray-einstats +(define-public python-snakemake-interface-executor-plugins (package - (name "python-xarray-einstats") - (version "0.9.1") + (name "python-snakemake-interface-executor-plugins") + (version "9.3.3") (source (origin (method git-fetch) (uri (git-reference - (url "https://github.com/arviz-devs/xarray-einstats") - (commit (string-append "v" version)))) + (url (string-append "https://github.com/snakemake/" + "snakemake-interface-executor-plugins")) + (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "11crz1l6swabwzmwbrxypfw8gbbp81higzgi5nsxzfigcrrqq30a")))) + (base32 "1kjjcgkk1rbavb687x5ayw35ayhsnhpg9262k317x911wqpsj2fm")))) (build-system pyproject-build-system) - ;; tests: 317 passed, 48 skipped - (native-inputs - (list python-flit-core - python-pytest)) - (propagated-inputs - (list python-numpy - python-scipy - python-xarray - ;; [optinoal] - python-einops - python-numba)) - (home-page "https://einstats.python.arviz.org/en/latest/") - (synopsis "Stats, linear algebra and einops for xarray") + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "python3" "tests/tests.py"))))))) + (propagated-inputs (list python-argparse-dataclass + python-snakemake-interface-common + python-throttler)) + (native-inputs (list python-poetry-core python-pytest)) + (home-page (string-append "https://github.com/snakemake/" + "python-snakemake-interface-executor-plugins")) + (synopsis "Interface for Snakemake executor plugins") (description - "@code{xarray_einstats} provides wrappers around some NumPy and SciPy -functions and around einops with an API and features adapted to xarray.") - (license license:asl2.0))) + "This package provides a stable interface for interactions between Snakemake and +its executor plugins.") + (license license:expat))) -(define-public python-xarray-schema +(define-public python-snakemake-interface-report-plugins (package - (name "python-xarray-schema") - (version "0.0.3") + (name "python-snakemake-interface-report-plugins") + (version "1.1.0") (source (origin - (method url-fetch) - (uri (pypi-uri "xarray-schema" version)) + (method git-fetch) + (uri (git-reference + (url (string-append "https://github.com/snakemake/" + "snakemake-interface-report-plugins")) + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) (sha256 - (base32 "08194629696z98dkc74i6c9zmy1jicvd2ajb75q0lsf0i427cv4w")))) + (base32 "0i6z9vk6nv2m3jsym0glrb7h9isdlfza2yq14vbqcslybdi9ykfa")))) (build-system pyproject-build-system) - (propagated-inputs (list python-numpy python-xarray)) - (native-inputs - (list python-pytest - python-setuptools - python-setuptools-scm - python-wheel)) - (home-page "https://github.com/carbonplan/xarray-schema") - (synopsis "Schema validation for Xarray objects") - (description "This package implements schema validation for Xarray -objects.") + (arguments + (list + #:tests? #f ;circular dependency on snakemake + #:phases + #~(modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "python3" "tests/tests.py"))))))) + (propagated-inputs (list python-snakemake-interface-common python-pytest)) + (native-inputs (list python-poetry-core)) + (home-page (string-append "https://github.com/snakemake/" + "python-snakemake-interface-report-plugins")) + (synopsis "Interface for Snakemake report plugins") + (description "This package provides a stable interface for interactions +between Snakemake and its report plugins.") (license license:expat))) -(define-public python-pytensor +(define-public python-snakemake-interface-software-deployment-plugins (package - (name "python-pytensor") - (version "3.2.4") - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/pymc-devs/pytensor") - (commit (string-append "rel-" version)))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "0wqklzah9rysxnmf34zrj4njc1k79r9n9kbi1cnm6qj2dds6bm3d")))) + (name "python-snakemake-interface-software-deployment-plugins") + (version "0.6.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url (string-append "https://github.com/snakemake/" + "snakemake-interface-software-deployment-plugins")) + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0b4kkznfyfck9f92pkimhyl13ljisfn67rsilm1a5inq2ywpmxba")))) (build-system pyproject-build-system) (arguments (list - ;; tests: 1906 passed, 2581 skipped, 34 deselected, 12 xfailed, 274 warnings - #:test-flags - ;; XXX: Full test suite takes about 20-30min to complete in single - ;; thread, attempt to run tests in parallel with pytest-xdist fails even - ;; so upstream provides a support for that, try to figure out how to - ;; improve it. - ;; - ;; Upstream implements a script, showing slow tests which may be used to - ;; exclude even more hanging/slow ones, see: - ;; . - ;; - #~(list "--benchmark-disable" - "--benchmark-skip" - "--durations=50" - ;; Skip computationally intensive tests. - "--ignore=tests/scan/" - "--ignore=tests/tensor/" - "--ignore=tests/sandbox/" - "--ignore=tests/sparse/sandbox/" - ;; A mixture of assertions are not equal in these tests. - "--deselect=tests/link/numba/test_nlinalg.py::test_Eigh[x0-L-None]" - #$@(map (lambda (test) - (string-append "--deselect=tests/graph/rewriting/" - "test_basic.py::" - test)) - ;; Tests fail with similar errors: AssertionError: - ;; assert 'FunctionGraph(Op1(Op2(x, y), z))' == - ;; 'FunctionGraph(Op4(z, y))' - (list "TestPatternNodeRewriter::test_replace_output" - "TestPatternNodeRewriter::test_nested_out_pattern" - "TestPatternNodeRewriter::test_unification_1" - "TestPatternNodeRewriter::test_replace_subgraph" - "TestPatternNodeRewriter::test_no_recurse" - "TestPatternNodeRewriter::test_multiple" - "TestPatternNodeRewriter::test_nested_even" - "TestPatternNodeRewriter::test_nested_odd" - "TestPatternNodeRewriter::test_expand" - "TestPatternNodeRewriter::test_ambiguous" - "TestPatternNodeRewriter::test_constant" - "TestPatternNodeRewriter::test_constraints" - "TestPatternNodeRewriter::test_match_same" - "TestPatternNodeRewriter::test_eq" - "TestEquilibrium::test_1" - "TestEquilibrium::test_2" - "TestEquilibrium::test_low_use_ratio" - ;; A mixture of assertions are not equal: - "TestPatternNodeRewriter::test_allow_multiple_clients" - "TestPatternNodeRewriter::test_op_pattern" - "test_patternsub_values_eq_approx[out_pattern0-True]" - "test_patternsub_values_eq_approx[out_pattern0-False]" - "test_patternsub_values_eq_approx[x-True]" - "test_patternsub_values_eq_approx[x-False]" - "test_patternsub_multi_output_nodes")) - #$@(map (lambda (test) - (string-append "--deselect=tests/graph/" test)) - (list "rewriting/test_kanren.py::test_kanren_basic" - "rewriting/test_kanren.py::test_KanrenRelationSub_filters" - "rewriting/test_kanren.py::test_KanrenRelationSub_dot" - "rewriting/test_unify.py::test_unify_Variable" - "rewriting/test_unify.py::test_ConstrainedVar" - "rewriting/test_unify.py::test_unify_OpPattern" - "test_destroyhandler.py::test_misc"))) #:phases #~(modify-phases %standard-phases - (add-before 'check 'pre-check - (lambda _ - ;; It is required for most tests. - (setenv "HOME" "/tmp") - ;; This would otherwise interfere with finding the installed - ;; pytensor when running tests. - (delete-file-recursively "pytensor")))))) - (native-inputs (list python-cython - python-pytest - python-pytest-benchmark - python-pytest-mock - python-pytest-xdist - python-versioneer - python-setuptools)) - (propagated-inputs (list python-cons - python-etuples - python-filelock - python-logical-unification - python-minikanren - python-numba - python-numpy - python-scipy - ;; [optional] - ;; python-jaxlib - ;; python-jax - #;python-llvmlite)) - (home-page "https://pytensor.readthedocs.io/en/latest/") - (synopsis - "Library for mathematical expressions in multi-dimensional arrays") + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "python3" "tests/tests.py"))))))) + (propagated-inputs (list python-argparse-dataclass + python-snakemake-interface-common)) + (native-inputs (list python-poetry-core)) + (home-page (string-append "https://github.com/snakemake/" + "snakemake-interface-software-deployment-plugins")) + (synopsis "Interface for Snakemake software deployment plugins") (description - "PyTensor is a Python library that allows one to define, optimize, and -efficiently evaluate mathematical expressions involving multi-dimensional -arrays. It is a fork of the Aesara library.") - (license license:bsd-3))) + "This package provides a stable interface for interactions between Snakemake and +its software deployment plugins.") + (license license:expat))) -(define-public python-scs +(define-public python-snakemake-interface-storage-plugins (package - (name "python-scs") - (version "3.2.10") + (name "python-snakemake-interface-storage-plugins") + (version "3.6.0") (source (origin (method git-fetch) (uri (git-reference - (url "https://github.com/bodono/scs-python") - (commit version))) + (url (string-append "https://github.com/snakemake/" + "snakemake-interface-storage-plugins")) + (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "1wg1g6das5hs53z3sjn2m8646023d14q9shmwfb38n23baqi468g")))) + (base32 "1dh52nkvq9zhh28xmbbq74kzhzagcy48d3vgb39bd3ckjz8libgy")))) (build-system pyproject-build-system) (arguments (list - ;; tests: 26 passed + #:tests? #f ;circular dependency on snakemake #:phases #~(modify-phases %standard-phases - (add-after 'ensure-no-mtimes-pre-1980 'substitute-git-submodules + (add-after 'unpack 'relax-requirements (lambda _ - (rmdir "scs_source") - (symlink #$(package-source - (this-package-native-input "scs")) - "scs_source") - (rmdir "scs/pythoncapi-compat") - (symlink #$(package-source - (this-package-native-input "pythoncapi-compat")) - "scs/pythoncapi-compat")))))) - (native-inputs - (list pkg-config - python-meson - python-pytest - pythoncapi-compat - scs)) - (inputs - (list lapack - openblas)) - (propagated-inputs - (list python-numpy - python-scipy)) - (home-page "https://github.com/bodono/scs-python") - (synopsis "Splitting conic solver") - (description "This package provides a Python interface for the -SCS (Splitting conic solver) library.") + (substitute* "pyproject.toml" + (("wrapt = \".*\"") + "wrapt = \"*\"")))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "python3" "tests/tests.py"))))))) + (propagated-inputs (list python-reretry python-snakemake-interface-common + python-throttler python-wrapt)) + (native-inputs (list python-poetry-core python-pytest)) + (home-page (string-append "https://github.com/snakemake/" + "snakemake-interface-storage-plugins")) + (synopsis "Interface for Snakemake storage plugins") + (description + "This package provides a stable interface for interactions between +Snakemake and its storage plugins.") (license license:expat))) -(define-public python-pandas-flavor +(define-public python-sparse (package - (name "python-pandas-flavor") - (version "0.8.1") + (name "python-sparse") + (version "0.18.0") (source (origin (method url-fetch) - (uri (pypi-uri "pandas_flavor" version)) + (uri (pypi-uri "sparse" version)) (sha256 (base32 - "0rn3pnracv8013j3f737qal3isf1brbc3mpxqhr03vik322sapr5")))) + "1x5zkgbsgmpr6nis0k2y5vrsg7l61ly2zishnijcgh0fxdhjdyap")))) (build-system pyproject-build-system) + (propagated-inputs + (list python-numba python-numpy python-scipy)) (native-inputs - (list python-pytest + (list python-dask + python-pytest python-setuptools python-setuptools-scm)) - (propagated-inputs - (list python-pandas - python-xarray)) - (home-page "https://github.com/pyjanitor-devs/pandas_flavor") - (synopsis "Write your own flavor of Pandas") - (description "Pandas 0.23 added a simple API for registering accessors -with Pandas objects. Pandas-flavor extends Pandas' extension API by + (home-page "https://github.com/pydata/sparse/") + (synopsis "Library for multi-dimensional sparse arrays") + (description + "This package implements sparse arrays of arbitrary dimension on top of +@code{numpy} and @code{scipy.sparse}. Sparse array is a matrix in which most +of the elements are zero. @code{python-sparse} generalizes the +@code{scipy.sparse.coo_matrix} and @code{scipy.sparse.dok_matrix} layouts, but +extends beyond just rows and columns to an arbitrary number of dimensions. +Additionally, this project maintains compatibility with the +@code{numpy.ndarray} interface rather than the @code{numpy.matrix} interface +used in @code{scipy.sparse}. These differences make this project useful in +certain situations where @code{scipy.sparse} matrices are not well suited, but +it should not be considered a full replacement. It lacks layouts that are not +easily generalized like @dfn{compressed sparse row/column}(CSR/CSC) and +depends on @code{scipy.sparse} for some computations.") + (license license:bsd-3))) -@itemize -@item adding support for registering methods as well -@item making each of these functions backwards compatible with older versions -of Pandas -@end itemize") - (license license:expat))) +(define-public python-spin + (package + (name "python-spin") + (version "0.8") + (source + (origin + (method url-fetch) + (uri (pypi-uri "spin" version)) + (sha256 + (base32 "0ff48nagfaai3j26g1db4zq2bwdv6kj5l7xhcs2l9kzg7qzrmhr7")))) + (build-system pyproject-build-system) + (propagated-inputs (list python-click python-colorama python-tomli)) + (native-inputs (list python-pytest python-setuptools python-wheel)) + (home-page "https://github.com/scientific-python/spin") + (synopsis "Developer tool for scientific Python libraries") + (description "@code{spin} is a simple interface for common development +tasks. It comes with a few common build commands out the box, but can +easily be customized per project. -(define-public python-pingouin +The impetus behind developing the tool was the mass migration of scientific +Python libraries (SciPy, scikit-image, and NumPy, etc.) to Meson, after +distutils was deprecated. When many of the build and installation commands +changed, it made sense to abstract away the nuisance of having to re-learn +them.") + (license license:bsd-3))) + +(define-public python-supersmoother + ;; 0.4 was release in 2017, there a lot of changes on master branch + ;; providing tests fixtures. + (let ((commit "0a81544ac6bb33bdb08deeba69e97a4ceebcebcf") + (revision "0")) + (package + (name "python-supersmoother") + (version (git-version "0.4" revision commit)) + (source + (origin + (method git-fetch) ; no package in PyPI + (uri (git-reference + (url "https://github.com/jakevdp/supersmoother") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1r79nssw4a44zizvqg8y685nv3asdfj440s227phfww6kz33s3la")))) + (build-system pyproject-build-system) + (native-inputs + (list python-pytest + python-scipy + python-setuptools)) + (propagated-inputs + (list python-numpy)) + (home-page "http://github.com/jakevdp/supersmoother") + (synopsis "Python implementation of Friedman's Supersmoother") + (description + "This package provides an efficient implementation of +@url{https://www.slac.stanford.edu/pubs/slacpubs/3250/slac-pub-3477.pdf, +Friedman's SuperSmoother} based in Python. It makes use of numpy for fast +numerical computation.") + (license license:bsd-2)))) + +(define-public python-tdda (package - (name "python-pingouin") - (version "0.6.1") + (name "python-tdda") + (version "3.2.03") (source (origin (method git-fetch) (uri (git-reference - (url "https://github.com/raphaelvallat/pingouin") - (commit (string-append "v" version)))) + (url "https://github.com/tdda/tdda") + (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "14hxs2w51qgg67kqkxpy02kd4q8gb7vayj85kcp8qvda1q1xasfv")))) + (base32 "1rqh1pa17n5al0b3blqr4h9qn4x6wxnxw6ilc2lk72k027cxmv84")))) (build-system pyproject-build-system) (arguments (list - ;; tests: 85 passed, 3 deselected, 43 warnings #:test-flags #~(list - ;; These tests failed with the python-pandas update. - "--deselect=tests/test_parametric.py::TestParametric::test_ancova" - "--deselect=tests/test_parametric.py::TestParametric::test_anova" - "--deselect=tests/test_pandas.py::TestParametric::test_pandas"))) + ;; Failures probably due to a dependency mismatch (e.g. pandas). + ;; Not investigated further as this is a leaf package. + ;; tdda is actively maintained, so will probably be fixed. + (string-append "--deselect=tdda/test_tdda.py::" + "TestCommonConstraints::" + "testSimpleAllCorrectVerificationFromCSVFile") + (string-append "--deselect=tdda/test_tdda.py::" + "TestCommonConstraints::" + "testSimpleAllNotCorrectVerificationFromCSVFile") + ;; Not further investigated, results in: AssertionError: + ;; '~homeless-shelter/foo.csv' != '/homeless-shelter/foo.csv' + (string-append "--deselect=tdda/test_tdda.py::" + "TestTDDAUtils::test_handle_tilde_strings")))) (native-inputs (list python-pytest - python-setuptools)) + python-setuptools + tzdata-for-tests)) (propagated-inputs - (list python-matplotlib - python-mpmath + (list python-chardet python-numpy python-pandas - python-pandas-flavor - python-scikit-learn - python-scipy - python-seaborn - python-statsmodels - python-tabulate)) - (home-page "https://pingouin-stats.org/") - (synopsis "Statistical package for Python") - (description "Pingouin is a statistical package written in Python 3 and -based mostly on Pandas and NumPy. Its features include + python-polars + python-pyarrow + python-pyyaml + python-regex + python-requests + python-rich + python-tomli + python-tomli-w)) + (home-page "https://tdda.readthedocs.io/en/stable") + (synopsis "Test-driven data analysis library for Python") + (description + "The TDDA Python module provides command-line and Python API support +for the overall process of data analysis, through tools that perform +reference testing, constraint discovery for data, automatic inference +of regular expressions from text data and automatic test generation.") + (license license:expat))) -@itemize -@item ANOVAs: N-ways, repeated measures, mixed, ancova -@item Pairwise post-hocs tests (parametric and non-parametric) and pairwise -correlations -@item Robust, partial, distance and repeated measures correlations -@item Linear/logistic regression and mediation analysis -@item Bayes Factors -@item Multivariate tests -@item Reliability and consistency -@item Effect sizes and power analysis -@item Parametric/bootstrapped confidence intervals around an effect size or a -correlation coefficient -@item Circular statistics -@item Chi-squared tests -@item Plotting: Bland-Altman plot, Q-Q plot, paired plot, robust correlation, -and more -@end itemize") - (license license:gpl3))) +(define-public python-traittypes + (package + (name "python-traittypes") + (version "0.2.1") + (source + (origin + (method url-fetch) + (uri (pypi-uri "traittypes" version)) + (sha256 + (base32 "1mlv93irdrgxrhnhq3ksi9585d55bpi4mv9dha4p8gkkjiia4vxy")))) + (build-system pyproject-build-system) + (arguments + (list + ;; This one test fails because it doesn't raise an expected exception. + #:test-flags '(list "-k" "not test_bad_values") + #:phases + '(modify-phases %standard-phases + (add-after 'unpack 'numpy-compatibility + (lambda _ + (substitute* "traittypes/tests/test_traittypes.py" + (("np\\.int") "int"))))))) + (propagated-inputs (list python-traitlets)) + (native-inputs + (list python-numpy + python-pandas + python-pynose + python-pytest + python-setuptools + python-xarray)) + (home-page "https://github.com/jupyter-widgets/traittypes") + (synopsis "Trait types for NumPy, SciPy and friends") + (description "The goal of this package is to provide a reference +implementation of trait types for common data structures used in the scipy +stack such as numpy arrays or pandas and xarray data structures. These are +out of the scope of the main traitlets project but are a common requirement to +build applications with traitlets in combination with the scipy stack.") + (license license:bsd-3))) -(define-public python-plotly +(define-public python-trimesh (package - (name "python-plotly") - (version "6.8.0") + (name "python-trimesh") + (version "4.5.3") (source (origin - (method git-fetch) + (method git-fetch) ; no tests in PyPI (uri (git-reference - (url "https://github.com/plotly/plotly.py") - (commit (string-append "v" version)))) + (url "https://github.com/mikedh/trimesh") + (commit version))) (file-name (git-file-name name version)) (sha256 - (base32 "147vgm22zrg4wcjc427mxszbb8v6vhs7hgchcm8678cy304hawvd")))) + (base32 "17fyapp8nffnnf95bmcvllvg41fjlpvlv6qndbm048hnyayixxld")))) (build-system pyproject-build-system) (arguments (list - ;; tests: 3039 passed, 24 skipped, 292 deselected, 4 xfailed, 556 warnings #:test-flags - ;; Missing dependencies. - #~(list "--ignore=plotly/matplotlylib/mplexporter/tests/test_basic.py" - "--ignore=plotly/matplotlylib/mplexporter/tests/test_utils.py" - "--ignore=plotly/matplotlylib/tests/test_renderer.py" - "--ignore=tests/test_io/test_renderers.py" - "--ignore=tests/test_optional/test_kaleido/test_kaleido.py" - ;; XXX: Combination of missing packages and assertion errors. - "-k" (string-join - (list "not test_acceptance_named" - "test_colorscale_and_levels_same_length" - "test_correct_order_param" - "test_date_in_hover" - "test_dependencies_not_imported" - "test_fips_values_same_length" - "test_from_json_output_type" - "test_get_module_exists_submodule" - "test_iplot_mpl_works" - "test_iplot_works_after_you_call_init_notebook_mode" - "test_iplot_works_without_init_notebook_mode" - "test_lazy_imports" - "test_ols_trendline_slopes" - "test_overall_trendline" - "test_read_json_from_file_string" - "test_read_json_from_filelike" - "test_read_json_from_pathlib" - "test_render_mode" - "test_scope_is_not_list" - "test_trendline_enough_values" - "test_trendline_nan_values" - "test_trendline_on_timeseries" - "test_trendline_results_passthrough") + ;; XXX: When more optional modules are available review + ;; disabled tests once again. + ;; + ;; Disable tests requiring optional, not packed modules. + #~(list "-k" (string-join + (list "not test_bezier_example" + "test_discrete" + "test_dxf" + "test_ply_path_bezier" + "test_ply_path_line" + "test_ply_path_multi" + "test_revolve" + "test_screw" + "test_simple_closed" + "test_simple_extrude" + "test_simple_open" + "test_slice_onplane" + "test_spline_3D" + "test_svg" + ;; Following tests require network: + "test_fuze" + "test_remote") " and not ")) #:phases #~(modify-phases %standard-phases - (add-before 'build 'skip-npm - ;; npm is not packaged so build without it - (lambda _ - (setenv "SKIP_NPM" "T")))))) - ;; XXX: Plotly requires a long list of test only packages, do not - ;; propagate them, see: - ;; . + ;; XXX: It struggles to load and fails with error: AttributeError: + ;; module 'trimesh' has no attribute '__main__'. + (delete 'sanity-check)))) (native-inputs - (list ;; python-anywidget ;not packaged yet in Guix - python-colorcet - python-geopandas - python-hatchling - python-inflect - ;; python-kaleido ;not packaged yet in Guix + (list python-pyinstrument + python-pytest)) + (propagated-inputs + (list ;; python-cascadio ; not packed yet, optional + python-chardet + python-colorlog + python-httpx + python-jsonschema + python-lxml + ;; python-mapbox-earcut ; not packed yet, optional + ;; python-manifold3d ; not packed yet, optional + python-meshio + python-networkx python-numpy - python-orjson - python-pandas-minimal - ;; python-pdfrw ;not packaged yet in Guix + ;; python-openctm ; not packed yet, optional python-pillow - ;; python-plotly-geo ;not packaged yet in Guix - python-polars - python-pyarrow - python-pyshp - python-pytest - python-pytz + python-psutil + python-pycollada + python-pyglet + python-requests + python-rtree python-scikit-image - python-scipy-minimal + python-scipy + python-setuptools python-shapely - python-statsmodels - python-xarray - tzdata-for-tests)) - (propagated-inputs - (list python-narwhals - python-packaging)) - (home-page "https://plotly.com/python/") - (synopsis "Interactive plotting library for Python") + ;; python-svg-path ; not packed yet, optional + python-sympy + ;; python-vhacdx ; not packed yet, optional + ;; python-xatlas ; not packed yet, optional + python-xxhash)) + (home-page "https://github.com/mikedh/trimesh") + (synopsis "Python library for loading and using triangular meshes") (description - "Plotly's Python graphing library makes interactive,publication-quality -graphs online. Examples of how to make line plots, scatter plots, area -charts, bar charts, error bars, box plots, histograms, heatmaps, subplots, -multiple-axes, polar charts, and bubble charts.") + "Trimesh is a pure Python library for loading and using triangular meshes +with an emphasis on watertight surfaces. The goal of the library is to +provide a full featured and well tested Trimesh object which allows for easy +manipulation and analysis, in the style of the Polygon object in the Shapely +library.") (license license:expat))) -(define-public python-plotnine +(define-public python-tspex (package - (name "python-plotnine") - (version "0.15.7") + (name "python-tspex") + ;; 0.6.3 is not tagged; must be this one, as it is the latest, from the + ;; day of the release, and the commit message is "Bump to 0.6.3". + (properties '((commit . "d393ff497b7c14d673e792bd6c84ddd734be1239") + (revision . "0"))) + (version (git-version "0.6.3" + (assoc-ref properties 'revision) + (assoc-ref properties 'commit))) (source (origin (method git-fetch) (uri (git-reference - (url "https://github.com/has2k1/plotnine") - (commit (string-append "v" version)))) + (url "https://github.com/apcamargo/tspex") + (commit (assoc-ref properties 'commit)))) (file-name (git-file-name name version)) (sha256 - (base32 "0cf8bv9cjjdd0qa77kq6kpspwmbg8px6s5s5zplrns9awlskn8zg")))) + (base32 "0khhnahhn0jp9y14q6wgq0xqadqszwn1iq3y562bhfmv09f4j1ik")))) (build-system pyproject-build-system) (arguments (list - #:test-flags - ;; XXX: Check for any new failing tests during next update cycle. - ;; These all fail because the images are considered to be too different, - ;; though they really do look fine. - ;; See https://github.com/has2k1/plotnine/issues/627 - `(list ,@(map (lambda (file) (string-append "--ignore=" file)) - (list "tests/test_aes.py" - "tests/test_annotation_logticks.py" - "tests/test_coords.py" - "tests/test_facet_labelling.py" - "tests/test_facets.py" - "tests/test_layout.py" - "tests/test_position.py" - "tests/test_qplot.py" - "tests/test_plot_composition.py" - "tests/test_scale_internals.py" - "tests/test_scale_labelling.py" - "tests/test_theme.py")) - "--ignore-glob=tests/test_geom*.py" - "--ignore-glob=tests/test_stat*.py" - "-k" ; Other failures - (string-append "not " - (string-join - (list - ;; This triggers an unexpected but harmless - ;; warning. - "test_save_method" - ;; This test fails to set the locale. - "test_no_after_scale_warning" - ;; Missing optional modules - "test_non_linear_smooth" - "test_non_linear_smooth_no_ci") - " and not " - 'infix))) #:phases #~(modify-phases %standard-phases - (add-before 'check 'pre-check - (lambda* (#:key inputs outputs #:allow-other-keys) - ;; The data files are referenced by the tests but they are not - ;; installed. - (copy-recursively "plotnine/data" - (string-append (site-packages inputs - outputs) - "/plotnine/data")) - (setenv "CI" "1") ;skip tests that are known to fail on CI. - ;; Matplotlib needs to be able to write its configuration file - ;; somewhere. - (setenv "MPLCONFIGDIR" "/tmp") - (setenv "TZ" "UTC") - (setenv "TZDIR" - (search-input-directory inputs "share/zoneinfo"))))))) - (propagated-inputs (list python-adjusttext - python-matplotlib - python-mizani - python-numpy - python-patsy - python-scipy - python-statsmodels)) - (native-inputs (list python-geopandas - python-mock - python-pandas - python-pytest - python-setuptools - python-setuptools-scm - python-wheel - tzdata-for-tests)) - (home-page "https://github.com/has2k1/plotnine") - (synopsis "Grammar of Graphics for Python") + ;; The seaborn styles have different names. + (add-after 'unpack 'fix-seaborn + (lambda _ + (substitute* (find-files "." ".py$") + (("seaborn-") "seaborn-v0_8-"))))))) + (native-inputs + (list python-pytest + python-setuptools)) + (propagated-inputs + (list python-matplotlib + python-numpy + python-pandas + python-seaborn + python-xlrd)) + (home-page "https://apcamargo.github.io/tspex/") + (synopsis "Calculate tissue-specificity metrics for gene expression") (description - "Plotnine is a Python implementation of the Grammar of Graphics. -It is a powerful graphics concept for creating plots and visualizations in a -structured and declarative manner. It is inspired by the R package ggplot2 -and aims to provide a similar API and functionality in Python.") - (license license:expat))) + "This package provides a Python package for calculating +tissue-specificity metrics for gene expression.") + (license license:gpl3+))) -(define-public python-pytest-pyvista +(define-public python-uhi (package - (name "python-pytest-pyvista") - (version "0.3.2") + (name "python-uhi") + (version "0.5.0") (source (origin (method url-fetch) - (uri (pypi-uri "pytest_pyvista" version)) + (uri (pypi-uri "uhi" version)) (sha256 - (base32 "0hgk3a5wwymk3k7ih4lsmkd44dfnsd842zv5859izqxkw74j2xpn")))) + (base32 "0753b7yw0zi06g4azafnk3w8i3q6js9i6wwg3pya464gygrbnncm")))) (build-system pyproject-build-system) - (arguments - (list - ;; No tests included in the PyPI tarball. - #:tests? #f)) - (propagated-inputs (list python-numpy python-pillow python-pytest-8)) - (native-inputs (list python-flit-core)) - (home-page "https://github.com/pyvista/pytest-pyvista") - (synopsis "Pytest plugin for comparing PyVista plot images") - (description "This package provides a Pytest plugin that facilitates -the comparison of images produced by PyVista, generating cached images from -tests and comparing subsequent results against that cache.") - (license license:expat))) + (propagated-inputs (list python-numpy)) + (native-inputs (list python-boost-histogram + python-fastjsonschema + python-hatch-vcs + python-hatchling + python-pytest)) + (home-page "https://github.com/scikit-hep/uhi") + (synopsis "Universal Histogram Interface") + (description "This is a package meant primarily for documenting histogram +indexing and the PlottableHistogram Protocol and any future cross-library +standards. It also contains the code for the PlottableHistogram Protocol, to +be used in type checking libraries wanting to conform to the protocol. It is +not usually a runtime dependency, but only a type checking, testing, and/or +docs dependency in support of other libraries.") + (license license:bsd-3))) -(define-public python-pyvista +(define-public python-unyt (package - (name "python-pyvista") - (version "0.46.5") + (name "python-unyt") + (version "3.1.0") (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/pyvista/pyvista") - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) + (method url-fetch) + (uri (pypi-uri "unyt" version)) (sha256 - (base32 "0553bp4fhbar9z0ybjv1mw1jhb5rhrr4v6q2bzmia0ww0dn8fc69")))) + (base32 "07g5rasgikp8a4x0cylz8xxzgh3536djdjppcadiqlhygyl845bp")))) + (build-system pyproject-build-system) + ;; tests: 764 passed, 37 skipped, 2 xfailed + (native-inputs + (list python-flit-core + python-pytest)) + (propagated-inputs + (list python-numpy + python-packaging + python-sympy)) + (home-page "https://unyt.readthedocs.io") + (synopsis "Library for working with data that has physical units") + (description + "@code{unyt} is a Python library working with data that has physical +units. It defines the @code{unyt.array.unyt_array} and +@code{unyt.array.unyt_quantity} classes (subclasses of NumPy’s ndarray class) +for handling arrays and scalars with units,respectively") + (license license:bsd-3))) + +(define-public python-uproot + (package + (name "python-uproot") + (version "5.6.4") + (source + (origin + (method url-fetch) + (uri (pypi-uri "uproot" version)) + (sha256 + (base32 "024k5kjwcd2nw5hfxhpl0x9p5aq0qrg0nlh9v24vr39rcqadh52a")))) (build-system pyproject-build-system) (arguments (list - ;; tests: 5891 passed, 623 skipped, 355 deselected, 3 xfailed, 167 warnings #:test-flags - ;; TODO: Find out what's going on with skipped tests. - #~(list "--ignore=tests/plotting/test_charts.py" - "--ignore=tests/examples/test_download_files.py" - "--ignore=tests/examples/test_downloads.py" - "--ignore=tests/plotting/test_texture.py" - ;; Tries to download data from GitHub at collection time. - "--ignore=tests/core/test_dataobject_filters.py" - ;; Tries to download data from GitHub at collection time. - "--ignore=tests/core/test_dataset_filters.py" - ;; Tries to download data from GitHub at collection time. - "--ignore=tests/plotting/test_plotter.py" - "-k" (string-join - (list "not test_actor_texture" - "test_add_multiple" - "test_add_timer_event" - "test_avsucd_reader" - "test_binarymarchingcubesreader" - "test_bmpreader" - "test_box_axes" - "test_byureader" - "test_cast_to_numpy_raises" - "test_compute_boundary_mesh_quality" - "test_connectivity_" - "test_dataset_loader_cubemap" - "test_dataset_loader_dicom" - "test_dataset_loader_from_nested_files_and_directory" - "test_dataset_loader_from_nested_multiblock" - "test_dataset_loader_one_file" - "test_dataset_loader_two_files_both_loadable" - "test_dataset_loader_two_files_one_loadable" - "test_dcmreader" - "test_demreader" - "test_ensight_multi_block_io" - "test_ensightreader_arrays" - "test_ensightreader_time_sets" - "test_ensightreader_timepoints" - "test_facetreader" - "test_fluentcffreader" - "test_gambitreader" - "test_gaussian_cubes_reader" - "test_gesignareader" - "test_gif_reader" - "test_hdf_reader" - "test_hdr_reader" - "test_init_cmap" - "test_interpolate" - "test_jpegreader" - "test_legend_" - "test_load_dataset_no_reader" - "test_load_theme" - "test_meta_image_reader" - "test_multiblockplot3dreader" - "test_nifti_reader" - "test_nrrd_reader" - "test_objreader" - "test_only_screenshots_flag" - "test_openfoam_case_type" - "test_openfoam_cell_to_point_default" - "test_openfoam_patch_arrays" - "test_openfoam_skip_zero_time" - "test_openfoamreader_active_time" - "test_openfoamreader_arrays_time" - "test_openfoamreader_read_data_time_point" - "test_openfoamreader_read_data_time_value" - "test_particle_reader" - "test_partition" - "test_pdbreader" - "test_plot3dmetareader" - "test_plot_return_img_with_cpos" - "test_plot_return_img_without_cpos" - "test_png_reader" - "test_pnm_reader" - "test_prostar_reader" - "test_protein_ribbon" - "test_pvdreader" - "test_pvdreader_no_part_group" - "test_pvdreader_no_time_group" - "test_read_cgns" - "test_repr" - "test_save_before_close_callback" - "test_slc_reader" - "test_stlreader" - "test_tecplotreader" - "test_tiff_reader" - "test_timer" - "test_translate_direction_collinear" - "test_user_logo" - "test_xdmf_reader" - ;; XXX: incompatible with Numpy@2 - ;; Drop when updating along with vtk. - "test_check_subdtype_changes_type" - ;; These tests try to download data from GitHub. - "test_read_exodus" - "test_nek5000_reader" - "test_exodus_reader_ext" - "test_exodus_reader_core" - "test_exodus_blocks" - "test_download_dataset_texture" - "test_structured_grid_cast_to_explicit_structured_grid" - "test_pad_image_multi_component_with_scalar" - "test_pad_image_raises" - "test_points_to_cells_and_cells_to_points_dimensions" - ;; These tests download cow.vtp from GitHub. - "test_meshio[cow_ugrid]" - "test_meshio[points_only]" - ;; Looks for pyproject.toml in installed package. - "test_max_positional_args_matches_pyproject") - " and not ")) + #~(list + ;; conftest.py is not required and it imports modules we do not use. + "--noconftest" + ;; There is no easy way to skip tests that require the network, so + ;; just run a handful of tests that pass. + "tests/test_0351_write_TList.py" + "tests/test_0352_write_THashList.py" + "tests/test_0439_check_awkward_before_numpy.py" + "tests/test_0976_path_object_split.py" + "tests/test_1198_coalesce.py" + "tests/test_1264_write_NumPy_array_of_strings.py" + "tests/test_1318_dont_compare_big_endian_in_awkward.py") #:phases - #~(modify-phases %standard-phases - ;; vtk check fails in sanity-check, comment out - (add-after 'unpack 'patch-pyproject - (lambda _ - (substitute* "pyproject.toml" - (("'vtk[^']*'," all) (string-append "#" all))))) - (add-after 'unpack 'fix-failing-tests - (lambda _ - (substitute* "tests/plotting/test_plotting.py" - (("\"\"\"Determine if using mesa.\"\"\"" all) - (string-append all "\n return False"))) - (substitute* "tests/test_meshio.py" - (("cow = .*$" all) (string-append "#" all "\n")) - ((", cow") "")))) - ;; test phase writes files to $HOME - (add-before 'check 'redirect-HOME - (lambda _ - (setenv "HOME" "/tmp")))))) - (native-inputs - (list nss-certs-for-test - python-aiohttp - python-ipython - python-mypy - python-pandas - python-pytest-8 - python-pytest-cases - python-pytest-mock - python-pytest-pyvista - python-scipy - python-tqdm - python-trimesh - which - xorg-server-for-tests)) + #~(modify-phases %standard-phases + (add-after 'unpack 'set-version + (lambda _ + ;; Version is determined dynamically from .git. + (substitute* "pyproject.toml" + (("\\[project\\]") + (string-append "[project]" "\n" "version = \"" + #$version "\"")) + (("\"version\"") ""))))))) + (native-inputs + (list python-hatch-vcs + python-pytest + python-pytest-timeout + python-setuptools)) (propagated-inputs - (list python-cmcrameri - python-cmocean - python-colorcet - python-imageio - python-matplotlib - python-meshio + (list python-awkward + python-cramjam + python-fsspec python-numpy - python-pillow - python-pooch - python-scooby - vtk-9.5)) - (home-page "https://docs.pyvista.org/") - (synopsis "3D plotting and mesh analysis through VTK") + python-packaging + python-xxhash)) + (home-page "https://uproot.readthedocs.io") + (synopsis "ROOT I/O in Python using NumPy") (description - "PyVista is... - -@itemize -@item @emph{Pythonic VTK}: a high-level API to the Visualization -Toolkit (VTK); -@item mesh data structures and filtering methods for spatial datasets; -@item 3D plotting made simple and built for large/complex data geometries. -@end itemize - -This package provides a Pythonic, well-documented interface exposing VTK's -powerful visualization backend to facilitate rapid prototyping, analysis, and -visual integration of spatially referenced datasets.") - (license license:expat))) + "Uproot is a Python library for reading and writing ROOT files. It uses +NumPy and does not depend on C++ ROOT.") + (license license:bsd-3))) -(define-public python-pyvistaqt +(define-public python-upsetplot (package - (name "python-pyvistaqt") - (version "0.11.3") + (name "python-upsetplot") + ;; Latest release is incompatible with Pandas 3 and NumPy 2.4. + (properties '((commit . "e9603da19d321c047f88d404f687e82be415e52c") + (revision . "1"))) + (version (git-version "0.9.0" + (assoc-ref properties 'revision) + (assoc-ref properties 'commit))) (source (origin (method git-fetch) (uri (git-reference - (url "https://github.com/pyvista/pyvistaqt") - (commit version))) + ;; Using a fork of https://github.com/jnothman/UpSetPlot + ;; original source that is updated for Pandas 3 compatibility, + ;; see . + (url "https://github.com/kevinpetersavage/UpSetPlot") + (commit (assoc-ref properties 'commit)))) (file-name (git-file-name name version)) (sha256 - (base32 "04f9cd98k463pdrpi8jby411x9mc0ih62gl0nv0h9w3r7pwl61yl")))) + (base32 "155g0x4z0zdfri528spws5mad4d24vadsc827iy92f5br7vbf3j3")))) (build-system pyproject-build-system) - (arguments - (list - #:phases - #~(modify-phases %standard-phases - (add-after 'unpack 'fix-pytest - (lambda _ - (substitute* "tests/conftest.py" - (("pytest.skip") - "pytest.mark.skipif")))) - (add-before 'check 'before-check - (lambda _ - ;; Testing requires write access. - (setenv "HOME" "/tmp") - ;; Testing requires a running xorg server. - (system "Xvfb :99 -screen 0 1024x768x24 &") - (setenv "DISPLAY" ":99.0")))))) - (propagated-inputs (list python-pyvista python-qtpy)) - (native-inputs (list python-ipython - python-matplotlib - python-numpy - python-pyqt-6 - python-pytest - python-pytest-qt - python-setuptools - python-sphinx-gallery - xorg-server)) - (home-page "https://github.com/pyvista/pyvistaqt") - (synopsis "Qt support for PyVista") + (propagated-inputs + (list python-matplotlib python-pandas)) + (native-inputs + (list python-pytest python-setuptools)) + (home-page "https://upsetplot.readthedocs.io") + (synopsis "Draw UpSet plots with Pandas and Matplotlib") (description - "@code{pyvistaqt} is a helper module for @code{pyvista} to enable you to -plot using Qt by placing a vtk-widget into a background renderer. This can be -quite useful when you desire to update your plot in real-time.") - (license license:expat))) + "This is a Python implementation of UpSet plots by Lex et al. +UpSet plots are used to visualize set overlaps; like Venn diagrams but more +readable.") + (license license:bsd-3))) -(define-public python-simplespectral +(define-public python-vaex-core (package - (name "python-simplespectral") - (version "1.0.0") + (name "python-vaex-core") + (version "4.19.0") (source (origin - (method url-fetch) - (uri (pypi-uri "SimpleSpectral" version)) + (method git-fetch) + (uri (git-reference + (url "https://www.github.com/maartenbreddels/vaex") + (commit (string-append "core-v" version)))) + (file-name (git-file-name name version)) (sha256 - (base32 "0qh3xwdv9cwcqdamvglrhm586p4yaq1hd291py1fvykhk2a2d4w6")))) + (base32 "1m6h6m0vm8vdx2nk26nvlbyfvlj0g9ph8cdh38258gn18fd2db0l")) + (patches + (search-patches "python-vaex-core-fix-tsl-use.patch")) + (modules '((guix build utils) + (ice-9 ftw))) + (snippet + #~(begin + ;; Delete everything except for vaex-core itself: + (define (delete-except exception) + (lambda (file) + (unless (member file `("." ".." ,exception)) + (delete-file-recursively file)))) + (for-each (delete-except "packages") (scandir ".")) + (with-directory-excursion "packages" + (for-each (delete-except "vaex-core") (scandir "."))) + (for-each (lambda (file) + (unless (member file '("." "..")) + (rename-file + (string-append "packages/vaex-core/" file) + file))) + (scandir "packages/vaex-core")) + (delete-file-recursively "packages") + (delete-file-recursively "vendor"))))) (build-system pyproject-build-system) (arguments - (list #:tests? #f)) ;No tests, also not in git repository. + (list + ;; TODO: Require vaex.server and others, which require vaex-core; + ;; implement bootstrapping. + #:tests? #f + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'relax-requirements + (lambda _ + (substitute* "setup.py" + ;; "dask!=2022.4.0,<2024.9"; there is a note "fingerprinting + ;; in no longer deterministic as of 2024.9.0" which may be + ;; resolved in 2024.12.1. + ((",<2024.9") "") + ;; There is no a fresh version supporting Pandas 3 yet, built + ;; has passed but sanity-check fails. + (("pandas>=1.0,<3") "pandas>=1.0")))) + (add-before 'build 'patch-missing-include + (lambda _ + ;; See: . + ;; TODO: Update to the latest version including the fix. + (substitute* "src/string_utils.hpp" + (("#include ") + "#include \n#include "))))))) (native-inputs - (list python-setuptools)) + (list pybind11 + python-cython + python-setuptools)) + (inputs + (list boost + pcre + string-view-lite + tsl-hopscotch-map)) (propagated-inputs - (list python-numpy python-scipy)) - (home-page "https://github.com/xmikos/simplespectral") - (synopsis "FFT module for Python") - (description - "This package provides a simplified @code{scipy.signal.spectral} module -to do spectral analysis in Python.") + (list python-aplus + python-blake3 + python-cloudpickle + python-dask + python-filelock + python-frozendict + python-future + python-nest-asyncio + python-numpy + python-pandas + python-pyarrow + python-pydantic + python-pyyaml + python-rich + python-six ;hard dependency + python-tabulate + ;; [optional] + python-diskcache + python-fsspec + ;; python-gcsfs ;not packaged yet in Guix + python-graphviz + python-h5py + python-httpx + ;; python-ipyvolume ;not packaged yet in Guix + python-psutil + python-s3fs)) + (home-page "https://www.github.com/maartenbreddels/vaex") + (synopsis "Core of Vaex library for exploring tabular datasets") + (description "Vaex is a high performance Python library for lazy +Out-of-Core DataFrames (similar to Pandas), to visualize and explore big +tabular datasets. This package provides the core modules of Vaex.") (license license:expat))) -(define-public python-pods +(define-public python-vector (package - (name "python-pods") - (version "0.1.17") + (name "python-vector") + (version "1.8.0") (source (origin (method url-fetch) - (uri (pypi-uri "pods" version)) + (uri (pypi-uri "vector" version)) (sha256 - (base32 "1z57jdwml2jzr2dq20p7pzx3ayhajgfd2d0xqjvgzx576hp2z1ac")))) + (base32 "19jc889z6jxfyyqya5c6sx0hps6j5zgj0shp6k552f264jg5xyaq")))) (build-system pyproject-build-system) - ;; Tests depend on Nose framework and try to download test data from - ;; . - (arguments (list #:tests? #f)) + (arguments + (list + ;; tests: 813 passed, 3 skipped, 1 deselected + #:test-flags + ;; assert array([2.]) == array([-2.]) + #~(list "--deselect=tests/test_issues.py::test_issue_443" ))) (native-inputs - (list python-poetry-core)) + (list ;; python-dask-awkward ;not packaged yet in Guix + python-hatch-vcs + python-hatchling + ;; python-jax ;not packaged yet in Guix + python-notebook + python-optree + python-papermill + python-pytest + #;python-spark-parse)) ;not packaged yet in Guix (propagated-inputs - (list python-pandas - python-pyyaml - python-scipy - python-tables)) - (home-page "https://github.com/lawrennd/ods") - (synopsis "Python software for Open Data Science") - (description "This package provides utilities and tools for open data -science including tools for accessing data sets in Python.") + (list python-numpy + python-packaging + ;; [optional] + python-awkward + python-numba + python-sympy)) + (home-page "https://github.com/scikit-hep/vector") + (synopsis "Arrays of 2D, 3D, and Lorentz vectors") + (description "Vector is a Python library for 2D and 3D spatial vectors, as +well as 4D space-time vectors. It is especially intended for performing +geometric calculations on arrays of vectors, rather than one vector at a time +in a Python @code{for} loop.") (license license:bsd-3))) -(define-public python-polars-runtime-32 +(define-public python-vedo (package - (name "python-polars-runtime-32") - (version "1.38.1") + (name "python-vedo") + (version "2025.5.4") (source (origin - (method url-fetch) - (uri (pypi-uri "polars_runtime_32" version)) + (method git-fetch) + (uri (git-reference + (url "https://github.com/marcomusy/vedo") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) (sha256 - (base32 "1v72zkyhcziiizpymjlh2d5rwnkmvhlp18ln8brp31y5yp8hxwh4")))) + (base32 "17lrx30pdag0d3d5a2cycfylsbhad4ywikza784h2fg95w77y1va")))) (build-system pyproject-build-system) (arguments (list - #:imported-modules `(,@%cargo-build-system-modules - ,@%pyproject-build-system-modules) - #:modules '(((guix build cargo-build-system) #:prefix cargo:) - (guix build pyproject-build-system) - (guix build utils)) - ;; There are rust tests which would be costly to run, but no python ones. + ;; XXX: The whole test suite depends on the data from + ;; providing samples which need to be + ;; downloaded during tests, find the way how to enable it. #:tests? #f #:phases - #~(modify-phases %standard-phases - (add-after 'unpack 'build-without-rust-nightly - (lambda _ - ;; Add cargo flags that allow compilation without Rust nightly. - (substitute* "pyproject.toml" - ((".*tool.maturin.*" all) - (string-append all "no-default-features = true\n" - "features = [\"full\"]\n"))))) - (add-after 'unpack 'fix-tikv-jemallocator - (lambda _ - ;; removes a patch.crates-io option that is packaged in - ;; gnu/packages/rust-sources: rust-tikv-jemallocator-for-polars - (substitute* "Cargo.toml" - (("^tikv-jemallocator.*") "")))) - ;; jemalloc needs unbundling for tikv-jemallocator-sys - (add-before 'build 'override-jemalloc - (lambda* (#:key inputs #:allow-other-keys) - (let ((jemalloc (assoc-ref inputs "jemalloc"))) - ;; This flag is needed when not using the bundled jemalloc. - ;; https://github.com/tikv/jemallocator/issues/19 - (setenv "CARGO_FEATURE_UNPREFIXED_MALLOC_ON_SUPPORTED_PLATFORMS" "1") - (setenv "JEMALLOC_OVERRIDE" - (string-append jemalloc "/lib/libjemalloc_pic.a"))))) - (add-after 'unpack 'prepare-cargo-build-system - (lambda args - (for-each - (lambda (phase) - (format #t "Running cargo phase: ~a~%" phase) - (apply (assoc-ref cargo:%standard-phases phase) - #:cargo-target #$(cargo-triplet) - args)) - '(prepare-rust-crates - unpack-rust-crates - configure - check-for-pregenerated-files - patch-cargo-checksums))))))) - (inputs - (cons* jemalloc - lz4 - (list zstd "lib") - (cargo-inputs 'python-polars-runtime-32))) + #~(modify-phases %standard-phases + (add-after 'unpack 'relax-requirements + ;; vtk does not provide Python metadata. + ;; + ;; ...checking requirements: ERROR: vedo==2025.5.4 + ;; DistributionNotFound(Requirement.parse('vtk'), {'vedo'}) + (lambda _ + (substitute* "pyproject.toml" + (("\"vtk\",") ""))))))) (native-inputs - (append - (list maturin - pkg-config - rust - `(,rust "cargo")) - (or (and=> (%current-target-system) - (compose list make-rust-sysroot)) - '()))) - (home-page "https://pola.rs/") - (synopsis "Blazingly fast DataFrame library") - (description "Polars is an analytical query engine written for DataFrames. -It is designed to be fast, easy to use and expressive.") - (properties '(("upstream-name" . "polars-runtime-32") - (tunable? . #true))) - (license license:expat))) + (list pkg-config + python-pkgconfig + python-setuptools + python-wheel)) + (propagated-inputs + (list python-deprecated + python-matplotlib + python-numpy + python-pygments + vtk)) + (home-page "https://github.com/marcomusy/vedo") + (synopsis + "Analysis and visualization of 3D objects and point clouds") + (description + "@code{vedo} is a fast and lightweight python module for +scientific analysis and visualization. The package provides a wide +range of functionalities for working with three-dimensional meshes and +point clouds. It can also be used to generate high quality +two-dimensional renderings such as scatter plots and histograms. +@code{vedo} is based on @code{vtk} and @code{numpy}.") + ;; vedo is released under the Expat license. Included fonts are + ;; covered by the OFL license and textures by the CC0 license. + ;; The earth images are in the public domain. + (license (list license:expat + license:silofl1.1 + license:cc0 + license:public-domain)))) -(define-public python-polars +(define-public python-xarray (package - (name "python-polars") - (version "1.38.1") + (name "python-xarray") + (version "2026.04.0") (source (origin - (method url-fetch) - (uri (pypi-uri "polars" version)) + (method git-fetch) + (uri (git-reference + (url "https://github.com/pydata/xarray") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) (sha256 - (base32 "0fc2fx2p72g01nhhhfs1fzbwz58rcj7zppascanq1y2f6kjjnfl0")))) - (build-system pyproject-build-system) - ;; The wheel doesn't have tests. - ;; TODO On the next update, hopefully if delete-all-but has made it - ;; into guix, switch to a git-source and keep src/polars and tests - ;; subdirectories. - (arguments (list #:tests? #f)) - (propagated-inputs (list python-polars-runtime-32)) - (native-inputs (list python-setuptools)) - (home-page "https://pola.rs/") - (synopsis "Blazingly fast DataFrame library") - (description - "Polars is a DataFrame library for manipulating structured data.") - (license license:expat))) - -(define-public python-pydicom - (package - (name "python-pydicom") - (version "2.4.4") - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/pydicom/pydicom") - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "0ksyyc1hbhyqy289a2frn84ss29fb7czirx3dkxx56f4ia33b4c8")))) + (base32 "1ma0k5gw5frldms4zrgp5ww0l1m5h5620ks5sdljbjz4wqbsf9di")))) (build-system pyproject-build-system) (arguments (list + ;; tests: 7500 passed, 9135 skipped, 24 xfailed, 6 xpassed, 45 warnings #:test-flags - ;; Skip tests that require networking. - #~(list "-k" (string-append - "not test_jpeg_ls_pixel_data.py" - " and not test_gdcm_pixel_data.py" - " and not test_pillow_pixel_data.py" - " and not test_rle_pixel_data.py" - " and not Test_JPEG_LS_Lossless_transfer_syntax" - " and not test_numpy_pixel_data.py" - " and not test_data_manager.py" - " and not test_handler_util.py" - " and not test_overlay_np.py" - " and not test_encoders_pydicom.py" - " and not test_encaps.py" - " and not test_reading_ds_with_known_tags_with_UN_VR" - " and not TestDatasetOverlayArray" - " and not TestReader" - " and not test_filewriter.py")))) - (native-inputs (list python-pytest python-flit-core)) - (inputs (list gdcm libjpeg-turbo)) - (propagated-inputs (list python-numpy python-pillow)) - (home-page "https://github.com/pydicom/pydicom") - (synopsis "Python library for reading and writing DICOM data") - (description "@code{python-pydicom} is a Python library for reading and -writing DICOM medical imaging data. It can read, modify and write DICOM -data.") - (license license:expat))) - -(define-public python-supersmoother - ;; 0.4 was release in 2017, there a lot of changes on master branch - ;; providing tests fixtures. - (let ((commit "0a81544ac6bb33bdb08deeba69e97a4ceebcebcf") - (revision "0")) - (package - (name "python-supersmoother") - (version (git-version "0.4" revision commit)) - (source - (origin - (method git-fetch) ; no package in PyPI - (uri (git-reference - (url "https://github.com/jakevdp/supersmoother") - (commit commit))) - (file-name (git-file-name name version)) - (sha256 - (base32 "1r79nssw4a44zizvqg8y685nv3asdfj440s227phfww6kz33s3la")))) - (build-system pyproject-build-system) - (native-inputs - (list python-pytest - python-scipy - python-setuptools)) - (propagated-inputs - (list python-numpy)) - (home-page "http://github.com/jakevdp/supersmoother") - (synopsis "Python implementation of Friedman's Supersmoother") - (description - "This package provides an efficient implementation of -@url{https://www.slac.stanford.edu/pubs/slacpubs/3250/slac-pub-3477.pdf, -Friedman's SuperSmoother} based in Python. It makes use of numpy for fast -numerical computation.") - (license license:bsd-2)))) + #~(list "--numprocesses" (number->string (min 8 (parallel-job-count))) + ;; Regression in Pandas 3.0.3. + ;; See: . + (string-append "--deselect=properties/test_pandas_roundtrip.py" + "::test_roundtrip_pandas_dataframe_datetime") + ;; See: . + (string-append "--deselect=xarray/tests/test_dataset.py" + "::TestDataset::test_repr")) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'fix-pytest-config + (lambda _ + (substitute* "pyproject.toml" + ((".*--mypy-.*") ""))))))) + (native-inputs + (list python-pytest + python-pytest-asyncio + python-pytest-xdist + python-pytz + python-setuptools + python-setuptools-scm + tzdata-for-tests)) + (propagated-inputs + (list python-numpy + python-packaging + python-pandas + ;; [optional] + python-bottleneck + ;; python-cartopy + ;; python-cftime + ;; python-dask + ;; python-flox + ;; python-fsspec + ;; python-h5netcdf + ;; python-matplotlib + ;; python-nc-time-axis + ;; python-netcdf4 + python-numba + ;; python-numbagg ;blocked by guix/guix#9344 + ;; python-opt-einsum + ;; python-pooch + ;; python-pydap + python-scipy-minimal ;to slim down closure size + ;; python-seaborn + ;; python-sparse + #;python-zarr)) + (home-page "https://github.com/pydata/xarray") + (synopsis "N-D labeled arrays and datasets") + (description "Xarray (formerly xray) makes working with labelled +multi-dimensional arrays simple, efficient, and fun! -(define-public python-pylems +Xarray introduces labels in the form of dimensions, coordinates and attributes +on top of raw NumPy-like arrays, which allows for a more intuitive, more +concise, and less error-prone developer experience. The package includes a +large and growing library of domain-agnostic functions for advanced analytics +and visualization with these data structures.") + (license license:asl2.0))) + +(define-public python-xarray-dataclass (package - (name "python-pylems") - (version "0.6.9") + (name "python-xarray-dataclass") + (version "3.0.0") (source (origin (method git-fetch) (uri (git-reference - (url "https://github.com/LEMS/pylems") - (commit (string-append "v" version)))) + (url "https://github.com/xarray-contrib/xarray-dataclass/") + (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "0gimdx89cdla1b6zzkdrmj979nn2zy2475qvpwxxas0iv27ql0vj")))) - (build-system pyproject-build-system) - (arguments - ;; Disable tests that require networking - (list #:test-flags #~(list "./lems/test" "-k" "not test_load_write_xml"))) - (native-inputs (list python-setuptools python-pytest)) - (propagated-inputs (list python-lxml python-matplotlib)) - (home-page "https://github.com/LEMS/pylems") - (synopsis - "Python support for the Low Entropy Model Specification language (LEMS)") - (description "A @acronym{LEMS, Low Entropy Model Specification} simulator -written in Python which can be used to run NeuroML2 models.") - (license license:lgpl3))) - -(define-public python-pynrrd - (package - (name "python-pynrrd") - (version "1.1.3") - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/mhe/pynrrd") - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "1l0hjbqzf5i1bmpxpblpyyqkhci3mb5n07x6hqf2a91hggfyrvda")))) + (base32 "1q3y9gbzrp1mh48y7gggqgggwnarxdn32h907mfax1hi9ap6ywil")))) (build-system pyproject-build-system) (native-inputs - (list python-pytest python-setuptools)) + (list python-pytest + python-hatchling)) (propagated-inputs - (list python-numpy)) - (home-page "https://github.com/mhe/pynrrd") - (synopsis "Python module for reading and writing NRRD files") + (list python-numpy + python-typing-extensions + python-xarray)) + (home-page "https://github.com/xarray-contrib/xarray-dataclass/") + (synopsis "Xarray data creation by data classes") (description - "@code{pynrrd} is a Python module for reading and writing @acronym{NRRD, -Nearly Raw Raster Data} files (format designed to support scientific -visualization and image processing involving N-dimensional raster data) into -and from numpy arrays.") + "xarray-dataclass is a Python package that makes it easy to create +@url{https://xarray.pydata.org/en/stable/index.html, xarray}'s DataArray and +Dataset objects that are \"typed\" (i.e. fixed dimensions, data type, +coordinates, attributes, and name) using +@url{https://docs.python.org/3/library/dataclasses.html, the Python's +dataclass}. It's a successor of not maintained +https://github.com/astropenguin/xarray-dataclasses.") (license license:expat))) -(define-public python-pynsee +(define-public python-xarray-dataclasses (package - (name "python-pynsee") - (version "0.1.8") + (name "python-xarray-dataclasses") + (version "1.7.0") (source (origin - (method url-fetch) - (uri (pypi-uri "pynsee" version)) + (method git-fetch) + (uri (git-reference + (url "https://github.com/astropenguin/xarray-dataclasses/") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) (sha256 - (base32 "1w084ynwdd9f4wpcnakqc0nxcbj9gr8vppv4rd258i3dp1qq4sw5")))) + (base32 "043lc1hadr5y0y16g682viiafy0hfsa7q18lqmndpyvnmcgm893z")))) (build-system pyproject-build-system) - (arguments (list #:tests? #f)) ; XXX: Tests require network access. + (propagated-inputs (list python-numpy python-typing-extensions + python-xarray)) + (native-inputs (list python-pytest python-poetry-core)) + (home-page "https://github.com/astropenguin/xarray-dataclasses/") + (synopsis "Data creation made easy by dataclass") + (description "@code{xarray-dataclasses} is a Python package that makes it +easy to create @code{xarray}'s @code{DataArray} and @code{Datase} objects that +are \"typed\" (i.e. fixed dimensions, data type, coordinates, attributes, and +name) using the Python's @code{dataclass}.") + (license license:expat))) + +(define-public python-xarray-einstats + (package + (name "python-xarray-einstats") + (version "0.9.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/arviz-devs/xarray-einstats") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "11crz1l6swabwzmwbrxypfw8gbbp81higzgi5nsxzfigcrrqq30a")))) + (build-system pyproject-build-system) + ;; tests: 317 passed, 48 skipped (native-inputs - (list python-setuptools - python-wheel)) + (list python-flit-core + python-pytest)) (propagated-inputs - (list python-appdirs - python-openpyxl - python-pandas - python-platformdirs - python-pyarrow - python-requests - python-shapely - python-tqdm - python-unidecode - python-urllib3 - python-xlrd)) - (home-page "https://pynsee.readthedocs.io") - (synopsis - "Tools to Easily Search and Download French Data From INSEE and IGN APIs") + (list python-numpy + python-scipy + python-xarray + ;; [optinoal] + python-einops + python-numba)) + (home-page "https://einstats.python.arviz.org/en/latest/") + (synopsis "Stats, linear algebra and einops for xarray") (description - "This package provides tools to easily search and download French data -from INSEE and IGN APIs. This data includes more than 150 000 macroeconomic -series, a dozen datasets of local french data, numerous sources available on -@url{insee.fr}, geographical limits of administrative areas taken from IGN as -well as key metadata and SIRENE database containing data on all French -compagnies.") - (license license:expat))) + "@code{xarray_einstats} provides wrappers around some NumPy and SciPy +functions and around einops with an API and features adapted to xarray.") + (license license:asl2.0))) -(define-public python-pyqtgraph +(define-public python-xarray-schema (package - (name "python-pyqtgraph") - (version "0.13.7") + (name "python-xarray-schema") + (version "0.0.3") (source (origin (method url-fetch) - (uri (pypi-uri "pyqtgraph" version)) + (uri (pypi-uri "xarray-schema" version)) (sha256 - (base32 "1qyr461hcvhgy02slfkgrbip2xwa8zz6dvmi1476v6f66lclzy34")))) + (base32 "08194629696z98dkc74i6c9zmy1jicvd2ajb75q0lsf0i427cv4w")))) (build-system pyproject-build-system) - (arguments - ;; tests: 949 passed, 1356 skipped, 2 deselected, 8 xfailed, 130 warnings - (list #:test-flags - ;; Failed: CALL ERROR: Exceptions caught in Qt event loop. - #~(list "--deselect=tests/exporters/test_svg.py::test_plotscene" - ;; The test_reload test fails. It suggests to disable - ;; assert rewriting in Pytest, but it still doesn't pass. - "-k" "not test_reload" - ;; Run unit tets only. - "tests") - #:phases - #~(modify-phases %standard-phases - (add-before 'check 'set-qpa - (lambda _ - (setenv "QT_QPA_PLATFORM" "offscreen")))))) + (propagated-inputs (list python-numpy python-xarray)) (native-inputs (list python-pytest - ;; Do not propagate Qt5/Qt6 let the user of the package to select - ;; any supported one, see - ;; - ;; . - python-pyqt-6 - python-pytest-qt - python-setuptools)) - (propagated-inputs - (list python-h5py - python-numpy - python-pyopengl - python-scipy)) - (home-page "https://www.pyqtgraph.org") - (synopsis "Scientific graphics and GUI library for Python") - (description - "PyQtGraph is a Pure-python graphics library for PyQt5, PyQt6, PySide2 -and PySide6. It is intended for use in mathematics, scientific or engineering -applications.") + python-setuptools + python-setuptools-scm + python-wheel)) + (home-page "https://github.com/carbonplan/xarray-schema") + (synopsis "Schema validation for Xarray objects") + (description "This package implements schema validation for Xarray +objects.") (license license:expat))) (define-public pyzo @@ -6887,45 +6924,7 @@ providing a clean and modern domain specific specification language (DSL) in Python style, together with a fast and comfortable execution environment.") (license license:expat))) -(define-public python-orsopy - (package - (name "python-orsopy") - (version "1.2.1") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/reflectivity/orsopy") - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) - (sha256 - (base32 "15av7b38h9x0f09dzxb111r2kxm6an461l9ajb01r8r7mv7m5bw9")))) - (build-system pyproject-build-system) - (arguments - (list - #:test-flags - ;; These tests require network access. - #~(cons* "--ignore=orsopy/slddb/tests/test_webapi.py" - (map (lambda (test) - (string-append "--deselect=orsopy/fileio/tests/" - "test_model_language.py::" test)) - (list "TestSubStack::test_resolve_layers" - "TestMaterial::test_density_lookup_elements" - "TestSampleModel::test_resolve_to_layers"))))) - (propagated-inputs - (list python-numpy python-pyyaml python-jsonschema python-h5py)) - (native-inputs - (list python-pint python-pytest python-setuptools)) - (home-page "https://github.com/reflectivity/orsopy") - (synopsis "Open Reflectometry Standards Organization Python tools") - (description - "This package provides Python tools for the Open Reflectometry Standards -Organization (ORSO). It includes utilities for working with reflectometry -data files and the ORSO file format.") - (license license:expat))) - ;;; ;;; Avoid adding new packages to the end of this file. To reduce the chances -;;; of a merge conflict, place them above by existing packages with similar -;;; functionality or similar names. +;;; of a merge conflict, place them above in alphabetical order. ;;; -- cgit v1.2.3