Library providing Python implementations of MODA's algorithms.
Project description
PyMODAlib
PyMODAlib is a Python library containing the algorithms used by PyMODA. With PyMODAlib, you can write Python scripts to perform the same calculations as PyMODA.
Some of PyMODAlib's algorithms are MATLAB-packaged libraries, while some are Python translations of algorithms belonging to MODA.
User Guide
This section describes how to use PyMODAlib in your Python scripts.
Installing PyMODAlib
PyMODAlib can be installed using pip
. Open a terminal and run:
pip install pymodalib
Tip: on macOS/Linux, replace
pip
with the correct command for your system (e.g.pip3
).
Updating PyMODAlib
PyMODAlib may be updated regularly. To update your installed version, open a terminal and run:
pip install -U pymodalib
Current status
PyMODAlib
is still early in development. Currently, the features implemented are:
- Detecting harmonics.
Examples
There are examples of using PyMODAlib's functionality in the examples directory.
To try an example, download the PyMODAlib repository as a zip file or by using git clone
, then run the code with Python as normal.
To download the dependencies required to run the examples, open a terminal and run:
pip install -U pymodalib matplotlib
The examples are independent of the actual PyMODAlib source code; they just import the PyMODAlib installed via pip
.
License
You may use, distribute and modify this software under the terms of the GNU General Public License v3.0. See LICENSE.
Developer guide
This guide is aimed at developers interested in contributing to PyMODAlib.
Developing PyMODAlib
When developing PyMODAlib, you can test your changes by installing the library locally in "editable" mode. From the root of the repository, run:
pip install -e .
Note: After making changes to PyMODAlib, you don't need to run the
pip install
command again. Any Python script which usesimport pymodalib
will reflect the changes immediately.
Switching back to the release version of PyMODAlib is simple:
pip uninstall pymodalib -y
pip install -U pymodalib
Project structure
The public-facing API is located in the algorithms
package. This package contains wrappers for the actual implementations, which can be found in the implementations
package.
This structure allows the implementation to be easily changed, while ensuring that the API remains backwards-compatible.
Implementations
The implementations
package contains a matlab
package and a python
package. The matlab
package contains wrappers for algorithms supplied by MATLAB-packaged libraries, while the python
package contains algorithms implemented purely in Python.
MATLAB-packaged libraries
Currently, the MATLAB-packaged libraries are not required if functionality that depends on them is not used. MATLAB-packaged libraries are installed by downloading PyMODA and installing its dependencies.
Functions that require the MATLAB Runtime will be marked with the matlabwrapper
decorator. This will check if the correct version of the MATLAB Runtime is installed.
Note: MATLAB libraries are still incompatible with Python 3.8. When MATLAB R2020a releases, Python 3.8 support will be added but the current required version of the MATLAB Runtime will no longer be supported (users will need to upgrade to the newer Runtime).
Packaging the project
This section describes how to publish an update to PyPI.
From the documentation:
rm -r dist/
python setup.py sdist
python setup.py bdist_wheel
twine upload dist/*
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 Distribution
Built Distribution
Hashes for PyMODAlib-0.3.0b1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e783ebb21d54c446b78c6516249778ed2c30c141424b02d33af65d6db1d7880 |
|
MD5 | d00f2074ce063b7b635cf288ba98caa0 |
|
BLAKE2b-256 | ebc8c4c0a00323681c38adf5580a968c37cb6ab2df6803a1ac7e47b5f4d42017 |