Skip to content

Commit 0a08128

Browse files
committed
A few minor doc fixes and update changelog for release.
1 parent d7731e1 commit 0a08128

File tree

6 files changed

+23
-23
lines changed

6 files changed

+23
-23
lines changed

doc/sphinx/changelog.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Changelog
22
=========
33

4-
2.2 (unreleased)
4+
2.2 (2017-05-12)
55
----------------
66

77
New

doc/sphinx/docs/python/tutorials/coding_udi.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ That was easy! Lets now understand what we actually did. The object ``isl`` now
4747
But there is a catch. We are in python! So it is not possible, in general, to have the same interpreter execute instructions in parallel as,
4848
in most of the popular python language implementations, memory management is not thread-safe. So, while the code above is perfectly fine and will
4949
work with pygmo, a set of ``my_isl`` running evolutions will not run in parallel as each :class:`~pygmo.island`, when executing its :func:`~pygmo.island.evolve()`
50-
acquires the GIL (Global Interpreter Lock) and holds it during the :func:`~pygmo.island.evolve()` execution.
50+
method, acquires the GIL (Global Interpreter Lock) and holds it during the :func:`~pygmo.island.evolve()` execution.
5151

5252
As a consequence, the following code:
5353

doc/sphinx/docs/python/tutorials/using_archipelago.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ assemble an archipelago, the user can instantiate an empty archipelago and use t
9191

9292
.. note::
9393
The island type selected by the :class:`~pygmo.archipelago` constructor is, in this case, the
94-
``Multiprocessing island``, (:class:`pygmo.py_islands.mp_island`) as we run this example on py36 and
94+
``multiprocessing island``, (:class:`pygmo.mp_island`) as we run this example on py36 and
9595
a linux machine. In general, the exact island chosen is platform, population and algorithm
9696
dependent and such choice is described in the docs of the :class:`~pygmo.island` class constructor.
9797

@@ -128,7 +128,7 @@ After inspection, let us now run the evolution.
128128
7 Multiprocessing island Self-adaptive constraints handling A toy problem 50 busy
129129
...
130130

131-
Note how the evolution is happening in parallel on 32 separate threads (each one spawning a process, in this case, as a Multiprocessing island is used).
131+
Note how the evolution is happening in parallel on 32 separate threads (each one spawning a process, in this case, as a multiprocessing island is used).
132132
The evolution happens asynchronously and thus does not interfere directly with our main process. We then have to call the :func:`pygmo.archipelago.wait()`
133133
method to have the main process explicitly wait for all islands to be finished.
134134

@@ -158,7 +158,7 @@ constructed using random seeds.
158158
Managing exceptions
159159
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
160160
What happens if, during the optimization task sent to an :class:`~pygmo.island`, an exception happens? This question is already explored
161-
in the :ref:`py_tutorial_using_island` and since an :class:`~pygmo.archipelago` is, basically, a container for multiple :class:`~pygmo.island`
161+
in the :ref:`island tutorial<py_tutorial_using_island>` and since an :class:`~pygmo.archipelago` is, basically, a container for multiple :class:`~pygmo.island`
162162
here we will overlap with part of that tutorial, exploring exceptions thrown in the :class:`~pygmo.archipelago` context.
163163

164164
To show how pygmo handles these situations we use the fake problem below throwing as soon as 300 fitness evaluations are made.

pygmo/_island_test.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def run_serialization_tests(self):
203203

204204

205205
class mp_island_test_case(_ut.TestCase):
206-
"""Test case for the :class:`~pygmo.py_islands.mp_island` class.
206+
"""Test case for the :class:`~pygmo.mp_island` class.
207207
208208
"""
209209

@@ -256,7 +256,7 @@ def run_basic_tests(self):
256256

257257

258258
class ipyparallel_island_test_case(_ut.TestCase):
259-
"""Test case for the :class:`~pygmo.py_islands.ipyparallel` class.
259+
"""Test case for the :class:`~pygmo.ipyparallel` class.
260260
261261
"""
262262

pygmo/_py_islands.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,19 @@ class mp_island(object):
6060
6161
This user-defined island (UDI) will dispatch evolution tasks to a pool of processes
6262
created via the standard Python multiprocessing module. The pool is shared between
63-
different instances of :class:`~pygmo.py_islands.mp_island`, and it is created
64-
either implicitly by the construction of the first :class:`~pygmo.py_islands.mp_island`
65-
object or explicitly via the :func:`~pygmo.py_islands.mp_island.init_pool()` static method.
63+
different instances of :class:`~pygmo.mp_island`, and it is created
64+
either implicitly by the construction of the first :class:`~pygmo.mp_island`
65+
object or explicitly via the :func:`~pygmo.mp_island.init_pool()` static method.
6666
The default number of processes in the pool is equal to the number of logical CPUs on the
67-
current machine. The pool's size can be queried via :func:`~pygmo.py_islands.mp_island.get_pool_size()`,
68-
and changed via :func:`~pygmo.py_islands.mp_island.resize_pool()`.
67+
current machine. The pool's size can be queried via :func:`~pygmo.mp_island.get_pool_size()`,
68+
and changed via :func:`~pygmo.mp_island.resize_pool()`.
6969
7070
.. note::
7171
7272
Due to certain implementation details of CPython, it is not possible to initialise or resize the pool
7373
from a thread different from the main one. Normally this is not a problem, but, for instance, if the first
74-
:class:`~pygmo.py_islands.mp_island` instance is created in a thread different from the main one, an error
75-
will be raised. In such a situation, the user should ensure to call :func:`~pygmo.py_islands.mp_island.init_pool()`
74+
:class:`~pygmo.mp_island` instance is created in a thread different from the main one, an error
75+
will be raised. In such a situation, the user should ensure to call :func:`~pygmo.mp_island.init_pool()`
7676
from the main thread before spawning the secondary thread.
7777
7878
.. note::
@@ -89,7 +89,7 @@ def __init__(self):
8989
"""
9090
Raises:
9191
92-
unspecified: any exception thrown by :func:`~pygmo.py_islands.mp_island.init_pool()`
92+
unspecified: any exception thrown by :func:`~pygmo.mp_island.init_pool()`
9393
9494
"""
9595
# Init the process pool, if necessary.
@@ -100,7 +100,7 @@ def run_evolve(self, algo, pop):
100100
101101
This method will evolve the input :class:`~pygmo.population` *pop* using the input
102102
:class:`~pygmo.algorithm` *algo*, and return the evolved population. The evolution
103-
is run on one of the processes of the pool backing backing :class:`~pygmo.py_islands.mp_island`.
103+
is run on one of the processes of the pool backing backing :class:`~pygmo.mp_island`.
104104
105105
Args:
106106
@@ -182,7 +182,7 @@ def _make_pool(processes):
182182
def init_pool(processes=None):
183183
"""Initialise the process pool.
184184
185-
This method will initialise the process pool backing :class:`~pygmo.py_islands.mp_island`, if the pool
185+
This method will initialise the process pool backing :class:`~pygmo.mp_island`, if the pool
186186
has not been initialised yet. Otherwise, this method will have no effects.
187187
188188
Args:
@@ -232,7 +232,7 @@ def get_pool_size():
232232
def resize_pool(processes):
233233
"""Resize pool.
234234
235-
This method will resize the process pool backing :class:`~pygmo.py_islands.mp_island`.
235+
This method will resize the process pool backing :class:`~pygmo.mp_island`.
236236
237237
Args:
238238
@@ -242,7 +242,7 @@ def resize_pool(processes):
242242
243243
TypeError: if the *processes* argument is not an ``int``
244244
ValueError: if the *processes* argument is not strictly positive
245-
unspecified: any exception thrown by :func:`~pygmo.py_islands.mp_island.init_pool()`
245+
unspecified: any exception thrown by :func:`~pygmo.mp_island.init_pool()`
246246
247247
"""
248248
import multiprocessing as mp

pygmo/docstrings.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -3641,8 +3641,8 @@ Through the UDI, the island class manages the asynchronous evolution (or optimis
36413641
of its :class:`~pygmo.population` via the algorithm's :func:`~pygmo.algorithm.evolve()`
36423642
method. Depending on the UDI, the evolution might take place in a separate thread (e.g., if the UDI is a
36433643
:class:`~pygmo.thread_island`), in a separate process (e.g., if the UDI is a
3644-
:class:`~pygmo.py_islands.mp_island`) or even in a separate machine (e.g., if the UDI is a
3645-
:class:`~pygmo.py_islands.ipyparallel_island`). The evolution is always asynchronous (i.e., running in the
3644+
:class:`~pygmo.mp_island`) or even in a separate machine (e.g., if the UDI is a
3645+
:class:`~pygmo.ipyparallel_island`). The evolution is always asynchronous (i.e., running in the
36463646
"background") and it is initiated by a call to the :func:`~pygmo.island.evolve()` method. At any
36473647
time the user can query the state of the island and fetch its internal data members. The user can explicitly
36483648
wait for pending evolutions to conclude by calling the :func:`~pygmo.island.wait()` and
@@ -3690,8 +3690,8 @@ An island can be initialised in a variety of ways using keyword arguments:
36903690
36913691
* if *algo* and *pop*'s problem provide at least the :attr:`~pygmo.thread_safety.basic` thread safety guarantee,
36923692
then :class:`~pygmo.thread_island` will be selected as UDI type;
3693-
* otherwise, if the current platform is Windows or the Python version is at least 3.4, then :class:`~pygmo.py_islands.mp_island`
3694-
will be selected as UDI type, else :class:`~pygmo.py_islands.ipyparallel_island` will be chosen;
3693+
* otherwise, if the current platform is Windows or the Python version is at least 3.4, then :class:`~pygmo.mp_island`
3694+
will be selected as UDI type, else :class:`~pygmo.ipyparallel_island` will be chosen;
36953695
* if the arguments list contains *algo*, *prob*, *size* and, optionally, *udi* and *seed*, then a :class:`~pygmo.population`
36963696
will be constructed from *prob*, *size* and *seed*, and the construction will then proceed in the same way detailed
36973697
above (i.e., *algo* and the newly-created population are used to initialise the island's algorithm and population,

0 commit comments

Comments
 (0)