enlopy


Nameenlopy JSON
Version 0.1 PyPI version JSON
download
home_pagehttps://github.com/kavvkon/enlopy
SummaryPython library with methods to generate, process, analyze, and plot energy related timeseries.
upload_time2024-02-05 20:49:26
maintainer
docs_urlNone
authorKonstantinos Kavvadias
requires_python>=3.9
licenseBSD-3-Clause
keywords energy timeseries statistics profile demand
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Python toolkit for energy load time series
==========================================

|pyversion| |anaconda| |license| |version_status| |githubci| |docs| |cover| |binder|

``enlopy`` is an open source python library with methods to generate,
process, analyze, and plot 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. The methods included here are carefully selected to
fit in that context and they 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 the one that is already
available in commonly used scientific packages (pandas, numpy, scipy).
This facilitates the analysis and processing of energy load timeseries
that can be used for modelling 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, extract daily archetypes (clustering), detect outliers
* ``Plot``: 2d heatmap, 3d plot, boxplot, rugplot, percentiles
* ``Generate``: generate from daily and monthly profiles, generate from sinusoidal function, sample from given load duration curve, or from given spectral distribution, add noise gaussian and autoregressive noise, generate correlated load profiles, fit to analytical load duration curve
* ``Statistics``: Feature extraction from timeseries for a quick overview of the characteristics of any load curve. Useful when coupled with machine learning packages.

The library is designed to be robust enough to accept a wide range of inputs (pd.Dataframe, pd.Series, np.ndarray, list)
This library is not focusing on regression and forecasting (e.g. ARIMA, state-space etc.), since there are numerous relevant libraries around.

Example
-------
Enlopy has a simple API and is easy to use see some example below:

>>>  # df is a pandas dataframe with an hourly DateTimeindex. Each column represents a different generation technology
>>> import enlopy as el
>>> el.plot_rug(df) # Plots a nice rugplot. Useful for dispatch results

.. image:: ./docs/_static/FR_dispatch_2017.png
   :scale: 60 %
   :alt: Dispatch plot for different generator types sorted by their intermittency.

>>> el.plot_LDC(df, zoom_peak=True) # Plots a cumulative Load Duration Curve with inset zoom plot 

.. image:: ./docs/_static/LDC_zoomed.png
   :scale: 60 %
   :alt: Load duration curve

Run the following code for some more examples:

.. code:: python

    >>> import numpy as np
    >>> import enlopy as el
    >>> Load = np.random.rand(8760)  # Create random vector of values
    >>> eload = el.make_timeseries(Load)  # Convenience wrapper around pandas timeseries

    >>> el.plot_heatmap(eload, x='day', y='month', aggfunc='mean')  # Plots 2d heatmap
    >>> el.plot_percentiles(eload)  # Plots mean and quantiles
    >>> el.get_load_archetypes(eload, plot_diagnostics=True)  # Splits daily loads in clusters (archetypes)
    >>> el.get_load_stats(eload, per=’m’)  # Get monthly load statistics
    >>> el.remove_outliers(eload, threshold=None, window=5, plot_diagnostics=True)  # Remove outliers and plot diagnostic

More examples can be found in `this jupyter notebook <https://github.com/kavvkon/enlopy/blob/master/notebooks/Basic%20examples.ipynb>`__. You can directly run an online interactive version of the notebook where you can explore all available features by clicking here |binder|.

Documentation
-------------
Detailed documentation is still under construction, but you can find an overview of the available methods here: http://enlopy.readthedocs.io/

Install
-------

The latest stable version exists in conda-forge and pypi. You can install it using `conda package manager <https://conda.io/en/latest/>`__ (recommended) by typing:

::

    conda install -c conda-forge enlopy

or if you prefer pypi

::

    pip install enlopy

Be aware that this library is still in conceptual mode, so the API may change in the upcoming versions.

It should be ready to run out of the box for anyone that has the
`anaconda distribution <https://www.anaconda.com/distribution/>`__
installed. The only dependencies required to use ``enlopy`` are the
following:

-  `numpy <http://numpy.org>`__
-  `scipy <http://scipy.org>`__
-  `pandas <http://pandas.pydata.org/>`__
-  `matpotlib <http://matplotlib.org/>`__

If you want to download the latest version from git for use or development purposes (assuming that you have anaconda installed):

.. code:: bash

    git clone https://github.com/kavvkon/enlopy.git
    cd enlopy
    conda env create  # Automatically creates environment based on environment.yml
    source activate enlopy
    pip install -e . # Install editable local version


Contribute
----------

My vision is to make this library a energy domain-specific wrapper that can be used for any kind of energy analysis or modelling.
If you think you can contribute with new relevant methods that you are
currently using or improve the code or documentation in any way, feel free to contact me,
fork the repository and send your pull requests.

Citing
------

If you use this library in an academic work, please consider citing it.

[1] K. Kavvadias, “enlopy: Python toolkit for energy load time series”, http://github.com/kavvkon/enlopy

``enlopy`` has been already used for processing demand timeseries in this scientific paper:
http://dx.doi.org/10.1016/j.apenergy.2016.08.077

.. |pyversion| image:: https://img.shields.io/pypi/pyversions/enlopy.svg
    :alt: Supported Python versions.
    :target: https://pypi.python.org/pypi/enlopy
.. |license| image:: https://img.shields.io/pypi/l/enlopy.svg
    :alt: BSD License
    :target: https://opensource.org/licenses/BSD-3-Clause
.. |version_status| image:: https://img.shields.io/pypi/v/enlopy.svg?style=flat
   :target: https://pypi.python.org/pypi/enlopy
.. |docs| image:: https://readthedocs.org/projects/enlopy/badge/
    :alt: Documentation
    :target: https://enlopy.readthedocs.io/en/latest/
.. |cover| image:: https://coveralls.io/repos/github/kavvkon/enlopy/badge.svg?branch=master
    :target: https://coveralls.io/github/kavvkon/enlopy?branch=master
.. |anaconda| image:: https://anaconda.org/conda-forge/enlopy/badges/version.svg
    :target: https://anaconda.org/conda-forge/enlopy
.. |binder| image:: https://mybinder.org/badge_logo.svg
    :target: https://mybinder.org/v2/gh/kavvkon/enlopy/master?filepath=notebooks%2FBasic%20examples.ipynb
.. |githubci| image:: https://img.shields.io/github/actions/workflow/status/kavvkon/enlopy/pythonpackage.yml
   :target: https://github.com/kavvkon/enlopy/actions

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/kavvkon/enlopy",
    "name": "enlopy",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "energy,timeseries,statistics,profile,demand",
    "author": "Konstantinos Kavvadias",
    "author_email": "kavvkon@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/b8/1e/bfc3afe9a63100cfa87c7104e30df9107c87be90a2fb0396bbd26a062816/enlopy-0.1.tar.gz",
    "platform": null,
    "description": "Python toolkit for energy load time series\n==========================================\n\n|pyversion| |anaconda| |license| |version_status| |githubci| |docs| |cover| |binder|\n\n``enlopy`` is an open source python library with methods to generate,\nprocess, analyze, and plot timeseries.\n\nWhile it can be used for any kind of data it has a strong focus on those\nthat are related with energy i.e. electricity/heat demand or generation,\nprices etc. The methods included here are carefully selected to\nfit in that context and they had been, gathered, generalized and\nencapsulated during the last years while working on different research\nstudies.\n\nThe aim is to provide a higher level API than the one that is already\navailable in commonly used scientific packages (pandas, numpy, scipy).\nThis facilitates the analysis and processing of energy load timeseries\nthat can be used for modelling and statistical analysis. In some cases it\nis just a convenience wrapper of common packages just as pandas and in\nother cases, it implements methods or statistical models found in\nliterature.\n\nIt consists of four modules that include among others the following:\n\n* ``Analysis``: Overview of descriptive statistics, reshape, load duration curve, extract daily archetypes (clustering), detect outliers\n* ``Plot``: 2d heatmap, 3d plot, boxplot, rugplot, percentiles\n* ``Generate``: generate from daily and monthly profiles, generate from sinusoidal function, sample from given load duration curve, or from given spectral distribution, add noise gaussian and autoregressive noise, generate correlated load profiles, fit to analytical load duration curve\n* ``Statistics``: Feature extraction from timeseries for a quick overview of the characteristics of any load curve. Useful when coupled with machine learning packages.\n\nThe library is designed to be robust enough to accept a wide range of inputs (pd.Dataframe, pd.Series, np.ndarray, list)\nThis library is not focusing on regression and forecasting (e.g. ARIMA, state-space etc.), since there are numerous relevant libraries around.\n\nExample\n-------\nEnlopy has a simple API and is easy to use see some example below:\n\n>>>  # df is a pandas dataframe with an hourly DateTimeindex. Each column represents a different generation technology\n>>> import enlopy as el\n>>> el.plot_rug(df) # Plots a nice rugplot. Useful for dispatch results\n\n.. image:: ./docs/_static/FR_dispatch_2017.png\n   :scale: 60 %\n   :alt: Dispatch plot for different generator types sorted by their intermittency.\n\n>>> el.plot_LDC(df, zoom_peak=True) # Plots a cumulative Load Duration Curve with inset zoom plot \n\n.. image:: ./docs/_static/LDC_zoomed.png\n   :scale: 60 %\n   :alt: Load duration curve\n\nRun the following code for some more examples:\n\n.. code:: python\n\n    >>> import numpy as np\n    >>> import enlopy as el\n    >>> Load = np.random.rand(8760)  # Create random vector of values\n    >>> eload = el.make_timeseries(Load)  # Convenience wrapper around pandas timeseries\n\n    >>> el.plot_heatmap(eload, x='day', y='month', aggfunc='mean')  # Plots 2d heatmap\n    >>> el.plot_percentiles(eload)  # Plots mean and quantiles\n    >>> el.get_load_archetypes(eload, plot_diagnostics=True)  # Splits daily loads in clusters (archetypes)\n    >>> el.get_load_stats(eload, per=\u2019m\u2019)  # Get monthly load statistics\n    >>> el.remove_outliers(eload, threshold=None, window=5, plot_diagnostics=True)  # Remove outliers and plot diagnostic\n\nMore examples can be found in `this jupyter notebook <https://github.com/kavvkon/enlopy/blob/master/notebooks/Basic%20examples.ipynb>`__. You can directly run an online interactive version of the notebook where you can explore all available features by clicking here |binder|.\n\nDocumentation\n-------------\nDetailed documentation is still under construction, but you can find an overview of the available methods here: http://enlopy.readthedocs.io/\n\nInstall\n-------\n\nThe latest stable version exists in conda-forge and pypi. You can install it using `conda package manager <https://conda.io/en/latest/>`__ (recommended) by typing:\n\n::\n\n    conda install -c conda-forge enlopy\n\nor if you prefer pypi\n\n::\n\n    pip install enlopy\n\nBe aware that this library is still in conceptual mode, so the API may change in the upcoming versions.\n\nIt should be ready to run out of the box for anyone that has the\n`anaconda distribution <https://www.anaconda.com/distribution/>`__\ninstalled. The only dependencies required to use ``enlopy`` are the\nfollowing:\n\n-  `numpy <http://numpy.org>`__\n-  `scipy <http://scipy.org>`__\n-  `pandas <http://pandas.pydata.org/>`__\n-  `matpotlib <http://matplotlib.org/>`__\n\nIf you want to download the latest version from git for use or development purposes (assuming that you have anaconda installed):\n\n.. code:: bash\n\n    git clone https://github.com/kavvkon/enlopy.git\n    cd enlopy\n    conda env create  # Automatically creates environment based on environment.yml\n    source activate enlopy\n    pip install -e . # Install editable local version\n\n\nContribute\n----------\n\nMy vision is to make this library a energy domain-specific wrapper that can be used for any kind of energy analysis or modelling.\nIf you think you can contribute with new relevant methods that you are\ncurrently using or improve the code or documentation in any way, feel free to contact me,\nfork the repository and send your pull requests.\n\nCiting\n------\n\nIf you use this library in an academic work, please consider citing it.\n\n[1] K. Kavvadias, \u201cenlopy: Python toolkit for energy load time series\u201d, http://github.com/kavvkon/enlopy\n\n``enlopy`` has been already used for processing demand timeseries in this scientific paper:\nhttp://dx.doi.org/10.1016/j.apenergy.2016.08.077\n\n.. |pyversion| image:: https://img.shields.io/pypi/pyversions/enlopy.svg\n    :alt: Supported Python versions.\n    :target: https://pypi.python.org/pypi/enlopy\n.. |license| image:: https://img.shields.io/pypi/l/enlopy.svg\n    :alt: BSD License\n    :target: https://opensource.org/licenses/BSD-3-Clause\n.. |version_status| image:: https://img.shields.io/pypi/v/enlopy.svg?style=flat\n   :target: https://pypi.python.org/pypi/enlopy\n.. |docs| image:: https://readthedocs.org/projects/enlopy/badge/\n    :alt: Documentation\n    :target: https://enlopy.readthedocs.io/en/latest/\n.. |cover| image:: https://coveralls.io/repos/github/kavvkon/enlopy/badge.svg?branch=master\n    :target: https://coveralls.io/github/kavvkon/enlopy?branch=master\n.. |anaconda| image:: https://anaconda.org/conda-forge/enlopy/badges/version.svg\n    :target: https://anaconda.org/conda-forge/enlopy\n.. |binder| image:: https://mybinder.org/badge_logo.svg\n    :target: https://mybinder.org/v2/gh/kavvkon/enlopy/master?filepath=notebooks%2FBasic%20examples.ipynb\n.. |githubci| image:: https://img.shields.io/github/actions/workflow/status/kavvkon/enlopy/pythonpackage.yml\n   :target: https://github.com/kavvkon/enlopy/actions\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "Python library with methods to generate, process, analyze, and plot energy related timeseries.",
    "version": "0.1",
    "project_urls": {
        "Homepage": "https://github.com/kavvkon/enlopy"
    },
    "split_keywords": [
        "energy",
        "timeseries",
        "statistics",
        "profile",
        "demand"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "68cbe4747fffdc05c097ef783069bd306d02a819bdb4be1bce790802f581c103",
                "md5": "11d1abc122bbe9b2388fa56bb9665b41",
                "sha256": "d54997facd7c788e1a8be6c97351ccc4d6d4f3469ef426181d6b698ce8b65f1c"
            },
            "downloads": -1,
            "filename": "enlopy-0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "11d1abc122bbe9b2388fa56bb9665b41",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 24189,
            "upload_time": "2024-02-05T20:49:24",
            "upload_time_iso_8601": "2024-02-05T20:49:24.167678Z",
            "url": "https://files.pythonhosted.org/packages/68/cb/e4747fffdc05c097ef783069bd306d02a819bdb4be1bce790802f581c103/enlopy-0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b81ebfc3afe9a63100cfa87c7104e30df9107c87be90a2fb0396bbd26a062816",
                "md5": "bf1d2d4eded9f45a1eaa140c39699ca3",
                "sha256": "df23ead4b235ba6b48462bd1d7aa8578cc2859e2f2db4f442f6adf859c779574"
            },
            "downloads": -1,
            "filename": "enlopy-0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "bf1d2d4eded9f45a1eaa140c39699ca3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 27921,
            "upload_time": "2024-02-05T20:49:26",
            "upload_time_iso_8601": "2024-02-05T20:49:26.074571Z",
            "url": "https://files.pythonhosted.org/packages/b8/1e/bfc3afe9a63100cfa87c7104e30df9107c87be90a2fb0396bbd26a062816/enlopy-0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-05 20:49:26",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "kavvkon",
    "github_project": "enlopy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "enlopy"
}
        
Elapsed time: 0.18866s