Skip to main content

A set of tools to manipulate and transform power, and energ timeseries data.

Project description

tests doc codecov PyPI latest release PyPI - Python Version Ruff Pandas Versions License - MIT

Pandas Logo  

energy_analysis_toolbox is a Python library designed to analyze and model power and energy time series. It provides a wide range of tools for processing time series, generating synthetic datasets, analyzing weather and thermosensitivity.

Features

  • Time Series Resampling and Feature Extraction: Includes utilities for manipulating and resampling energy-related time series data, making it easy to work with data from different sources.
  • Weather and Thermosensitivity Analysis: Tools for calculating degree days and assessing thermosensitivity.
  • Power Consumption Analysis: Detection of unusual power consumption patterns, and analyze load profiles.
  • Synthetic Data: Generation of synthetic time series energy datasets.
  • Integration with Pandas: Many utilities integrate seamlessly with pandas DataFrames, allowing to extend pandas with energy and power-specific tools through an accessor.

Installation

energy_analysis_toolbox can be installed from the repository or via pip. Ensure that you use Python 3.10 or above.

pip install energy-analysis-toolbox

Alternatively, you can clone this repository and install the dependencies directly:

git clone https://github.com/Eco-CO2/energy_analysis_toolbox
cd energy_analysis_toolbox
pip install .

Usage

The toolbox is structured into several modules, each handling a different aspect of energy data processing. Below is a quick example to get started.

Example: Resampling a time series and computing energy

import numpy as np
import pandas as pd
import energy_analysis_toolbox.pandas
import matplotlib.pyplot as plt

power = pd.Series(
    data=5*np.sin(np.linspace(0, 6, 100)) + np.random.randn(100) + 7,
    index=pd.date_range(start='2023-01-01', periods=100, freq='d'),
)
energy_resampled = power.eat.to_energy().eat.to_freq("1W")/3600000

fig, axes = plt.subplots(1, 2, figsize=(8, 3))
power.plot(ax=axes[0], ylabel="Power (W)", title="Power")
energy_resampled.plot(ax=axes[1], ylabel="Energy (kWh)", title="Weekly resampled energy")

demo_energy_resampling

Documentation

The complete documentation, including detailed guides for each module, API reference, and tutorials, can be found here.

To generate the documentation locally, you can run:

./generate_doc.sh

Tests

The Energy Analysis Toolbox comes with a comprehensive test suite that ensures code reliability and robustness. The tests cover a variety of scenarios including time series resampling, power overconsumption analysis, and synthetic data generation.

To run the tests, execute the following command:

./run_tests.sh

We use pytest for unit testing, which helps ensure that our code is reliable and that any modifications do not break existing functionality.

Contributing

This toolbox was originally developed by the R&D team of Eco CO2. It is now open to anyone who wants to contribute: whether it is a bug fix, a new feature, or improving documentation, we appreciate your help! To contribute:

  1. Fork the repository
  2. Create a new branch (git checkout -b feature-branch)
  3. Commit your changes (git commit -m 'Add new feature')
  4. Push to your branch (git push origin feature-branch)
  5. Create a pull request

Please make sure to add appropriate unit tests for any new code and verify all tests pass.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For questions, feature requests, or to report issues, please open an issue on the GitHub issue tracker.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

energy_analysis_toolbox-0.1.0.tar.gz (93.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

energy_analysis_toolbox-0.1.0-py3-none-any.whl (123.2 kB view details)

Uploaded Python 3

File details

Details for the file energy_analysis_toolbox-0.1.0.tar.gz.

File metadata

  • Download URL: energy_analysis_toolbox-0.1.0.tar.gz
  • Upload date:
  • Size: 93.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.0 CPython/3.9.20

File hashes

Hashes for energy_analysis_toolbox-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bbd8e96fd5dee5b46c0f23c242faefe8901251e1c1ef8ca61f2d5861519e9356
MD5 223ae55b12d392c241d51490da4a621f
BLAKE2b-256 6128192cdf334fd94abe5e9dba257c352f998f0ce1f4624d691887efeeca635f

See more details on using hashes here.

File details

Details for the file energy_analysis_toolbox-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for energy_analysis_toolbox-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9be796f52efa30c088d450bccb1f058368392c9ccc2cd471ba049fdbed3cdaac
MD5 c8cfe8ef7704b725bb68c802e1edea7f
BLAKE2b-256 12639cbc310a8c3f0b0b809d3e6809f680d2e4676344b73a3de22486ac7086fd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page