-
Notifications
You must be signed in to change notification settings - Fork 0
/
python-cotengra.spec
95 lines (85 loc) · 3.35 KB
/
python-cotengra.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#
# spec file for package python-cotengra
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: python-cotengra
Version: 0.5.6
Release: 0
Summary: Hyper optimized contraction trees for large tensor networks and einsums
License: Apache-2.0
URL: https://github.com/jcmgray/cotengra
Source: https://files.pythonhosted.org/packages/source/c/cotengra/cotengra-%{version}.tar.gz
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools >= 45}
BuildRequires: %{python_module setuptools_scm >= 6.2}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: python3-mpmath
Requires: python-autoray
Requires: python3-mpmath
Recommends: python-cotengrust
Recommends: python-cytoolz
Recommends: python-kahypar
Recommends: python-networkx
Recommends: python-numpy
Recommends: python-opt-einsum
Recommends: python-optuna
Recommends: python-ray
Recommends: python3-mpmath
# SECTION test requirements
BuildRequires: %{python_module altair}
BuildRequires: %{python_module autoray}
BuildRequires: %{python_module dask}
BuildRequires: %{python_module matplotlib}
BuildRequires: %{python_module networkx}
BuildRequires: %{python_module numpy}
BuildRequires: %{python_module opt-einsum}
BuildRequires: %{python_module pytest-xdist}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module seaborn}
BuildRequires: %{python_module tqdm}
BuildRequires: %{python_module mpmath}
# /SECTION
BuildArch: noarch
%python_subpackages
%description
A python library for contracting tensor networks or einsum expressions involving large numbers of tensors.
Some of the key feautures of cotengra include:
* drop-in einsum replacement
* an explicit contraction tree object that can be flexibly built, modified and visualized
* a 'hyper optimizer' that samples trees while tuning the generating meta-paremeters
* dynamic slicing for massive memory savings and parallelism
* support for hyper edge tensor networks and thus arbitrary einsum equations
* paths that can be supplied to numpy.einsum, opt_einsum, quimb among others
* performing contractions with tensors from many libraries via cotengra, even if they don't provide einsum
or tensordot but do have (batch) matrix multiplication
%prep
%autosetup -p1 -n cotengra-%{version}
sed -i '/addopts/d' pyproject.toml
rm cotengra/.gitattributes
# Note: ignore the rust files for now gh#jcmgray/cotengra#30
%build
%pyproject_wheel
%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%pytest -n auto
%files %{python_files}
%doc README.md
%license LICENSE.md
%{python_sitelib}/cotengra
%{python_sitelib}/cotengra-%{version}.dist-info
%changelog