FAQs

Q:

How do I install Mpylab as a user?

A:

Users should use a local virtual environment. A typical installation with venv and pip looks like this:

> mkdir Mpylab
> cd Mpylab
> python -m venv .venv
> source .venv/bin/activate
> python -m pip install --upgrade pip
> python -m pip install mpylab

To install directly from GitLab instead of PyPI, replace the last command with:

> python -m pip install git+https://gitlab.hrz.tu-chemnitz.de/chair-of-electromagnetic-theory-and-compatibility-at-tu-dresden/mpylab/mpylab.git

This requires git to be installed locally. A specific branch or tag can be selected by appending it after an @ sign.

Q:

How do I install Mpylab as a developer?

A:

Developers should install an editable version from the local Git repositories into a local virtual environment. A typical workflow with venv and pip looks like this:

> mkdir mpylab-develop
> cd mpylab-develop
> git clone https://gitlab.hrz.tu-chemnitz.de/chair-of-electromagnetic-theory-and-compatibility-at-tu-dresden/mpylab/mpylab.git
> git clone https://gitlab.hrz.tu-chemnitz.de/chair-of-electromagnetic-theory-and-compatibility-at-tu-dresden/mpylab/scuq.git
> mkdir venv-mpylab
> cd venv-mpylab
> python -m venv .venv
> source .venv/bin/activate
> python -m pip install --upgrade pip
> python -m pip install -e ../scuq
> python -m pip install -e ../mpylab
Q:

Where can I find documentation on Mpylab?

A:

The documentation is available online: (https://mpylab.readthedocs.io/en/latest/)

Q:

How do I contribute to MpyLab?

A:

If you are a registered contributor, you simply push to the repository. Otherwise, you have to create a pull-request. See the github documentation for more details (https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request).

Q:

Why is Python used as the programming language?

A:

Python (http://www.python.org/) has several advantages:

  • It is easy to learn

  • It is well documented

  • It is free

  • It runs on many platforms

  • There are many modules that are ideal for scientific calculations, measurement tasks, and graphical data output

Q:

Which version of Python should be used?

A:

Python version 3.8 or higher should be used.

Q:

Which editor should be used?

A:

Mainly, this is a matter of preference. An overview of Python development environments can be found here, for example: (https://wiki.python.org/moin/IntegratedDevelopmentEnvironments). Popular IDEs are PyCharm (https://www.jetbrains.com/pycharm/) or Visual Studio Code (https://code.visualstudio.com/).

Q:

Which encoding should be used?

A:

The standard is UTF-8 (8-bit Unicode Transformation Format).

Q:

Which debugger should you use?

A:

Python includes its own debugger, pdb (https://docs.python.org/3/library/pdb.html). The debuggers integrated into popular IDEs are at least as good.

Q:

What other packages are required?

A:

The dependencies can be found in the file requirements.txt (https://github.com/hgkdd/Mpy/blob/main/requirements.txt).

Q:

How can I test changes without compromising the stability of the stable version?

A:

MpyLab should always be installed in a virtual environment. This can be done (for example) as follows:

/home/USER/dev/test % git clone https://gitlab.hrz.tu-chemnitz.de/chair-of-electromagnetic-theory-and-compatibility-at-tu-dresden/mpylab/mpylab.git
/home/USER/dev/test % git clone https://gitlab.hrz.tu-chemnitz.de/chair-of-electromagnetic-theory-and-compatibility-at-tu-dresden/mpylab/scuq.git
/home/USER/dev/test % mkdir venv-mpy-develop
/home/USER/dev/test % cd venv-mpy-develop
/home/USER/dev/test/venv-mpy-develop % python -m venv .venv
/home/USER/dev/test/venv-mpy-develop % source .venv/bin/activate
(venv-mpy-develop) /home/USER/dev/test/venv-mpy-develop % python -m pip install --upgrade pip
(venv-mpy-develop) /home/USER/dev/test/venv-mpy-develop % python -m pip install -e ../scuq
(venv-mpy-develop) /home/USER/dev/test/venv-mpy-develop % python -m pip install -e ../mpylab
(venv-mpy-develop) /home/USER/dev/test/venv-mpy-develop %

Changes to the source files in /home/USER/dev/test/mpylab and /home/USER/dev/test/scuq are then automatically available in venv. Tested changes should then be imported into the central Git repository.

Q:

How do I get the source code?

A:

MpyLab and scuq (and more) are available on GitLab TU Chemnitz (https://gitlab.hrz.tu-chemnitz.de/chair-of-electromagnetic-theory-and-compatibility-at-tu-dresden/mpylab).