Mosaik API for Python
=====================
This is an implementation of version 3 of the mosaik API for simulators
written in Python. It hides all the messaging and networking related stuff
and provides a simple base class that you can implement.
Installation
------------
Just use `pip <https://pip.pypa.io>`_ to install it:
.. sourcecode:: bash
$ pip install mosaik-api-v3
Documentation
-------------
Please refer to `mosaik’s documentation`__ of the API.
__ http://mosaik.readthedocs.org/en/latest/mosaik-api/high-level.html
Example Simulator
-----------------
This distribution contains an example simulator in the ``example_sim`` package.
It can be started via the ``pyexamplesim`` command; ``pyexamplesim --help``
shows you how to use it.
It can also be run in-process by importing and calling
``example_sim.mosaik.main()``.
Example MAS
-----------
This distribution contains an example "multi-agent system" that uses the
asyncronous remote calls to mosaik (``get_progress()``,
``get_related_entities()``, ``get_data()``, ``set_data()``).
It can be started via the ``pyexamplemas`` command; ``pyexamplemas --help``
shows you how to use it.
It can also be run in-process by importing and calling
``example_mas.mosaik.main()``.
Development setup
-----------------
To setup a devleopment environment, create a virtualenv and install the
packages from ``requirements.txt``:
.. code-block:: bash
$ mkvirtualenv --python=/usr/bin/python3 mosaik-api-python
(mosaik-api-python)$ pip install -r requirements.txt
To run the tests for the Python version you are currently using, execute
``py.test``. You should also add the test coverage check:
.. code-block:: bash
(mosaik-api-python)$ py.test --cov=example_mas --cov=example_sim --cov=mosaik_api_v3
To run the tests for all supported Python versions, run ``tox``:
.. code-block:: bash
(mosaik-api-python)$ tox
Mosaik's `documentation
<https://mosaik.readthedocs.org/en/latest/dev/setup.html>`_ contains more
details.
Changelog
=========
3.0.13 - 2024-12-11
-------------------
- [CHANGE] The finalize method is now called before the connection
to mosaik is closed.
3.0.12 - 2024-08-19
-------------------
- [FIX] Remote exceptions occurring during calls to mosaik are now
correctly reported to the calling simulator.
3.0.11 - 2024-07-17
-------------------
- [CHANGE] Set default logging level back to info
- [NEW] `configure_logging` flag on `start_simulation` to control
automatic logger setup
3.0.10 - 2024-05-17
-------------------
- [CHANGE] Simulators return a stacktrace to mosaik when running
into an exception
- [FIX] Type for ModelDescription was missing fields
3.0.9 - 2024-03-28
------------------
- [CHANGE] We don't overwrite the logging system in `start_simulation`
anymore, except when the user explicitly sets `--log-level` on the
command line. This also changed the default level to `debug`.
3.0.8 - 2024-03-25
------------------
- [FIX] Enable yielding coroutines in finalize
3.0.7 - 2023-12-19
------------------
- [FIX] Make example_sim's meta legal
3.0.6 - 2023-12-13
------------------
- [FIX] Close asyncio.StreamWriters properly
3.0.5 - 2023-11-08
------------------
- [CHANGE] Improve typing support: package is marked with py.typed file,
types are exported from mosaik_api_v3, Meta and CreateResult are split
into optional and required fields
3.0.4 - 2023-08-31
------------------
- [NEW] Use loguru for logging
- [CHANGE] Remove simpy.io
3.0.3 - 2022-12-14
------------------
- [NEW] Add datetime utility
3.0.2 - 2022-06-01
------------------
- [CHANGE] Use internal mosaik-simpy-io>=0.2.4 instead of simpy.io
3.0.1 - 2022-04-22
------------------
- [CHANGE] Set external events via highlevel function call
3.0.0 - 2021-05-02
------------------
- [CHANGE] Added time_resolution to init function
- [CHANGE] Added max_advance to step function
- [NEW] Implemented set_events capability (external events)
2.4.2 - 2020-11-24
------------------
- [FIX] Constrain simpy to version <4 due to simpy.io incompatibility
2.4 - 2019-02-05
----------------
- [NEW] Simulator can now be started on a different node than mosaik, using the
remote flag "-r" and the timeout flag "-t". Mosaik can the integrate the simulator
using the "connect" method of the simmanager.
2.3 – 2019-01-24
----------------
- [BugFix] Bugfix Tests
2.2 – 2016-02-15
----------------
- [NEW] API version 2.2: Added an optional "setup_done()" method.
- [CHANGE] API version validation: The API version is no longer an integer but
a "major.minor" string. The *major* part has to math with mosaiks major
version. The *minor* part may be lower or equal to mosaik's minor version.
- [FIX] Various minor fixes and stability improvements.
2.1 – 2014-10-24
----------------
- [NEW] Allow extra API methods to be called. See
http://mosaik.readthedocs.org/en/2.0/mosaik-api/high-level.html#mosaik_api.Simulator
- [CHANGE] The *rel* entry in the entity description returned by *create()* is
now optional.
2.0 – 2014-09-22
----------------
- Initial release of the mosaik 2 Sim API for Python.
Authors
=======
The original concepts for the mosaik API were developed by Steffen Schütte and
Stefan Scherfke.
The author of the mosaik API version 2 is Stefan Scherfke.
The author of the mosaik API version 3 is Thomas Raub.
Additional contributors: André El-Ama, Okko Nannen, Annika Ofenloch, Thomas Raub, Eike Schulte, Jan Sören Schwarz, Cornelius Steinbrink
Raw data
{
"_id": null,
"home_page": "https://mosaik.offis.de",
"name": "mosaik-api-v3",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "mosaik development team",
"author_email": "mosaik@offis.de",
"download_url": "https://files.pythonhosted.org/packages/5a/e0/f9c7acf0c965df0c88234be6d6f435c9fb6215144721702cbcbb7b6af887/mosaik-api-v3-3.0.13.tar.gz",
"platform": null,
"description": "Mosaik API for Python\n=====================\n\nThis is an implementation of version 3 of the mosaik API for simulators\nwritten in Python. It hides all the messaging and networking related stuff\nand provides a simple base class that you can implement.\n\n\nInstallation\n------------\n\nJust use `pip <https://pip.pypa.io>`_ to install it:\n\n.. sourcecode:: bash\n\n $ pip install mosaik-api-v3\n\n\nDocumentation\n-------------\n\nPlease refer to `mosaik\u2019s documentation`__ of the API.\n\n__ http://mosaik.readthedocs.org/en/latest/mosaik-api/high-level.html\n\n\nExample Simulator\n-----------------\n\nThis distribution contains an example simulator in the ``example_sim`` package.\n\nIt can be started via the ``pyexamplesim`` command; ``pyexamplesim --help``\nshows you how to use it.\n\nIt can also be run in-process by importing and calling\n``example_sim.mosaik.main()``.\n\n\nExample MAS\n-----------\n\nThis distribution contains an example \"multi-agent system\" that uses the\nasyncronous remote calls to mosaik (``get_progress()``,\n``get_related_entities()``, ``get_data()``, ``set_data()``).\n\nIt can be started via the ``pyexamplemas`` command; ``pyexamplemas --help``\nshows you how to use it.\n\nIt can also be run in-process by importing and calling\n``example_mas.mosaik.main()``.\n\n\nDevelopment setup\n-----------------\n\nTo setup a devleopment environment, create a virtualenv and install the\npackages from ``requirements.txt``:\n\n.. code-block:: bash\n\n $ mkvirtualenv --python=/usr/bin/python3 mosaik-api-python\n (mosaik-api-python)$ pip install -r requirements.txt\n\nTo run the tests for the Python version you are currently using, execute\n``py.test``. You should also add the test coverage check:\n\n.. code-block:: bash\n\n (mosaik-api-python)$ py.test --cov=example_mas --cov=example_sim --cov=mosaik_api_v3\n\nTo run the tests for all supported Python versions, run ``tox``:\n\n.. code-block:: bash\n\n (mosaik-api-python)$ tox\n\nMosaik's `documentation\n<https://mosaik.readthedocs.org/en/latest/dev/setup.html>`_ contains more\ndetails.\n\n\nChangelog\n=========\n\n3.0.13 - 2024-12-11\n-------------------\n\n- [CHANGE] The finalize method is now called before the connection\n to mosaik is closed.\n\n3.0.12 - 2024-08-19\n-------------------\n\n- [FIX] Remote exceptions occurring during calls to mosaik are now\n correctly reported to the calling simulator.\n\n3.0.11 - 2024-07-17\n-------------------\n\n- [CHANGE] Set default logging level back to info\n- [NEW] `configure_logging` flag on `start_simulation` to control\n automatic logger setup\n\n3.0.10 - 2024-05-17\n-------------------\n\n- [CHANGE] Simulators return a stacktrace to mosaik when running\n into an exception\n- [FIX] Type for ModelDescription was missing fields\n\n3.0.9 - 2024-03-28\n------------------\n\n- [CHANGE] We don't overwrite the logging system in `start_simulation`\n anymore, except when the user explicitly sets `--log-level` on the\n command line. This also changed the default level to `debug`.\n\n3.0.8 - 2024-03-25\n------------------\n\n- [FIX] Enable yielding coroutines in finalize\n\n3.0.7 - 2023-12-19\n------------------\n\n- [FIX] Make example_sim's meta legal\n\n3.0.6 - 2023-12-13\n------------------\n\n- [FIX] Close asyncio.StreamWriters properly\n\n3.0.5 - 2023-11-08\n------------------\n\n- [CHANGE] Improve typing support: package is marked with py.typed file,\n types are exported from mosaik_api_v3, Meta and CreateResult are split\n into optional and required fields\n\n3.0.4 - 2023-08-31\n------------------\n\n- [NEW] Use loguru for logging\n- [CHANGE] Remove simpy.io\n\n3.0.3 - 2022-12-14\n------------------\n\n- [NEW] Add datetime utility\n\n3.0.2 - 2022-06-01\n------------------\n\n- [CHANGE] Use internal mosaik-simpy-io>=0.2.4 instead of simpy.io\n\n3.0.1 - 2022-04-22\n------------------\n\n- [CHANGE] Set external events via highlevel function call\n\n3.0.0 - 2021-05-02\n------------------\n\n- [CHANGE] Added time_resolution to init function\n- [CHANGE] Added max_advance to step function\n- [NEW] Implemented set_events capability (external events)\n\n2.4.2 - 2020-11-24\n------------------\n\n- [FIX] Constrain simpy to version <4 due to simpy.io incompatibility\n\n2.4 - 2019-02-05\n----------------\n\n- [NEW] Simulator can now be started on a different node than mosaik, using the\n remote flag \"-r\" and the timeout flag \"-t\". Mosaik can the integrate the simulator\n using the \"connect\" method of the simmanager.\n\n2.3 \u2013\u00a02019-01-24\n----------------\n\n- [BugFix] Bugfix Tests\n\n\n2.2 \u2013\u00a02016-02-15\n----------------\n\n- [NEW] API version 2.2: Added an optional \"setup_done()\" method.\n\n- [CHANGE]\u00a0API version validation: The API version is no longer an integer but\n a \"major.minor\" string. The *major* part has to math with mosaiks major\n version. The *minor* part may be lower or equal to mosaik's minor version.\n\n- [FIX] Various minor fixes and stability improvements.\n\n\n2.1 \u2013 2014-10-24\n----------------\n\n- [NEW]\u00a0Allow extra API methods to be called. See\n http://mosaik.readthedocs.org/en/2.0/mosaik-api/high-level.html#mosaik_api.Simulator\n\n- [CHANGE]\u00a0The *rel* entry in the entity description returned by *create()* is\n now optional.\n\n\n2.0 \u2013 2014-09-22\n----------------\n\n- Initial release of the mosaik 2 Sim API for Python.\n\n\nAuthors\n=======\n\nThe original concepts for the mosaik API were developed by Steffen Sch\u00fctte and\nStefan Scherfke.\n\nThe author of the mosaik API version 2 is Stefan Scherfke.\n\nThe author of the mosaik API version 3 is Thomas Raub.\n\nAdditional contributors: Andr\u00e9 El-Ama, Okko Nannen, Annika Ofenloch, Thomas Raub, Eike Schulte, Jan S\u00f6ren Schwarz, Cornelius Steinbrink\n\n\n",
"bugtrack_url": null,
"license": null,
"summary": "Python implementation of the mosaik API version 3.",
"version": "3.0.13",
"project_urls": {
"Homepage": "https://mosaik.offis.de"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0cce30b47a73a0ed29e7899559f83259e3086858a2f5b42d36b9772d9c882d47",
"md5": "b19eac0ba1d37f614133a3ad68b76c98",
"sha256": "d1cb71b835c809757325646f4887e4cb0198ed8c1f096a66f6af1f40c696030c"
},
"downloads": -1,
"filename": "mosaik_api_v3-3.0.13-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "b19eac0ba1d37f614133a3ad68b76c98",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 19896,
"upload_time": "2024-12-11T16:31:42",
"upload_time_iso_8601": "2024-12-11T16:31:42.281648Z",
"url": "https://files.pythonhosted.org/packages/0c/ce/30b47a73a0ed29e7899559f83259e3086858a2f5b42d36b9772d9c882d47/mosaik_api_v3-3.0.13-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5ae0f9c7acf0c965df0c88234be6d6f435c9fb6215144721702cbcbb7b6af887",
"md5": "530662ea04a777676c6cffd1dc1c47b2",
"sha256": "a39a92aa02c8624440700d2ddb4c01eb9a5c66255b8e6e7df7ad6f1a1256c9ba"
},
"downloads": -1,
"filename": "mosaik-api-v3-3.0.13.tar.gz",
"has_sig": false,
"md5_digest": "530662ea04a777676c6cffd1dc1c47b2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 19377,
"upload_time": "2024-12-11T16:31:43",
"upload_time_iso_8601": "2024-12-11T16:31:43.577165Z",
"url": "https://files.pythonhosted.org/packages/5a/e0/f9c7acf0c965df0c88234be6d6f435c9fb6215144721702cbcbb7b6af887/mosaik-api-v3-3.0.13.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-11 16:31:43",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "mosaik-api-v3"
}