Python library with methods to generate, process, analyze, and plot energy related timeseries.
Project description
enlopy is an open source python library with methods to generate, process, analyze, and plot energy related timeseries.
While it can be used for any kind of data it has a strong focus on those that are related with energy i.e. electricity/heat demand or generation, prices etc. Thus, the methods included here are carefully selected to fit in that context and it had been gathered generalized and encapsulated during the last years while working on different research studies.
The aim is to provide a higher level API than that that is already available in commonly used scientific packages (pandas, numpy, scipy) in order to facilitate analysis and processing of energy load timeseries that can be used for models and statistical analysis. In some cases it is just a convenience wrapper of common packages just as pandas and in other cases it implements methods or statistical models found in literature.
It consists of four modules that include among others the following:
Analysis: Overview of descriptive statistics, reshape, load duration curve, climacogram, and other statistics
Plot: 2d heatmap, 3d plot, boxplot, rugplot
Generate: generate from daily and monthly profiles, from sinusoidal function, from given load duration curve, from given PSD, add noise, correlated load, gen analytical load duration curve
Statistics: Feature extraction from timeseries as done by other popular packages. The features selected are relevant with the energy context. Useful when coupled with machine learning packages.
Since there are numerous libraries around that deal with regression and prediction (e.g. ARIMA, state-space etc.) you will not find something here.
Example
>>> import enlopy as el
>>> Load = np.random.rand(8760)
>>> eload = el.clean_convert(Load)
>>> el.gen_load_sinus().... #TODO
>>> el.plot_heatmap(eload, x='day', y='month', aggfunc='mean')
>>> el.plot_percentiles(eload)
>>> el.plot_rug(eload)
More examples can be found in this jupyter notebook.
Install
Currently you can find the latest version in pypi so you can install with:
pip install enlopy
If you just want to download the latest version from git for use or development purposes:
git clone https://github.com/kavvkon/enlopy.git
cd enlopy
conda env create # Automatically creates environment based on environment.yml
pip install . # Install local version
It should be ready to run out of the box for anyone that has anaconda distribution installed. The only dependencies required to use enlopy are the following:
Contribute
If you think you can contribute with new relevant methods that you are currently using or improve the code in any way, feel free to contact me, fork the repository and send your pull requests.
Citing
If you intend to use this code in an academic paper, please consider including a citation. Citation information in a variety of formats can be found on zenodo. enlopy has been already used for processing demand timeseries in this scientific paper: http://dx.doi.org/10.1016/j.apenergy.2016.08.077