Skip to content

Commit

Permalink
Merge branch 'release-0.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
LourensVeen committed Jun 28, 2019
2 parents de12be3 + 3c94e5f commit d462f74
Show file tree
Hide file tree
Showing 15 changed files with 332 additions and 232 deletions.
9 changes: 9 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# ReadTheDocs configuration

version: 2

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.6
install:
- requirements: docs/requirements.txt
3 changes: 3 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
:target: https://requires.io/github/multiscale/muscle3/requirements/?branch=master
:alt: Requirements Status

.. image:: https://zenodo.org/badge/122876985.svg
:target: https://zenodo.org/badge/latestdoi/122876985

========
MUSCLE 3
========
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.0-rc.1
0.1.0
8 changes: 8 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
grpcio==1.17.1
grpcio-tools==1.17.1
msgpack==0.6.1
protobuf==3.8.0
ruamel.yaml==0.15.64
typing==3.6.6
yatiml==0.4.2
ymmsl==0.9.0
2 changes: 1 addition & 1 deletion docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
libmuscle package
API Documentation
=================

.. automodule:: libmuscle
Expand Down
6 changes: 6 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../../'))
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../../libmuscle/python/'))

# create a libmuscle/version.py if needed (which it is on RTD)
version_path = os.path.join(os.path.dirname(__file__), '../../libmuscle/python/libmuscle/version.py')
if not os.path.exists(version_path):
with open(version_path, 'w') as f:
f.write("__version__ = '0.0.0'")

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand Down
29 changes: 15 additions & 14 deletions docs/source/distributed_execution.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Distributed execution

In the previous section, we created a simple macro-micro multiscale model with
MUSCLE 3, and ran it as a single Python script. This section briefly explains
how to go from there to a distributed simulation, possibly on multiple machines.
how to go from there to a distributed simulation, possibly on multiple nodes.

Note that distributed simulations are still somewhat experimental. They need a
bit more testing, and more development (in particular integration with a
Expand Down Expand Up @@ -51,8 +51,8 @@ our previous example looks like this:


As you can see, this looks very much like the object representation. You can
load a yMMSL file to objects using `ymmsl.load` and save it back using
`ymmsl.save`.
load a yMMSL file to objects using ``ymmsl.load`` and save it back using
``ymmsl.save``.

Starting the manager
--------------------
Expand All @@ -66,8 +66,8 @@ each other, and distributes settings to them. To start the manager, run
in an environment in which you've installed MUSCLE 3. The manager will start,
and will print its location on standard out. This is the network address on
which it listens for connections from instances.
and will print its location on the standard output. This is the network address
on which it listens for connections from instances.

Starting instances
------------------
Expand All @@ -82,17 +82,18 @@ Starting an instance works just like starting any other Python script:
In the original script, we made a dictionary that mapped compute element names
to Python functions, which MUSCLE 3 used to start the submodel instances. Here,
we need to pass the same information. Instead of a function name, we start a
particular script, and we pass the instance name using the `--muscle-instance=`
argument. Note that the argument parser is not very flexible, so it needs to be
written exactly like that, and of course the instance name needs to match the
compute element name in the yMMSL file passed to the manager.
particular script, and we pass the instance name using the
``--muscle-instance=`` argument. Note that the argument parser is not very
flexible, so it needs to be written exactly like that, and of course the
instance name needs to match the compute element name in the yMMSL file passed
to the manager.

When the instance starts, it will register with the manager. Since we didn't
pass a location using the `--muscle-manager=<host:port>` option, MUSCLE 3 tried
to connect to the default location (localhost:9000), which the manager was
conveniently listening on. The `micro` instance registered, and if you have a
look at the `muscle3_manager.log` file produced by the manager (in the directory
in which you started it), you should find a record of this there.
pass a location using the ``--muscle-manager=<host:port>`` option, MUSCLE 3
tried to connect to the default location (localhost:9000), which the manager
was conveniently listening on. The ``micro`` instance registered, and if you
have a look at the ``muscle3_manager.log`` file produced by the manager (in the
directory in which you started it), you should find a record of this there.

Now, we need to start the second submodel in the same way:

Expand Down
4 changes: 2 additions & 2 deletions docs/source/examples/diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def diffusion() -> None:
Operator.S: ['state_in']})

while instance.reuse_instance():
# f_init
# F_INIT
t_max = instance.get_parameter_value('t_max', 'float')
dt = instance.get_parameter_value('dt', 'float')
x_max = instance.get_parameter_value('x_max', 'float')
Expand All @@ -51,7 +51,7 @@ def diffusion() -> None:

t_cur = 0.0
while t_cur + dt <= t_max:
# O_i
# O_I
t_next = t_cur + dt
if t_next + dt > t_max:
t_next = None
Expand Down
6 changes: 3 additions & 3 deletions docs/source/examples/reaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def reaction() -> None:
Operator.O_F: ['final_state']}) # list of float

while instance.reuse_instance():
# f_init
# F_INIT
t_max = instance.get_parameter_value('t_max', 'float')
dt = instance.get_parameter_value('dt', 'float')
k = instance.get_parameter_value('k', 'float')
Expand All @@ -22,13 +22,13 @@ def reaction() -> None:

t_cur = msg.timestamp
while t_cur + dt < t_max:
# O_i
# O_I

# S
U += k * U * dt
t_cur += dt

# O_f
# O_F
instance.send('final_state', Message(t_cur, None, U.tolist()))


Expand Down
10 changes: 5 additions & 5 deletions docs/source/examples/reaction_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def reaction() -> None:
Operator.O_F: ['final_state']}) # list of float

while instance.reuse_instance():
# f_init
# F_INIT
t_max = instance.get_parameter_value('t_max', 'float')
dt = instance.get_parameter_value('dt', 'float')
k = instance.get_parameter_value('k', 'float')
Expand All @@ -28,13 +28,13 @@ def reaction() -> None:

t_cur = msg.timestamp
while t_cur + dt < t_max:
# O_i
# O_I

# S
U += k * U * dt
t_cur += dt

# O_f
# O_F
instance.send('final_state', Message(t_cur, None, U.tolist()))


Expand Down Expand Up @@ -66,7 +66,7 @@ def diffusion() -> None:
Operator.S: ['state_in']})

while instance.reuse_instance():
# f_init
# F_INIT
t_max = instance.get_parameter_value('t_max', 'float')
dt = instance.get_parameter_value('dt', 'float')
x_max = instance.get_parameter_value('x_max', 'float')
Expand All @@ -81,7 +81,7 @@ def diffusion() -> None:

t_cur = 0.0
while t_cur + dt <= t_max:
# O_i
# O_I
t_next = t_cur + dt
if t_next + dt > t_max:
t_next = None
Expand Down
19 changes: 10 additions & 9 deletions docs/source/examples/reaction_diffusion_qmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def reaction() -> None:
Operator.O_F: ['final_state']}) # list of float

while instance.reuse_instance():
# f_init
# F_INIT
t_max = instance.get_parameter_value('t_max', 'float')
dt = instance.get_parameter_value('dt', 'float')
k = instance.get_parameter_value('k', 'float')
Expand All @@ -28,13 +28,13 @@ def reaction() -> None:

t_cur = msg.timestamp
while t_cur + dt < t_max:
# O_i
# O_I

# S
U += k * U * dt
t_cur += dt

# O_f
# O_F
instance.send('final_state', Message(t_cur, None, U.tolist()))


Expand Down Expand Up @@ -67,7 +67,7 @@ def diffusion() -> None:
Operator.O_F: ['final_state_out']})

while instance.reuse_instance():
# f_init
# F_INIT
t_max = instance.get_parameter_value('t_max', 'float')
dt = instance.get_parameter_value('dt', 'float')
x_max = instance.get_parameter_value('x_max', 'float')
Expand All @@ -82,7 +82,7 @@ def diffusion() -> None:

t_cur = 0.0
while t_cur + dt <= t_max:
# O_i
# O_I
t_next = t_cur + dt
if t_next + dt > t_max:
t_next = None
Expand All @@ -104,7 +104,7 @@ def diffusion() -> None:
Us = np.vstack((Us, U))
t_cur += dt

# O_f
# O_F
instance.send('final_state_out', Message(t_cur, None, U.tolist()))


Expand Down Expand Up @@ -133,7 +133,7 @@ def load_balancer() -> None:
Operator.O_F: ['front_out[]']})

while instance.reuse_instance(False):
# f_init
# F_INIT
started = 0 # number started and index of next to start
done = 0 # number done and index of next to return

Expand Down Expand Up @@ -163,7 +163,7 @@ def qmc_driver() -> None:
Operator.S: ['states_in[]']})

while instance.reuse_instance():
# f_init
# F_INIT
# get and check parameters
n_samples = instance.get_parameter_value('n_samples', 'int')
d_min = instance.get_parameter_value('d_min', 'float')
Expand Down Expand Up @@ -192,7 +192,7 @@ def qmc_driver() -> None:

# run ensemble
Us = None
# O_i
# O_I
for sample in range(n_samples):
uq_parameters = Settings({
'd': ds[sample],
Expand All @@ -210,6 +210,7 @@ def qmc_driver() -> None:
else:
Us = np.vstack((Us, U))

mean = np.mean(Us, axis=0)
plt.figure()
plt.imshow(np.log(Us + 1e-20))
plt.show()
Expand Down
9 changes: 5 additions & 4 deletions docs/source/releasing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,12 @@ Make a GitHub release
---------------------

In order to get a DOI for this release, we need to make a release on GitHub. Go
to the `MUSCLE 3 GitHub repository`_ and click 'Releases'. Select 'Create a new
to the `MUSCLE 3 GitHub repository`_ and click 'Releases'. Select 'Draft a new
release', select the x.y.z. tag that we just uploaded, and use 'Release x.y.z'
as the title. Then copy-paste the description from the change log, and maybe
prepend some text if there is something interesting to mention. Optionally
select 'This is a pre-release' if it's not a final version, then publish it.
as the title. Then copy-paste the description from the change log, convert it
from ReStructuredText to MarkDown and maybe prepend some text if there is
something interesting to mention. Optionally select 'This is a pre-release' if
it's not a final version, then publish it.

Build and release to PyPI
-------------------------
Expand Down
Loading

0 comments on commit d462f74

Please sign in to comment.