Skip to content

Commit aa0aae5

Browse files
committed
Merge pull request #638 from enthought/feature/update-notebooks
Update notebooks
2 parents 74f0342 + cfb0418 commit aa0aae5

File tree

6 files changed

+2626
-2520
lines changed

6 files changed

+2626
-2520
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ MPI_OUT_BASE := unittest.out
2222
MPI_OUT_PREFIX := ${PARALLEL_OUT_DIR}/${PYTHON_VERSION}-${MPI_OUT_BASE}
2323

2424

25-
MPI_ONLY_LAUNCH_TEST := mpiexec -np 5 python ./distarray/globalapi/tests/launch_mpi.py
25+
MPI_ONLY_LAUNCH_TEST := mpiexec -np 5 python ./distarray/globalapi/tests/launch_mpi.py
2626

2727
# see if we're using MPICH2, else assume OpenMPI
2828
ifneq (,$(findstring MPICH2,$(shell mpicc -v 2>&1)))
@@ -98,7 +98,7 @@ test_mpi_with_coverage:
9898
test: test_ipython test_mpi test_engines
9999
.PHONY: test
100100

101-
test_with_coverage: test_ipython_with_coverage test_mpi_with_coverage test_engines_with_coverage
101+
test_with_coverage: test_ipython_with_coverage test_mpi_with_coverage test_engines_with_coverage
102102
.PHONY: test_with_coverage
103103

104104
coverage_report:

distarray/globalapi/tests/test_context.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919

2020
from numpy.testing import assert_allclose, assert_array_equal
2121

22-
from distarray.testing import DefaultContextTestCase, IPythonContextTestCase, check_targets
22+
from distarray.testing import (DefaultContextTestCase, IPythonContextTestCase,
23+
check_targets)
2324
from distarray.globalapi.context import Context
2425
from distarray.globalapi.maps import Distribution
2526
from distarray.mpionly_utils import is_solo_mpi_process
@@ -53,7 +54,7 @@ def test_local_sin(self):
5354
def local_sin(da):
5455
return numpy.sin(da)
5556
self.context.register(local_sin)
56-
57+
5758
db = self.context.local_sin(self.da)
5859
assert_allclose(0, db.tondarray(), atol=1e-14)
5960

@@ -132,7 +133,8 @@ def local_add_supermix(da, num1, db, num2, dc, num3=99, num4=66):
132133
dm.fill(22)
133134
dn = self.context.empty(self.da.distribution)
134135
dn.fill(44)
135-
do = self.context.local_add_supermix(self.da, 11, dm, 33, dc=dn, num3=55)
136+
do = self.context.local_add_supermix(self.da, 11, dm,
137+
33, dc=dn, num3=55)
136138
expected = 2 * numpy.pi + 11 + 22 + 33 + 44 + 55 + 66
137139
assert_allclose(do.tondarray(), expected)
138140

@@ -146,7 +148,7 @@ def local_none(da):
146148
self.assertTrue(dp is None)
147149

148150
def test_parameterless(self):
149-
151+
150152
def parameterless():
151153
"""This is a parameterless function."""
152154
return None
@@ -304,10 +306,10 @@ def test_2D(self):
304306
def test_3D(self):
305307
a = self.context.empty((3, 3, 3))
306308
db = Distribution(self.context, (3, 3, 3),
307-
dist=('n', 'b', 'n'))
309+
dist=('n', 'b', 'n'))
308310
b = self.context.empty(db)
309311
dc = Distribution(self.context, (3, 3, 3),
310-
dist=('n', 'n', 'b'))
312+
dist=('n', 'n', 'b'))
311313
c = self.context.empty(dc)
312314
self.assertEqual(a.grid_shape, (3, 1, 1))
313315
self.assertEqual(b.grid_shape, (1, 3, 1))
@@ -402,18 +404,21 @@ def foo():
402404

403405
def test_apply_distarray(self):
404406

405-
da = self.context.empty((len(self.context.targets),), dtype=numpy.uint32)
407+
da = self.context.empty((len(self.context.targets),),
408+
dtype=numpy.uint32)
406409

407410
def local_label(la):
408411
la.ndarray.fill(la.comm.rank)
409412

410-
# Testing that we can pass in `da` and `apply()` extracts `da.key` automatically.
413+
# Testing that we can pass in `da`
414+
# and `apply()` extracts `da.key` automatically.
411415
self.context.apply(local_label, (da,))
412416
assert_array_equal(da.tondarray(), range(len(self.context.targets)))
413417

414418
self.context.apply(local_label, kwargs={'la': da})
415419
assert_array_equal(da.tondarray(), range(len(self.context.targets)))
416420

421+
417422
class TestGetBaseComm(DefaultContextTestCase):
418423

419424
ntargets = 'any'

0 commit comments

Comments
 (0)