array-split 0.6.5__zip

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,255 @@
1
+ Metadata-Version: 2.1
2
+ Name: array-split
3
+ Version: 0.6.5
4
+ Summary: The array_split python package is an enhancement to existing numpy.ndarray functions (such as numpy.array_split) which sub-divide a multi-dimensional array into a number of multi-dimensional sub-arrays (slices)
5
+ Author-email: Shane-J-Latham <array.split@gmail.com>, array-split <array.split@gmail.com>
6
+ License: Copyright (C) 2017 The Australian National University.
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this
9
+ software and associated documentation files (the "Software"), to deal in the Software
10
+ without restriction, including without limitation the rights to use, copy, modify, merge,
11
+ publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
12
+ to whom the Software is furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in all copies or
15
+ substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
18
+ BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
20
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+
23
+ Project-URL: Homepage, https://github.com/array-split/array_split
24
+ Project-URL: Documentation, https://array-split.readthedocs.io/en/latest/
25
+ Project-URL: Repository, https://github.com/array-split/array_split
26
+ Project-URL: Issues, https://github.com/array-split/array_split/issues
27
+ Keywords: multi-dimensional-array,array,sub-array,tile,tiling,splitting,split,partition,partitioning,scipy,numpy,ndarray,domain-decomposition,array-decomposition
28
+ Classifier: Programming Language :: Python :: 3
29
+ Classifier: License :: OSI Approved :: MIT License
30
+ Classifier: Operating System :: OS Independent
31
+ Requires-Python: >=3.8
32
+ Description-Content-Type: text/x-rst
33
+ License-File: LICENSE.txt
34
+
35
+
36
+ =============
37
+ `array_split`
38
+ =============
39
+
40
+ .. Start of sphinx doc include.
41
+ .. start long description.
42
+ .. start badges.
43
+
44
+ .. image:: https://img.shields.io/pypi/v/array_split.svg
45
+ :target: https://pypi.python.org/pypi/array_split/
46
+ :alt: array_split python package
47
+ .. image:: https://github.com/array-split/array_split/actions/workflows/python-test.yml/badge.svg
48
+ :target: https://github.com/array-split/array_split/actions/workflows/python-test.yml
49
+ :alt: array_split python package
50
+ .. image:: https://readthedocs.org/projects/array-split/badge/?version=stable
51
+ :target: http://array-split.readthedocs.io/en/stable
52
+ :alt: Documentation Status
53
+ .. image:: https://coveralls.io/repos/github/array-split/array_split/badge.svg
54
+ :target: https://coveralls.io/github/array-split/array_split
55
+ :alt: Coveralls Status
56
+ .. image:: https://img.shields.io/pypi/l/array_split.svg
57
+ :target: https://pypi.python.org/pypi/array_split/
58
+ :alt: MIT License
59
+ .. image:: https://img.shields.io/pypi/pyversions/array_split.svg
60
+ :target: https://pypi.python.org/pypi/array_split/
61
+ :alt: array_split python package
62
+ .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.889078.svg
63
+ :target: https://doi.org/10.5281/zenodo.889078
64
+ .. image:: http://joss.theoj.org/papers/10.21105/joss.00373/status.svg
65
+ :target: http://joss.theoj.org/papers/4b59c7430176ef78c80c6a1100031eb6
66
+
67
+ .. end badges.
68
+
69
+ The `array_split <http://array-split.readthedocs.io/en/latest>`_ python package is
70
+ an enhancement to existing
71
+ `numpy.ndarray <http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html>`_ functions,
72
+ such as
73
+ `numpy.array_split <http://docs.scipy.org/doc/numpy/reference/generated/numpy.array_split.html>`_,
74
+ `skimage.util.view_as_blocks <http://scikit-image.org/docs/0.13.x/api/skimage.util.html#view-as-blocks>`_
75
+ and
76
+ `skimage.util.view_as_windows <http://scikit-image.org/docs/0.13.x/api/skimage.util.html#view-as-windows>`_,
77
+ which sub-divide a multi-dimensional array into a number of multi-dimensional sub-arrays (slices).
78
+ Example application areas include:
79
+
80
+ **Parallel Processing**
81
+ A large (dense) array is partitioned into smaller sub-arrays which can be
82
+ processed concurrently by multiple processes
83
+ (`multiprocessing <https://docs.python.org/3/library/multiprocessing.html>`_
84
+ or `mpi4py <http://pythonhosted.org/mpi4py/>`_) or other memory-limited hardware
85
+ (e.g. GPGPU using `pyopencl <https://mathema.tician.de/software/pyopencl/>`_,
86
+ `pycuda <https://mathema.tician.de/software/pycuda/>`_, etc).
87
+ For GPGPU, it is necessary for sub-array not to exceed the GPU memory and
88
+ desirable for the sub-array shape to be a multiple of the *work-group*
89
+ (`OpenCL <https://en.wikipedia.org/wiki/OpenCL>`_)
90
+ or *thread-block* (`CUDA <https://en.wikipedia.org/wiki/CUDA>`_) size.
91
+
92
+ **File I/O**
93
+ A large (dense) array is partitioned into smaller sub-arrays which can be
94
+ written to individual files
95
+ (as, for example, a
96
+ `HDF5 Virtual Dataset <https://support.hdfgroup.org/HDF5/docNewFeatures/NewFeaturesVirtualDatasetDocs.html>`_).
97
+ It is often desirable for the individual files not to exceed a specified number
98
+ of (Giga) bytes and, for `HDF5 <https://support.hdfgroup.org/HDF5/>`_, it is desirable
99
+ to have the individual file sub-array shape a multiple of
100
+ the `chunk shape <https://support.hdfgroup.org/HDF5/doc1.8/Advanced/Chunking/index.html>`_.
101
+ Similarly, `out of core <https://en.wikipedia.org/wiki/Out-of-core_algorithm>`_
102
+ algorithms for large dense arrays often involve processing the entire data-set as
103
+ a series of *in-core* sub-arrays. Again, it is desirable for the individual sub-array shape
104
+ to be a multiple of the
105
+ `chunk shape <https://support.hdfgroup.org/HDF5/doc1.8/Advanced/Chunking/index.html>`_.
106
+
107
+
108
+ The `array_split <http://array-split.readthedocs.io/en/latest>`_ package provides the
109
+ means to partition an array (or array shape) using any of the following criteria:
110
+
111
+ - Per-axis indices indicating the *cut* positions.
112
+ - Per-axis number of sub-arrays.
113
+ - Total number of sub-arrays (with optional per-axis *number of sections* constraints).
114
+ - Specific sub-array shape.
115
+ - Specification of *halo* (*ghost*) elements for sub-arrays.
116
+ - Arbitrary *start index* for the shape to be partitioned.
117
+ - Maximum number of bytes for a sub-array with constraints:
118
+
119
+ - sub-arrays are an even multiple of a specified sub-tile shape
120
+ - upper limit on the per-axis sub-array shape
121
+
122
+
123
+ Quick Start Example
124
+ ===================
125
+
126
+
127
+ >>> from array_split import array_split, shape_split
128
+ >>> import numpy as np
129
+ >>>
130
+ >>> ary = np.arange(0, 4*9)
131
+ >>>
132
+ >>> array_split(ary, 4) # 1D split into 4 sections (like numpy.array_split)
133
+ [array([0, 1, 2, 3, 4, 5, 6, 7, 8]),
134
+ array([ 9, 10, 11, 12, 13, 14, 15, 16, 17]),
135
+ array([18, 19, 20, 21, 22, 23, 24, 25, 26]),
136
+ array([27, 28, 29, 30, 31, 32, 33, 34, 35])]
137
+ >>>
138
+ >>> shape_split(ary.shape, 4) # 1D split into 4 parts, returns slice objects
139
+ array([(slice(0, 9, None),), (slice(9, 18, None),), (slice(18, 27, None),), (slice(27, 36, None),)],
140
+ dtype=[('0', 'O')])
141
+ >>>
142
+ >>> ary = ary.reshape(4, 9) # Make ary 2D
143
+ >>> split = shape_split(ary.shape, axis=(2, 3)) # 2D split into 2*3=6 sections
144
+ >>> split.shape
145
+ (2, 3)
146
+ >>> split
147
+ array([[(slice(0, 2, None), slice(0, 3, None)),
148
+ (slice(0, 2, None), slice(3, 6, None)),
149
+ (slice(0, 2, None), slice(6, 9, None))],
150
+ [(slice(2, 4, None), slice(0, 3, None)),
151
+ (slice(2, 4, None), slice(3, 6, None)),
152
+ (slice(2, 4, None), slice(6, 9, None))]],
153
+ dtype=[('0', 'O'), ('1', 'O')])
154
+ >>> sub_arys = [ary[tup] for tup in split.flatten()] # Create sub-array views from slice tuples.
155
+ >>> sub_arys
156
+ [array([[ 0, 1, 2], [ 9, 10, 11]]),
157
+ array([[ 3, 4, 5], [12, 13, 14]]),
158
+ array([[ 6, 7, 8], [15, 16, 17]]),
159
+ array([[18, 19, 20], [27, 28, 29]]),
160
+ array([[21, 22, 23], [30, 31, 32]]),
161
+ array([[24, 25, 26], [33, 34, 35]])]
162
+
163
+
164
+ Latest sphinx documentation (including more examples)
165
+ at http://array-split.readthedocs.io/en/latest/.
166
+
167
+ .. end long description.
168
+
169
+ Installation
170
+ ============
171
+
172
+ Using ``pip`` (root access required):
173
+
174
+ ``pip install array_split``
175
+
176
+ or local user install (no root access required):
177
+
178
+ ``pip install --user array_split``
179
+
180
+ or local user install from latest github source:
181
+
182
+ ``pip install --user git+git://github.com/array-split/array_split.git#egg=array_split``
183
+
184
+
185
+ Requirements
186
+ ============
187
+
188
+ Requires `numpy <http://docs.scipy.org/doc/numpy/>`_ version `>= 1.6`,
189
+ python-2 version `>= 2.6` or python-3 version `>= 3.2`.
190
+
191
+ Testing
192
+ =======
193
+
194
+ Run tests (unit-tests and doctest module docstring tests) using::
195
+
196
+ python -m array_split.tests
197
+
198
+ or, from the source tree, run::
199
+
200
+ python setup.py test
201
+
202
+
203
+ Travis CI at:
204
+
205
+ https://travis-ci.org/array-split/array_split/
206
+
207
+ and AppVeyor at:
208
+
209
+ https://ci.appveyor.com/project/array-split/array-split
210
+
211
+ Documentation
212
+ =============
213
+
214
+ Latest sphinx generated documentation is at:
215
+
216
+ http://array-split.readthedocs.io/en/latest
217
+
218
+ and at github *gh-pages*:
219
+
220
+ https://array-split.github.io/array_split/
221
+
222
+ Sphinx documentation can be built from the source::
223
+
224
+ python setup.py build_sphinx
225
+
226
+ with the HTML generated in ``docs/_build/html``.
227
+
228
+
229
+ Latest source code
230
+ ==================
231
+
232
+ Source at github:
233
+
234
+ https://github.com/array-split/array_split
235
+
236
+
237
+ Bug Reports
238
+ ===========
239
+
240
+ To search for bugs or report them, please use the bug tracker at:
241
+
242
+ https://github.com/array-split/array_split/issues
243
+
244
+
245
+ Contributing
246
+ ============
247
+
248
+ Check out the `CONTRIBUTING doc <https://github.com/array-split/array_split/blob/dev/CONTRIBUTING.rst>`_.
249
+
250
+
251
+ License information
252
+ ===================
253
+
254
+ See the file `LICENSE.txt <https://github.com/array-split/array_split/blob/dev/LICENSE.txt>`_
255
+ for terms & conditions, for usage and a DISCLAIMER OF ALL WARRANTIES.
@@ -0,0 +1,22 @@
1
+ LICENSE.txt
2
+ README.rst
3
+ pyproject.toml
4
+ setup.cfg
5
+ setup.py
6
+ array_split/__init__.py
7
+ array_split/_version.py
8
+ array_split/copyright.txt
9
+ array_split/license.py
10
+ array_split/license.txt
11
+ array_split/logging.py
12
+ array_split/split.py
13
+ array_split/split_plot.py
14
+ array_split/split_test.py
15
+ array_split/tests.py
16
+ array_split/unittest.py
17
+ array_split.egg-info/PKG-INFO
18
+ array_split.egg-info/SOURCES.txt
19
+ array_split.egg-info/dependency_links.txt
20
+ array_split.egg-info/not-zip-safe
21
+ array_split.egg-info/requires.txt
22
+ array_split.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ numpy>=1.6
@@ -0,0 +1 @@
1
+ array_split
@@ -0,0 +1,48 @@
1
+ [build-system]
2
+ requires = [
3
+ "setuptools>=42",
4
+ "versioneer[toml]",
5
+ "numpy>=1.6"
6
+ ]
7
+ build-backend = "setuptools.build_meta"
8
+
9
+ [project]
10
+ name = "array_split"
11
+ dependencies = [
12
+ "numpy>=1.6",
13
+ ]
14
+ dynamic = ["version"]
15
+
16
+ authors = [
17
+ { name="Shane-J-Latham", email="array.split@gmail.com" },
18
+ { name="array-split", email="array.split@gmail.com" },
19
+ ]
20
+
21
+ description = "The array_split python package is an enhancement to existing numpy.ndarray functions (such as numpy.array_split) which sub-divide a multi-dimensional array into a number of multi-dimensional sub-arrays (slices)"
22
+ readme = "README.rst"
23
+ keywords = [
24
+ "multi-dimensional-array", "array", "sub-array", "tile", "tiling",
25
+ "splitting", "split", "partition", "partitioning", "scipy", "numpy",
26
+ "ndarray", "domain-decomposition", "array-decomposition"
27
+ ]
28
+ license = { file="LICENSE.txt" }
29
+ requires-python = ">=3.8"
30
+ classifiers = [
31
+ "Programming Language :: Python :: 3",
32
+ "License :: OSI Approved :: MIT License",
33
+ "Operating System :: OS Independent",
34
+ ]
35
+
36
+ [project.urls]
37
+ Homepage = "https://github.com/array-split/array_split"
38
+ Documentation = "https://array-split.readthedocs.io/en/latest/"
39
+ Repository = "https://github.com/array-split/array_split"
40
+ Issues = "https://github.com/array-split/array_split/issues"
41
+
42
+ [tool.versioneer]
43
+ VCS = "git"
44
+ style = "pep440"
45
+ versionfile_source = "array_split/_version.py"
46
+ versionfile_build = "array_split/_version.py"
47
+ tag_prefix = "v"
48
+ parentdir_prefix = "array_split-"
@@ -0,0 +1,16 @@
1
+ [build_sphinx]
2
+ source-dir = docs/source
3
+ build-dir = docs/_build
4
+ all_files = 1
5
+
6
+ [bdist_wheel]
7
+ universal = 1
8
+
9
+ [flake8]
10
+ ignore = W503,W504
11
+ max-line-length = 100
12
+
13
+ [egg_info]
14
+ tag_build =
15
+ tag_date = 0
16
+
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env python
2
+ from setuptools import setup, find_packages
3
+ import versioneer
4
+
5
+
6
+ setup(
7
+ name="array_split",
8
+ version=versioneer.get_version(),
9
+ cmdclass=versioneer.get_cmdclass(),
10
+ zip_safe=False,
11
+ packages=find_packages(),
12
+ package_data={'array_split': ["*.txt"]},
13
+ )
14
+