Skip to main content

A simulation execution manager for ns-3

Project description

A Simulation Execution Manager for ns-3

Build Status codecov Join the chat at https://gitter.im/ns-3-sem/Lobby

This is a Python library to perform multiple ns-3 script executions, manage the results and collect them in processing-friendly data structures. For complete step-by-step usage and installation instructions, check out readthedocs.

Contributing

If you want to contribute to sem development, first of all you'll need an installation that allows you to modify the code, immediately see the results and run tests.

Building the module from scratch

This module is developed using pipenv: in order to correctly manage virtual environments and install dependencies, make sure it is installed. Typically, the following is enough:

pip install -U pipenv

Note that, depending on the specifics of your python installation, you may need to add ~/.local/bin to your path. In case this is needed, pip should warn you during installation.

Then, clone the repo (or your fork, by changing the url in the following command), also getting the ns-3 installations that are used for running examples and tests:

git clone https://github.com/DvdMgr/sem
cd sem
git submodule update --init --recursive

From the project root, you can then install the package and the requirements with the following:

pipenv install --dev

This will also get you a set of tools such as sphinx, pygments and pytest that handle documentation and tests.

Finally, you can spawn a sub-shell using the new virtual environment by calling:

pipenv shell

Now, you can start a python REPL to use the library interactively, issue the bash sem program, run tests and compile the documentation of your local copy of sem.

Running tests

This project uses the pytest framework for running tests. Tests can be run, from the project root, using:

python -m pytest --doctest-glob='*.rst' docs/
python -m pytest -x -n 3 --doctest-modules --cov-report term --cov=sem/ ./tests

These two commands will run, respectively, all code contained in the docs/ folder and all tests, also measuring coverage and outputting it to the terminal.

Since we are mainly testing integration with ns-3, tests require frequent copying and pasting of folders, ns-3 compilations and simulation running. Furthermore, documentation tests run all the examples in the documentation to make sure the output is as expected. Because of this, full tests are far from instantaneous. Single test files can be targeted, to achieve faster execution times, by substituting ./tests in the second command with the path to the test file that needs to be run.

Building the documentation

Documentation can be built locally using the makefile's docs target:

make docs

The documentation of the current version of the package is also available on readthedocs.

Running examples

The scripts in examples/ can be directly run:

python examples/wifi_plotting_xarray.py
python examples/lorawan_parsing_xarray.py

Troubleshooting

In case there are problems with the pandas installation (this will happen in macOS, for which no binaries are provided), use the following command for installation (and see this pandas issue as a reference):

PIP_NO_BUILD_ISOLATION=false pipenv install

Authors

Davide Magrin

Project details


Download files

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

Source Distribution

sem-0.2.3.tar.gz (25.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sem-0.2.3-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

Details for the file sem-0.2.3.tar.gz.

File metadata

  • Download URL: sem-0.2.3.tar.gz
  • Upload date:
  • Size: 25.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for sem-0.2.3.tar.gz
Algorithm Hash digest
SHA256 68dc9511b59d8ca7694c0a9efcb7b1c309eefbe7739dba81c976d8372f1115fe
MD5 1bdbd7dad1f525fe94bd23ab141ce018
BLAKE2b-256 6f265bb9c77daa0d82c50289a87c4e4c9dbf42962e48b4abbfbe9ffd149f6a6e

See more details on using hashes here.

File details

Details for the file sem-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: sem-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 34.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for sem-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 92a5d29cef2dce761dea6c9e089a068490a22401fac05aca12c3b47c85d39845
MD5 f45aaf9c45f8f2e45422be391ade272b
BLAKE2b-256 479d02c28ff1e2fa672e567315ea671cf9aca65af0f6aaab70476f0325cc0007

See more details on using hashes here.

Supported by

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