array-split 0.5.1__py2.py3-none-any.whl → 0.6.4__py2.py3-none-any.whl

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.
array_split/__init__.py CHANGED
@@ -61,14 +61,15 @@ Attributes
61
61
 
62
62
  """
63
63
  from __future__ import absolute_import
64
- from .license import license as _license, copyright as _copyright, version as _version
64
+ from .license import license as _license, copyright as _copyright
65
65
  from . import split # noqa: E402,F401
66
66
  from .split import array_split, shape_split, ShapeSplitter # noqa: E402,F401
67
+ from . import _version
67
68
 
68
69
  __author__ = "Shane J. Latham"
69
70
  __license__ = _license()
70
71
  __copyright__ = _copyright()
71
- __version__ = _version()
72
+ __version__ = _version.get_versions()['version']
72
73
 
73
74
 
74
75
  #: See :data:`array_split.split.ARRAY_BOUNDS`
@@ -0,0 +1,21 @@
1
+
2
+ # This file was generated by 'versioneer.py' (0.29) from
3
+ # revision-control system data, or from the parent directory name of an
4
+ # unpacked source archive. Distribution tarballs contain a pre-generated copy
5
+ # of this file.
6
+
7
+ import json
8
+
9
+ version_json = '''
10
+ {
11
+ "date": "2024-08-04T15:27:48+1000",
12
+ "dirty": false,
13
+ "error": null,
14
+ "full-revisionid": "a5b1cb7c6fbd1db5829249f13a00b42267ac865e",
15
+ "version": "0.6.4"
16
+ }
17
+ ''' # END VERSION_JSON
18
+
19
+
20
+ def get_versions():
21
+ return json.loads(version_json)
array_split/license.py CHANGED
@@ -4,6 +4,7 @@ To be replaced.
4
4
  # pylint: disable=redefined-builtin
5
5
  from __future__ import absolute_import
6
6
  import pkg_resources as _pkg_resources
7
+ from . import _version
7
8
 
8
9
  __copyright__ = _pkg_resources.resource_string("array_split", "copyright.txt").decode()
9
10
  __license__ = (
@@ -14,7 +15,7 @@ __license__ = (
14
15
  _pkg_resources.resource_string("array_split", "license.txt").decode()
15
16
  )
16
17
  __author__ = "Shane J. Latham"
17
- __version__ = _pkg_resources.resource_string("array_split", "version.txt").decode().strip()
18
+ __version__ = _version.get_versions()['version']
18
19
 
19
20
 
20
21
  def version():
array_split/logging.py CHANGED
@@ -94,7 +94,7 @@ class _Python2SplitStreamHandler(_builtin_logging.Handler):
94
94
  stream.flush()
95
95
  except (KeyboardInterrupt, SystemExit):
96
96
  raise
97
- except:
97
+ except Exception:
98
98
  self.handleError(record)
99
99
 
100
100
 
@@ -162,7 +162,7 @@ class _Python3SplitStreamHandler(_builtin_logging.Handler):
162
162
  self.flush()
163
163
  except (KeyboardInterrupt, SystemExit): # pragma: no cover
164
164
  raise
165
- except:
165
+ except Exception:
166
166
  self.handleError(record)
167
167
 
168
168
 
array_split/split.py CHANGED
@@ -179,7 +179,7 @@ def pad_with_none(sequence, new_length):
179
179
  def shape_factors(n, dim=2):
180
180
  """
181
181
  Returns a :obj:`numpy.ndarray` of factors :samp:`f` such
182
- that :samp:`(len(f) == {dim}) and (numpy.product(f) == {n})`.
182
+ that :samp:`(len(f) == {dim}) and (numpy.prod(f) == {n})`.
183
183
  The returned factors are as *square* (*cubic*, etc) as possible.
184
184
  For example::
185
185
 
@@ -225,7 +225,7 @@ def calculate_tile_shape_for_max_bytes(
225
225
  ):
226
226
  """
227
227
  Returns a tile shape :samp:`tile_shape`
228
- such that :samp:`numpy.product(tile_shape)*numpy.sum({array_itemsize}) <= {max_tile_bytes}`.
228
+ such that :samp:`numpy.prod(tile_shape)*numpy.sum({array_itemsize}) <= {max_tile_bytes}`.
229
229
  Also, if :samp:`{max_tile_shape} is not None`
230
230
  then :samp:`numpy.all(tile_shape <= {max_tile_shape}) is True` and
231
231
  if :samp:`{sub_tile_shape} is not None`
@@ -340,7 +340,7 @@ def calculate_tile_shape_for_max_bytes(
340
340
  and
341
341
  (
342
342
  (
343
- _np.product(tile_sub_tile_split_shape * sub_tile_shape + _np.sum(halo, axis=1))
343
+ _np.prod(tile_sub_tile_split_shape * sub_tile_shape + _np.sum(halo, axis=1))
344
344
  *
345
345
  array_itemsize
346
346
  )
@@ -355,7 +355,7 @@ def calculate_tile_shape_for_max_bytes(
355
355
  max_tile_bytes
356
356
  //
357
357
  (
358
- _np.product(
358
+ _np.prod(
359
359
  tile_sub_tile_split_shape *
360
360
  sub_tile_shape +
361
361
  _np.sum(
@@ -375,10 +375,10 @@ def calculate_tile_shape_for_max_bytes(
375
375
  (
376
376
  (max_tile_bytes / float(array_itemsize))
377
377
  -
378
- _np.sum(halo[current_axis]) * _np.product(sub_tile_shape_h[0:current_axis])
378
+ _np.sum(halo[current_axis]) * _np.prod(sub_tile_shape_h[0:current_axis])
379
379
  )
380
380
  /
381
- float(_np.product(sub_tile_shape_h))
381
+ float(_np.prod(sub_tile_shape_h))
382
382
  ))
383
383
  current_axis += 1
384
384
 
@@ -399,7 +399,7 @@ def calculate_num_slices_per_axis(num_slices_per_axis, num_slices, max_slices_pe
399
399
  """
400
400
  Returns a :obj:`numpy.ndarray` (:samp:`return_array` say) where non-positive elements of
401
401
  the :samp:`{num_slices_per_axis}` sequence have been replaced with
402
- positive integer values such that :samp:`numpy.product(return_array) == num_slices`
402
+ positive integer values such that :samp:`numpy.prod(return_array) == num_slices`
403
403
  and::
404
404
 
405
405
  numpy.all(
@@ -417,13 +417,13 @@ def calculate_num_slices_per_axis(num_slices_per_axis, num_slices, max_slices_pe
417
417
  :type num_slices: integer
418
418
  :param num_slices: Indicates the number of slices (rectangular sub-arrays)
419
419
  formed by performing sub-divisions per axis. The returned array :samp:`return_array`
420
- has elements assigned such that :samp:`numpy.product(return_array) == {num_slices}`.
420
+ has elements assigned such that :samp:`numpy.prod(return_array) == {num_slices}`.
421
421
  :type max_slices_per_axis: sequence of :obj:`int` (or :samp:`None`)
422
422
  :param max_slices_per_axis: Constraint specifying maximum number of per-axis sub-divisions.
423
423
  If :samp:`None` defaults to :samp:`numpy.array([numpy.inf,]*len({num_slices_per_axis}))`.
424
424
  :rtype: :obj:`numpy.ndarray`
425
425
  :return: An array :samp:`return_array`
426
- such that :samp:`numpy.product(return_array) == num_slices`.
426
+ such that :samp:`numpy.prod(return_array) == num_slices`.
427
427
 
428
428
 
429
429
  Examples::
@@ -451,7 +451,7 @@ def calculate_num_slices_per_axis(num_slices_per_axis, num_slices, max_slices_pe
451
451
  raise ValueError("Got non-positive value in max_slices_per_axis=%s" % max_slices_per_axis)
452
452
 
453
453
  while _np.any(ret_array <= 0):
454
- prd = _np.product(ret_array[_np.where(ret_array > 0)]) # returns 1 for zero-length array
454
+ prd = _np.prod(ret_array[_np.where(ret_array > 0)]) # returns 1 for zero-length array
455
455
  if (num_slices < prd) or ((num_slices % prd) > 0):
456
456
  raise ValueError(
457
457
  (
@@ -470,10 +470,10 @@ def calculate_num_slices_per_axis(num_slices_per_axis, num_slices, max_slices_pe
470
470
  for i in range(ridx[0].shape[0]):
471
471
  if f[i] >= max_slices_per_axis[ridx[0][i]]:
472
472
  ret_array[ridx[0][i]] = max_slices_per_axis[ridx[0][i]]
473
- prd = _np.product(ret_array[_np.where(ret_array > 0)])
473
+ prd = _np.prod(ret_array[_np.where(ret_array > 0)])
474
474
  while (num_slices % prd) > 0:
475
475
  ret_array[ridx[0][i]] -= 1
476
- prd = _np.product(ret_array[_np.where(ret_array > 0)])
476
+ prd = _np.prod(ret_array[_np.where(ret_array > 0)])
477
477
  logger.debug(
478
478
  "ridx=%s, f=%s, ret_array=%s, max_slices_per_axis=%s",
479
479
  ridx, f, ret_array, max_slices_per_axis
@@ -670,7 +670,7 @@ class ShapeSplitter(object):
670
670
  >>> split
671
671
  array([(slice(0, 4, None),), (slice(4, 7, None),), (slice(7, 10, None),)],
672
672
  dtype=[('0', 'O')])
673
- >>> [ary[slyce] for slyce in split.flatten()]
673
+ >>> [ary[slyce] for slyce in split.flatten().tolist()]
674
674
  [array([0, 1, 2, 3]), array([4, 5, 6]), array([7, 8, 9])]
675
675
  >>>
676
676
  >>> splitter.split_shape # equivalent to split.shape above
@@ -1229,20 +1229,20 @@ class ShapeSplitter(object):
1229
1229
  tuple(
1230
1230
  [
1231
1231
  slice(
1232
- max([
1232
+ int(max([
1233
1233
  self.split_begs[d][idx[d]]
1234
1234
  + self.array_start[d]
1235
1235
  - self.halo[d, 0]
1236
1236
  * (self.split_ends[d][idx[d]] > self.split_begs[d][idx[d]]),
1237
1237
  self.tile_beg_min[d]
1238
- ]),
1239
- min([
1238
+ ])),
1239
+ int(min([
1240
1240
  self.split_ends[d][idx[d]]
1241
1241
  + self.array_start[d]
1242
1242
  + self.halo[d, 1]
1243
1243
  * (self.split_ends[d][idx[d]] > self.split_begs[d][idx[d]]),
1244
1244
  self.tile_end_max[d]
1245
- ])
1245
+ ]))
1246
1246
  )
1247
1247
  for d in range(len(self.split_shape))
1248
1248
  ]
@@ -1250,8 +1250,8 @@ class ShapeSplitter(object):
1250
1250
  for idx in
1251
1251
  _np.array(
1252
1252
  _np.unravel_index(
1253
- _np.arange(0, _np.product(self.split_shape)),
1254
- self.split_shape
1253
+ _np.arange(0, _np.prod(self.split_shape)),
1254
+ self.split_shape if self.split_shape is not None else tuple()
1255
1255
  )
1256
1256
  ).T
1257
1257
  ],
@@ -1302,8 +1302,8 @@ class ShapeSplitter(object):
1302
1302
  for idx in
1303
1303
  _np.array(
1304
1304
  _np.unravel_index(
1305
- _np.arange(0, _np.product(self.split_shape)),
1306
- self.split_shape
1305
+ _np.arange(0, _np.prod(self.split_shape)),
1306
+ self.split_shape if self.split_shape is not None else tuple()
1307
1307
  )
1308
1308
  ).T
1309
1309
  ],
@@ -1373,7 +1373,7 @@ class ShapeSplitter(object):
1373
1373
  and
1374
1374
  _np.all([s > 0 for s in self.split_num_slices_per_axis])
1375
1375
  ):
1376
- self.split_size = _np.product(self.split_num_slices_per_axis)
1376
+ self.split_size = _np.prod(self.split_num_slices_per_axis)
1377
1377
  else:
1378
1378
  raise ValueError(
1379
1379
  (
@@ -1517,7 +1517,10 @@ class ShapeSplitter(object):
1517
1517
  """
1518
1518
 
1519
1519
  self.set_split_extents()
1520
- return self.calculate_split_from_extents()
1520
+ slyces = self.calculate_split_from_extents()
1521
+ self.logger.debug("type(slyces)=%s", type(slyces))
1522
+ self.logger.debug("slyces=%s", slyces)
1523
+ return slyces
1521
1524
 
1522
1525
 
1523
1526
  ShapeSplitter([0, ]).__init__.__func__.__doc__ = \
@@ -1596,7 +1599,7 @@ def array_split(
1596
1599
  halo=None
1597
1600
  ):
1598
1601
  "To be replaced."
1599
- return [
1602
+ return list(
1600
1603
  ary[slyce]
1601
1604
  for slyce in
1602
1605
  shape_split(
@@ -1611,8 +1614,8 @@ def array_split(
1611
1614
  sub_tile_shape=sub_tile_shape,
1612
1615
  halo=halo,
1613
1616
  tile_bounds_policy=ARRAY_BOUNDS
1614
- ).flatten()
1615
- ]
1617
+ ).flatten().tolist()
1618
+ )
1616
1619
 
1617
1620
 
1618
1621
  array_split.__doc__ =\
@@ -0,0 +1,43 @@
1
+ """
2
+ ========================================
3
+ The :mod:`array_split.split_plot` Module
4
+ ========================================
5
+
6
+ Uses :mod:`matplotlib` to plot a split.
7
+
8
+ Classes and Functions
9
+ =====================
10
+
11
+ .. autosummary::
12
+ :toctree: generated/
13
+
14
+ SplitPlotter - Plots a split.
15
+ plot - Plots split shapes.
16
+
17
+ """
18
+
19
+ from __future__ import absolute_import
20
+
21
+ from .license import license as _license, copyright as _copyright, version as _version
22
+
23
+ __author__ = "Shane J. Latham"
24
+ __license__ = _license()
25
+ __copyright__ = _copyright()
26
+ __version__ = _version()
27
+
28
+
29
+ class SplitPlotter(object):
30
+ """
31
+ Plots a split.
32
+ """
33
+
34
+ def __init__(self):
35
+ """
36
+ """
37
+ pass
38
+
39
+
40
+ def plot(split):
41
+ """
42
+ Plots a split.
43
+ """
array_split/split_test.py CHANGED
@@ -1455,7 +1455,7 @@ class SplitTest(_unittest.TestCase):
1455
1455
  splt = splitter.calculate_split()
1456
1456
  splt_halos = splitter.calculate_split_halos_from_extents()
1457
1457
  self.assertSequenceEqual(splt.shape, splt_halos.shape)
1458
- self.assertTrue(_np.all(splt_halos.astype(_np.int64) == 0))
1458
+ self.assertTrue(_np.all(_np.asarray(splt_halos.tolist()) == 0))
1459
1459
 
1460
1460
  # Some tiles narrower than halo width
1461
1461
  splitter = ShapeSplitter((15, 13), axis=[3, 3], halo=5, tile_bounds_policy=ARRAY_BOUNDS)
@@ -1474,7 +1474,7 @@ class SplitTest(_unittest.TestCase):
1474
1474
  splt = splitter.calculate_split()
1475
1475
  splt_halos = splitter.calculate_split_halos_from_extents()
1476
1476
  self.assertSequenceEqual(splt.shape, splt_halos.shape)
1477
- self.assertTrue(_np.all(splt_halos.astype(_np.int64) == 0))
1477
+ self.assertTrue(_np.all(_np.asarray(splt_halos.tolist()) == 0))
1478
1478
 
1479
1479
  # Tiles narrower than halo width
1480
1480
  splitter = ShapeSplitter((5, 13), axis=[5, 3], halo=5, tile_bounds_policy=ARRAY_BOUNDS)
array_split/tests.py CHANGED
@@ -142,4 +142,6 @@ def load_tests(loader, tests, pattern): # pylint: disable=unused-argument
142
142
  __all__ = [s for s in dir() if not s.startswith('_')]
143
143
 
144
144
  if __name__ == "__main__":
145
+ # import logging
146
+ # logging.basicConfig(level=logging.DEBUG)
145
147
  _unittest.main()
@@ -0,0 +1,16 @@
1
+ Copyright (C) 2017 The Australian National University.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this
4
+ software and associated documentation files (the "Software"), to deal in the Software
5
+ without restriction, including without limitation the rights to use, copy, modify, merge,
6
+ publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
7
+ to whom the Software is furnished to do so, subject to the following conditions:
8
+
9
+ The above copyright notice and this permission notice shall be included in all copies or
10
+ substantial portions of the Software.
11
+
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
13
+ BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
14
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
15
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,39 +1,53 @@
1
- Metadata-Version: 2.0
2
- Name: array-split
3
- Version: 0.5.1
4
- Summary: Python package for splitting arrays into sub-arrays (i.e. rectangular-tiling and rectangular-domain-decomposition), similar to ``numpy.array_split``.
5
- Home-page: http://github.com/array-split/array_split
6
- Author: Shane J. Latham
7
- Author-email: array.split@gmail.com
8
- License: MIT
9
- Keywords: multi-dimendional-array array sub-array tile tiling splitting split partitionpartitioning scipy numpy ndarray domain-decomposition array-decomposition
10
- Platform: UNKNOWN
11
- Classifier: Development Status :: 5 - Production/Stable
12
- Classifier: Intended Audience :: Developers
13
- Classifier: Intended Audience :: Science/Research
14
- Classifier: Topic :: Utilities
15
- Classifier: License :: OSI Approved :: MIT License
16
- Classifier: Programming Language :: Python :: 2
17
- Classifier: Programming Language :: Python :: 2.6
18
- Classifier: Programming Language :: Python :: 2.7
1
+ Metadata-Version: 2.1
2
+ Name: array_split
3
+ Version: 0.6.4
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
19
28
  Classifier: Programming Language :: Python :: 3
20
- Classifier: Programming Language :: Python :: 3.4
21
- Classifier: Programming Language :: Python :: 3.5
22
- Classifier: Programming Language :: Python :: 3.6
23
- Classifier: Natural Language :: English
24
- Requires-Dist: numpy (>=1.6)
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
+ Requires-Dist: numpy >=1.6
35
+
25
36
 
37
+ =============
38
+ `array_split`
39
+ =============
40
+
41
+ .. Start of sphinx doc include.
42
+ .. start long description.
26
43
  .. start badges.
27
44
 
28
45
  .. image:: https://img.shields.io/pypi/v/array_split.svg
29
46
  :target: https://pypi.python.org/pypi/array_split/
30
47
  :alt: array_split python package
31
- .. image:: https://travis-ci.org/array-split/array_split.svg?branch=dev
32
- :target: https://travis-ci.org/array-split/array_split
33
- :alt: TravisCI Status
34
- .. image:: https://ci.appveyor.com/api/projects/status/oprsw5rfr07m77o0?svg=true
35
- :target: https://ci.appveyor.com/project/array-split/array-split
36
- :alt: AppVeyor Status
48
+ .. image:: https://github.com/array-split/array_split/actions/workflows/python-test.yml/badge.svg
49
+ :target: https://github.com/array-split/array_split/actions/workflows/python-test.yml
50
+ :alt: array_split python package
37
51
  .. image:: https://readthedocs.org/projects/array-split/badge/?version=stable
38
52
  :target: http://array-split.readthedocs.io/en/stable
39
53
  :alt: Documentation Status
@@ -46,6 +60,10 @@ Requires-Dist: numpy (>=1.6)
46
60
  .. image:: https://img.shields.io/pypi/pyversions/array_split.svg
47
61
  :target: https://pypi.python.org/pypi/array_split/
48
62
  :alt: array_split python package
63
+ .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.889078.svg
64
+ :target: https://doi.org/10.5281/zenodo.889078
65
+ .. image:: http://joss.theoj.org/papers/10.21105/joss.00373/status.svg
66
+ :target: http://joss.theoj.org/papers/4b59c7430176ef78c80c6a1100031eb6
49
67
 
50
68
  .. end badges.
51
69
 
@@ -147,4 +165,92 @@ Quick Start Example
147
165
  Latest sphinx documentation (including more examples)
148
166
  at http://array-split.readthedocs.io/en/latest/.
149
167
 
168
+ .. end long description.
169
+
170
+ Installation
171
+ ============
172
+
173
+ Using ``pip`` (root access required):
174
+
175
+ ``pip install array_split``
176
+
177
+ or local user install (no root access required):
178
+
179
+ ``pip install --user array_split``
180
+
181
+ or local user install from latest github source:
182
+
183
+ ``pip install --user git+git://github.com/array-split/array_split.git#egg=array_split``
184
+
185
+
186
+ Requirements
187
+ ============
188
+
189
+ Requires `numpy <http://docs.scipy.org/doc/numpy/>`_ version `>= 1.6`,
190
+ python-2 version `>= 2.6` or python-3 version `>= 3.2`.
191
+
192
+ Testing
193
+ =======
194
+
195
+ Run tests (unit-tests and doctest module docstring tests) using::
196
+
197
+ python -m array_split.tests
198
+
199
+ or, from the source tree, run::
200
+
201
+ python setup.py test
202
+
203
+
204
+ Travis CI at:
205
+
206
+ https://travis-ci.org/array-split/array_split/
207
+
208
+ and AppVeyor at:
209
+
210
+ https://ci.appveyor.com/project/array-split/array-split
211
+
212
+ Documentation
213
+ =============
214
+
215
+ Latest sphinx generated documentation is at:
216
+
217
+ http://array-split.readthedocs.io/en/latest
218
+
219
+ and at github *gh-pages*:
220
+
221
+ https://array-split.github.io/array_split/
222
+
223
+ Sphinx documentation can be built from the source::
224
+
225
+ python setup.py build_sphinx
226
+
227
+ with the HTML generated in ``docs/_build/html``.
228
+
229
+
230
+ Latest source code
231
+ ==================
232
+
233
+ Source at github:
234
+
235
+ https://github.com/array-split/array_split
236
+
237
+
238
+ Bug Reports
239
+ ===========
240
+
241
+ To search for bugs or report them, please use the bug tracker at:
242
+
243
+ https://github.com/array-split/array_split/issues
244
+
245
+
246
+ Contributing
247
+ ============
248
+
249
+ Check out the `CONTRIBUTING doc <https://github.com/array-split/array_split/blob/dev/CONTRIBUTING.rst>`_.
250
+
251
+
252
+ License information
253
+ ===================
150
254
 
255
+ See the file `LICENSE.txt <https://github.com/array-split/array_split/blob/dev/LICENSE.txt>`_
256
+ for terms & conditions, for usage and a DISCLAIMER OF ALL WARRANTIES.
@@ -0,0 +1,16 @@
1
+ array_split/__init__.py,sha256=MhUT1vAjdCj_7TanAParWfHu8KmIEYEV5XqmeGorcoI,2655
2
+ array_split/_version.py,sha256=89zuw6m__XlOJrBK-nmTfqTRi6pBEVV4ZDUvP622Evo,497
3
+ array_split/copyright.txt,sha256=Kn1cZDiLPzgR9O6e-_OT2q_BELBKeFLEyMja8X3YOpU,55
4
+ array_split/license.py,sha256=p09v3AawXDoucFQ0vfZm7fYPtA6v48ssP0iR1Y8eU4c,1521
5
+ array_split/license.txt,sha256=voJkgFtk2zV9dBOftdZ7NW3a_aXOLYErZcWZAK812-A,1022
6
+ array_split/logging.py,sha256=siuVTYdxAmRxdwjhrxnSZA4AimNmlOlCHC3Ns9hZ4Sc,8017
7
+ array_split/split.py,sha256=diCJ2Ob_oPhj8khWhqspeuTBhY1MA1vmTUBTbsONNPI,59998
8
+ array_split/split_plot.py,sha256=kQb-j080rtNoIJn9HT-gRdjDnrmfaqcWtwJlXAOmp68,744
9
+ array_split/split_test.py,sha256=oeI5dtGZ-8mm9lvJj-I6ErZRMZu3Nio2xWL7hKrqeOI,54611
10
+ array_split/tests.py,sha256=-T6yGN9NOGHbfxVyYW2y_QrCWskG3m8rZtTeVfay39I,4251
11
+ array_split/unittest.py,sha256=3kf8oFLX-CikKnv2gswfp4tutn-FV773-L6alnvPmiM,13031
12
+ array_split-0.6.4.dist-info/LICENSE.txt,sha256=IyUbQpVqCKhPOzm6BVhZ2fJ_Uj7xr6NBhvlBq7rN3wQ,1079
13
+ array_split-0.6.4.dist-info/METADATA,sha256=Gz_jLyZ2KHR0QnrjGN_EaZJNBkjZkNACjeJ3O5YJIVk,10146
14
+ array_split-0.6.4.dist-info/WHEEL,sha256=XRxW4r1PNiVhMpP4bT9oWtu3HyndxpJ84SkubFgzp_Y,109
15
+ array_split-0.6.4.dist-info/top_level.txt,sha256=exjaJ5xH8Dhtj-gpoxxGnXIn4gga7_gnAmF7y3v0PBs,12
16
+ array_split-0.6.4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.29.0)
2
+ Generator: setuptools (72.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any
@@ -1 +0,0 @@
1
- 0.5.1
array_split/version.txt DELETED
@@ -1 +0,0 @@
1
- 0.5.1
@@ -1,125 +0,0 @@
1
- .. start badges.
2
-
3
- .. image:: https://img.shields.io/pypi/v/array_split.svg
4
- :target: https://pypi.python.org/pypi/array_split/
5
- :alt: array_split python package
6
- .. image:: https://travis-ci.org/array-split/array_split.svg?branch=dev
7
- :target: https://travis-ci.org/array-split/array_split
8
- :alt: TravisCI Status
9
- .. image:: https://ci.appveyor.com/api/projects/status/oprsw5rfr07m77o0?svg=true
10
- :target: https://ci.appveyor.com/project/array-split/array-split
11
- :alt: AppVeyor Status
12
- .. image:: https://readthedocs.org/projects/array-split/badge/?version=stable
13
- :target: http://array-split.readthedocs.io/en/stable
14
- :alt: Documentation Status
15
- .. image:: https://coveralls.io/repos/github/array-split/array_split/badge.svg
16
- :target: https://coveralls.io/github/array-split/array_split
17
- :alt: Coveralls Status
18
- .. image:: https://img.shields.io/pypi/l/array_split.svg
19
- :target: https://pypi.python.org/pypi/array_split/
20
- :alt: MIT License
21
- .. image:: https://img.shields.io/pypi/pyversions/array_split.svg
22
- :target: https://pypi.python.org/pypi/array_split/
23
- :alt: array_split python package
24
-
25
- .. end badges.
26
-
27
- The `array_split <http://array-split.readthedocs.io/en/latest>`_ python package is
28
- an enhancement to existing
29
- `numpy.ndarray <http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html>`_ functions,
30
- such as
31
- `numpy.array_split <http://docs.scipy.org/doc/numpy/reference/generated/numpy.array_split.html>`_,
32
- `skimage.util.view_as_blocks <http://scikit-image.org/docs/0.13.x/api/skimage.util.html#view-as-blocks>`_
33
- and
34
- `skimage.util.view_as_windows <http://scikit-image.org/docs/0.13.x/api/skimage.util.html#view-as-windows>`_,
35
- which sub-divide a multi-dimensional array into a number of multi-dimensional sub-arrays (slices).
36
- Example application areas include:
37
-
38
- **Parallel Processing**
39
- A large (dense) array is partitioned into smaller sub-arrays which can be
40
- processed concurrently by multiple processes
41
- (`multiprocessing <https://docs.python.org/3/library/multiprocessing.html>`_
42
- or `mpi4py <http://pythonhosted.org/mpi4py/>`_) or other memory-limited hardware
43
- (e.g. GPGPU using `pyopencl <https://mathema.tician.de/software/pyopencl/>`_,
44
- `pycuda <https://mathema.tician.de/software/pycuda/>`_, etc).
45
- For GPGPU, it is necessary for sub-array not to exceed the GPU memory and
46
- desirable for the sub-array shape to be a multiple of the *work-group*
47
- (`OpenCL <https://en.wikipedia.org/wiki/OpenCL>`_)
48
- or *thread-block* (`CUDA <https://en.wikipedia.org/wiki/CUDA>`_) size.
49
-
50
- **File I/O**
51
- A large (dense) array is partitioned into smaller sub-arrays which can be
52
- written to individual files
53
- (as, for example, a
54
- `HDF5 Virtual Dataset <https://support.hdfgroup.org/HDF5/docNewFeatures/NewFeaturesVirtualDatasetDocs.html>`_).
55
- It is often desirable for the individual files not to exceed a specified number
56
- of (Giga) bytes and, for `HDF5 <https://support.hdfgroup.org/HDF5/>`_, it is desirable
57
- to have the individual file sub-array shape a multiple of
58
- the `chunk shape <https://support.hdfgroup.org/HDF5/doc1.8/Advanced/Chunking/index.html>`_.
59
- Similarly, `out of core <https://en.wikipedia.org/wiki/Out-of-core_algorithm>`_
60
- algorithms for large dense arrays often involve processing the entire data-set as
61
- a series of *in-core* sub-arrays. Again, it is desirable for the individual sub-array shape
62
- to be a multiple of the
63
- `chunk shape <https://support.hdfgroup.org/HDF5/doc1.8/Advanced/Chunking/index.html>`_.
64
-
65
-
66
- The `array_split <http://array-split.readthedocs.io/en/latest>`_ package provides the
67
- means to partition an array (or array shape) using any of the following criteria:
68
-
69
- - Per-axis indices indicating the *cut* positions.
70
- - Per-axis number of sub-arrays.
71
- - Total number of sub-arrays (with optional per-axis *number of sections* constraints).
72
- - Specific sub-array shape.
73
- - Specification of *halo* (*ghost*) elements for sub-arrays.
74
- - Arbitrary *start index* for the shape to be partitioned.
75
- - Maximum number of bytes for a sub-array with constraints:
76
-
77
- - sub-arrays are an even multiple of a specified sub-tile shape
78
- - upper limit on the per-axis sub-array shape
79
-
80
-
81
- Quick Start Example
82
- ===================
83
-
84
-
85
- >>> from array_split import array_split, shape_split
86
- >>> import numpy as np
87
- >>>
88
- >>> ary = np.arange(0, 4*9)
89
- >>>
90
- >>> array_split(ary, 4) # 1D split into 4 sections (like numpy.array_split)
91
- [array([0, 1, 2, 3, 4, 5, 6, 7, 8]),
92
- array([ 9, 10, 11, 12, 13, 14, 15, 16, 17]),
93
- array([18, 19, 20, 21, 22, 23, 24, 25, 26]),
94
- array([27, 28, 29, 30, 31, 32, 33, 34, 35])]
95
- >>>
96
- >>> shape_split(ary.shape, 4) # 1D split into 4 parts, returns slice objects
97
- array([(slice(0, 9, None),), (slice(9, 18, None),), (slice(18, 27, None),), (slice(27, 36, None),)],
98
- dtype=[('0', 'O')])
99
- >>>
100
- >>> ary = ary.reshape(4, 9) # Make ary 2D
101
- >>> split = shape_split(ary.shape, axis=(2, 3)) # 2D split into 2*3=6 sections
102
- >>> split.shape
103
- (2, 3)
104
- >>> split
105
- array([[(slice(0, 2, None), slice(0, 3, None)),
106
- (slice(0, 2, None), slice(3, 6, None)),
107
- (slice(0, 2, None), slice(6, 9, None))],
108
- [(slice(2, 4, None), slice(0, 3, None)),
109
- (slice(2, 4, None), slice(3, 6, None)),
110
- (slice(2, 4, None), slice(6, 9, None))]],
111
- dtype=[('0', 'O'), ('1', 'O')])
112
- >>> sub_arys = [ary[tup] for tup in split.flatten()] # Create sub-array views from slice tuples.
113
- >>> sub_arys
114
- [array([[ 0, 1, 2], [ 9, 10, 11]]),
115
- array([[ 3, 4, 5], [12, 13, 14]]),
116
- array([[ 6, 7, 8], [15, 16, 17]]),
117
- array([[18, 19, 20], [27, 28, 29]]),
118
- array([[21, 22, 23], [30, 31, 32]]),
119
- array([[24, 25, 26], [33, 34, 35]])]
120
-
121
-
122
- Latest sphinx documentation (including more examples)
123
- at http://array-split.readthedocs.io/en/latest/.
124
-
125
-
@@ -1,17 +0,0 @@
1
- array_split/__init__.py,sha256=QZ_6Vt65Jm150WinoPctYSi5nIoRb8cx-LlEiI35rxI,2629
2
- array_split/copyright.txt,sha256=Kn1cZDiLPzgR9O6e-_OT2q_BELBKeFLEyMja8X3YOpU,55
3
- array_split/git_describe.txt,sha256=q6lRYmyGkM5JPLyPAYIFu0aAA_YfvwD9PTxxzrq8AXc,6
4
- array_split/license.py,sha256=Wn2H3zgk1L6eHMVl9mG4I1OU1myvHFFLGfBUOVY4B-4,1541
5
- array_split/license.txt,sha256=voJkgFtk2zV9dBOftdZ7NW3a_aXOLYErZcWZAK812-A,1022
6
- array_split/logging.py,sha256=qiXbMI_uiWsmH5TwUbos_y6Ha4g-nS2Z0hyBC_gW8A0,7997
7
- array_split/split.py,sha256=GxgXHyFcmBPfMwsqbtyPrD8ToPkqvDddEW5Tb4DnzhQ,59791
8
- array_split/split_test.py,sha256=CGTzQzHlghEJFZ4FkAhgzcKzxxwPWrZnb1Mir5MEfJI,54603
9
- array_split/tests.py,sha256=n_i5BoENmeai4pTST3vWcUbZbtqReRKJ2caWKtNNCXU,4183
10
- array_split/unittest.py,sha256=3kf8oFLX-CikKnv2gswfp4tutn-FV773-L6alnvPmiM,13031
11
- array_split/version.txt,sha256=q6lRYmyGkM5JPLyPAYIFu0aAA_YfvwD9PTxxzrq8AXc,6
12
- array_split-0.5.1.dist-info/DESCRIPTION.rst,sha256=cbns3LurnKOpnpw9SCisRlyOmveTP4mgPTbiCXMbBew,5841
13
- array_split-0.5.1.dist-info/METADATA,sha256=ZP4kqXkCE04HAXgWphvk3fCtjzEjSSQgwUx0oX-mLZc,7009
14
- array_split-0.5.1.dist-info/RECORD,,
15
- array_split-0.5.1.dist-info/WHEEL,sha256=o2k-Qa-RMNIJmUdIc7KU6VWR_ErNRbWNlxDIpl7lm34,110
16
- array_split-0.5.1.dist-info/metadata.json,sha256=fVFONgJWhHIxgY6WD9r0Tzk5WArpfQfOVa7Gmjq1de4,1332
17
- array_split-0.5.1.dist-info/top_level.txt,sha256=exjaJ5xH8Dhtj-gpoxxGnXIn4gga7_gnAmF7y3v0PBs,12
@@ -1 +0,0 @@
1
- {"classifiers": ["Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "Topic :: Utilities", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Natural Language :: English"], "extensions": {"python.details": {"contacts": [{"email": "array.split@gmail.com", "name": "Shane J. Latham", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "http://github.com/array-split/array_split"}}}, "extras": [], "generator": "bdist_wheel (0.29.0)", "keywords": ["multi-dimendional-array", "array", "sub-array", "tile", "tiling", "splitting", "split", "partitionpartitioning", "scipy", "numpy", "ndarray", "domain-decomposition", "array-decomposition"], "license": "MIT", "metadata_version": "2.0", "name": "array-split", "run_requires": [{"requires": ["numpy (>=1.6)"]}], "summary": "Python package for splitting arrays into sub-arrays (i.e. rectangular-tiling and rectangular-domain-decomposition), similar to ``numpy.array_split``.", "version": "0.5.1"}