Skip to content

A python library for calculations perfomed in electronics engineering

License

Notifications You must be signed in to change notification settings

tobias-haueter/UliEngineering

 
 

Repository files navigation

UliEngineering

Unit tests Codacy Badge Code Climate coverage Code Climate License

A Python3 library for: - Data science - Electronics Engineering - Specialized algorithms - Physics which contains a collection of functions I haven't found elsewhere. Some algorithms have also been accepted on my blog https://techoverflow.net/

Pull requests and bugreports of any kind are happily accepted.

Installation

Run this command on your favourite shell:

sudo pip3 install UliEngineering

In order to install the latest bleeding-edge version, use:

sudo pip3 install git+https://github.com/ulikoehler/UliEngineering.git

We highly recommend you also install scipy:

sudo pip3 install scipy

(you can also use sudo apt install python3-scipy on Debian-based Linux distros).

While scipy is technically optional and listed as an optional dependency, many UliEngineering modules can't be used without it, including (might not be complete!):

  • UliEngineering.Length
  • UliEngineering.SignalProcessing.Interpolation
  • UliEngineering.SignalProcessing.Correlation
  • UliEngineering.Physics.JohnsonNyquistNoise
  • Some functions in UliEngineering.SignalProcessing.Simulation
  • Some functions in UliEngineering.SignalProcessing.Selection

After that you can use UliEngineering from any Python3 instance. Example:

$ python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from UliEngineering.EngineerIO import *
>>> format_value(0.015, "V")
'15.0 mV'

Getting started

On my blog, I've posted several easy-to-use examples on how to solve real-world problems using UliEngineering:

- [Normalizing electronics engineering value notations using Python](https://techoverflow.net/2015/06/09/normalizing-electronics-engineering-value-notations-using-python/)
- [Finding the nearest E96 resistor value in Python](https://techoverflow.net/2015/05/19/finding-the-nearest-e96-resistor-value-in-python/)
- [Easy zero crossing detection in Python using UliEngineering](https://techoverflow.net/2018/12/31/easy-zero-crossing-detection-in-python-using-uliengineering/)
- [Easily generate sine/cosine wave test data in Python using UliEngineering](https://techoverflow.net/2018/12/31/easily-generate-sine-cosine-wave-data-in-python-using-uliengineering/)
- [Easily generate square/triangle/sawtooth/inverse sawtooth waveform data in Python using UliEngineering](https://techoverflow.net/2018/12/31/easily-generate-square-triangle-sawtooth-inverse-sawtooth-waveform-data-in-python-using-uliengineering/)
- [Easily compute & visualize FFTs in Python using UliEngineering](https://techoverflow.net/2018/12/31/easily-compute-visualize-ffts-in-python-using-uliengineering/)
- [Computing resistor power dissipation in Python using UliEngineering](https://techoverflow.net/2019/05/09/computing-the-temperature-under-load-of-your-electronics-components-in-python-using-uliengineering/)
- [Computing crystal load capacitance using Python & UliEngineering](https://techoverflow.net/2019/05/10/computing-crystal-load-capacitance-using-python-uliengineering/)
- [How to convert Celsius/Fahrenheit/Kelvin temperatures in Python using UliEngineering](https://techoverflow.net/2019/05/10/how-to-convert-celsius-fahrenheit-kelvin-temperatures-in-python-using-uliengineering/)
- [How to get unit/resolution of NumPy np.timedelta64 object](https://techoverflow.net/2019/05/13/how-to-get-unit-resolution-of-numpy-np-timedelta64-object/)
- [How to get unit/resolution of NumPy np.datetime64 object](https://techoverflow.net/2019/05/13/how-to-get-unit-resolution-of-numpy-np-datetime64-object/)
- [How to iterate all days of year using Python](https://techoverflow.net/2019/05/16/how-to-iterate-all-days-of-year-using-python/)
- [How to get number of days in month in Python](https://techoverflow.net/2019/05/16/how-to-get-number-of-days-in-month-in-python/)
- [How to compute candelas from lumens by apex angle](https://techoverflow.net/2019/08/19/lumen-to-candela-online-calculator-python-code/)
- [How to compute resistor voltage divider ratio using Python](https://techoverflow.net/2021/12/16/how-to-compute-resistor-voltage-divider-ratio-using-python/)
- [How to generate datetime for every hour on a given day in Python](https://techoverflow.net/2022/06/19/how-to-generate-datetime-for-every-hour-on-a-given-day-in-python/)
- [How to generate datetime for every minute on a given day in Python](https://techoverflow.net/2022/06/19/how-to-generate-datetime-for-every-minute-on-a-given-day-in-python/)
- [How to generate datetime for every second on a given day in Python](https://techoverflow.net/2022/06/19/how-to-generate-datetime-for-every-second-on-a-given-day-in-python/)

Testing

In order to run the unit tests, first install tox:

pip install --user tox

and then just run it in the root directory of the cloned repository

tox

About

A python library for calculations perfomed in electronics engineering

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%