Welcome to DynamicistToolKit’s documentation!

Contents:

DynamicistToolKit

PyPi

https://img.shields.io/pypi/v/DynamicistToolKit.svg https://pepy.tech/badge/DynamicistToolKit

Anaconda

https://anaconda.org/conda-forge/dynamicisttoolkit/badges/version.svg https://anaconda.org/conda-forge/dynamicisttoolkit/badges/downloads.svg

Documentation

https://readthedocs.org/projects/dynamicisttoolkit/badge/?version=stable

Continous Integration

https://github.com/moorepants/DynamicistToolKit/actions/workflows/test.yml/badge.svg

Introduction

This is a collection of Python modules which contain tools that are helpful for a dynamics. We use it at the TU Delft Bicycle Lab as an initial shared location to house reusable tools for the group. These tools may eventually graduate to packages of their own or be incorporated into other existing specialized packages.

Modules

bicycle

Generic tools for basic bicycle dynamics analysis.

control

Functions helpful in control systems analysis.

inertia

Various functions for calculating and manipulating inertial quantities.

process

Various tools for common signal processing tasks.

Installation

You can install DynamicistToolKit with conda:

$ conda install -c conda-forge dynamicisttoolkit

or pip:

$ python -m pip install DynamicistToolKit

Or download the source with your preferred method and install manually.

Using Git:

$ git clone git@github.com:moorepants/DynamicistToolKit.git
$ cd DynamicistToolKit

Or wget:

$ wget https://github.com/moorepants/DynamicistToolKit/archive/master.zip
$ unzip master.zip
$ cd DynamicistToolKit-master

Then for basic installation:

$ python setup.py install

Or install for development purposes:

$ python setup.py develop

Tests

Run the unit tests with pytest:

$ pytest dtk

and doctests with:

$ pytest --doctest-modules dtk

Documentation

The documentation is hosted at ReadTheDocs:

http://dynamicisttoolkit.readthedocs.org

You can build the documentation if you have Sphinx and numpydoc:

$ cd docs
$ make html
$ firefox _build/html/index.html

To locally build on Windows, open an Anaconda prompt (the base environment has sphinx and numpydoc installed), navigate to the DynamicistToolKit directory and execute:

$ cd docs
$ make.bat html
$ start "" ".\_build\html\index.html"

Contributing

The name of this distribution is “DynamicistToolKit” but it is best to think of it as a shared collection of tested tools for the TU Delft Bicycle Lab. Our primary audience is ourselves, but since this is public it may garner other users if we make anything more broadly useful. So most anything useful to the science and engineering we do can go in here. Secondly, think of this as a first location to graduate useful tools you have written for your own research.

There are several guidelines we should follow to ensure we can use this as a shared dependency in our work:

  1. Do not change input/output behavior of any function, method, or class if it has been released (version pushed to PyPi & Conda Forge).

  2. If you absolutely have to change input/ouput behavior then, first, consider making a new function with your desired behavior or, secondly, deprecate the function for at least 1 year and at least 1 version release with a deprecation warning.

  3. If a function produces the incorrect (mathematical) result you may change the output without deprecation (in general).

  4. Functions, methods, classes, modules that start with a single underscore _ are considered private and you may change the input/output behavior. Everything else is considered public and the API is frozen when we release the software.

  5. All additions must include docstrings with at least one example of use and enough unit tests to protect against regressions, i.e. ensure that the input/output API cannot be changed without tests failing.

If we follow these basic guidelines we should have a relatively stable tool that we can all use and not worry about our code breaking when others do work on it.

Release Notes

0.6.1

  • Include make.bat in the source tarball.

  • Make compatible with NumPy 2.0. [PR #53]

0.6.0

  • Drop support for Python <3.8 and bumped dependency versions to match Ubuntu 22.04. [PR #40]

  • Changed the correction factor in butterworth to a digital filter correction instead of the prior used analog factor (backwards incompatible output). [PR #43]

  • Add new functions pow_spectrum and cumulative_power_spectrum. [PR #45]

  • Switched testing framework from nose (fails on Python 3.12) to pytest. [PR #46]

  • Display the control module functions in the Sphinx documentation. [PR #47]

  • Removed numpy.matrix in favor of numpy.array, which may lead to possible backwards incompatible outputs.

  • Added examples to all functions with doctests and improved docstring quality.

  • Repaired some functions to actually produce what they were designed to produce with the new dependencies (there was some rather archaic plotting code mostly).

  • Switched CI from Travis to Github Actions.

  • Removed old Vagrant based installation options.

0.5.3

  • Added the license and readme to the source distriubtion.

0.5.2

  • Screwed up pypi upload on 0.5.1, so bumping one more time.

0.5.1

  • Import nanmean from numpy instead of scipy and fix float slices. [PR #34]

0.5.0

  • bicycle.py functions now output numpy arrays instead of matrices.

  • Support for Python 3 [PR #30 and #32].

0.4.0

  • Made the numerical derivative function more robust and featureful. [PR #27]

  • butterworth now uses a corrected cutoff frequency to adjust for the double filtering. [PR #28]

0.3.5

  • Fixed bug in coefficient_of_determination. [PR #23]

0.3.4

  • Fixed bug in normalized cutoff frequency calculation. [PR #21]

0.3.2

  • Fixed bug in butterworth function and added tests.

0.3.1

  • Fixed butterworth to work with SciPy 0.9.0. [PR #18]

0.3.0

  • Removed pandas dependency.

  • Improved time vector function.

  • Removed gait analysis code (walk.py), now at http://github.com/csu-hmc/Gait-Analysis-Toolkit.

  • TravisCI tests now run, added image to readme.

  • Added documentation at ReadTheDocs.

0.2.0

  • Addition of walking dynamics module.

0.1.0

Indices and tables