Skip to main content

Demonstration project for the mosaik co-simulation middleware.

Project description

mosaik Demo

Demonstration project for the mosaik co-simulation middleware.

Status

  • pipeline status
  • coverage report

Prerequisites

Under Windows:

  • install Python 3.7 64 bit for all users

Under Ubuntu

sudo apt install python3.7

Ensuring pip

sudo python3.7 -m ensurepip

Creating the Virtual Environment

Under Linux

python3.7 -m venv venv

Under Windows

"C:\Program Files\Python37\python.exe" -m venv venv

Activating the Virtual Environment

Under Bash:

source venv/bin/activate

Under Windows:

venv\Scripts\activate.bat

Installing the Virtual Environment Requirements

python -m pip install --upgrade -r requirements.d/venv.txt

Upgrading the Virtual Environment Requirements

pip-review --local --auto

Testing the Virtual Environment

tox --help

Freezing the Virtual Environment Requirements

Under Linux

 venv/bin/python -m pip uninstall pkg_resources
 venv/bin/python -m pip freeze --all --exclude-editable | grep -v "mosaik_demo" > requirements.d/venv.txt
 # And remove line beginning with package name

Under Windows

 venv\Scripts\python -m pip freeze --all --exclude-editable | grep -v "mosaik_demo" > requirements.d/venv.txt
# And remove line beginning with package name

Creating the Test Environment

tox -e py37 --notest

Activating the Test Environment

Under Bash:

source .tox/py37/bin/activate

Under Windows:

venv\Scripts\activate.bat

Executing the Scenario

Under Linux:

PYTHONPATH=. python mosaik_demo/demo/demo.py

Under Windows:

set PYTHONPATH=. && python mosaik_demo\demo\demo.py 

Accessing the User Interface

The user interface can be accessed from a web browser: http://localhost:8000

The server-side log should look something like this:

Starting "PyPower" as "PyPower-0" ...
Starting "HouseholdSim" as "HouseholdSim-0" ...
Starting "CSV" as "CSV-0" ...
Starting "DB" as "DB-0" ...
INFO:mosaik_api:Starting MosaikHdf5 ...
Starting "WebVis" as "WebVis-0" ...
INFO:mosaik_api:Starting MosaikWeb ...
Starting simulation.
INFO:mosaik_web.mosaik:Creating topology ...
INFO:mosaik_web.mosaik:Topology created
Simulation finished successfully.

Upgrading the Test Environment Requirements

pip-review --local --auto

Test Updated Packages

PYTHONPATH=. pytest

Freezing the Tox Requirements

Under Linux

.tox/py37/bin/python -m pip uninstall pkg_resources
.tox/py37/bin/python -m pip freeze --all --exclude-editable | grep -v "mosaik_demo" > requirements.d/base.txt

Under Windows

.tox\py37\Scripts\python.exe -m pip freeze --all --exclude-editable | grep -v "mosaik_demo" > requirements.d\base.txt

Deactivating any Environment

deactivate

Testing GitLab's Continuous Integration locally

Make sure the code to be tested is pushed, then run:

gitlab-runner exec docker python37

Installing the Package from PyPI

python -m pip install mosaik-demo

Running the Demo

mosaik-demo-month

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

File details

Details for the file mosaik.Demo_semver-0.1.0rc20190716192658-py3-none-any.whl.

File metadata

File hashes

Hashes for mosaik.Demo_semver-0.1.0rc20190716192658-py3-none-any.whl
Algorithm Hash digest
SHA256 959c1b02262d8817bed8d9ab43e451b7431a86deae61bd41810bf32a8e5d6a05
MD5 471649e432e5d848d2a2c14561414ce0
BLAKE2b-256 24bb988ed89ca3ad9fc0fdd47fbc946a0d19e29ec3c8273da3b60b103a837fe1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page