Metadata-Version: 2.4
Name: peakshaving-analyzer
Version: 0.0.2
Summary: Peak shaving analysis for industrial load profiles
Author-email: Christoph Komanns <c.komanns@gmail.com>, Florian Maurer <fmaurer@disroot.org>
License-Expression: MIT
Project-URL: Issues, https://github.com/assume-framework/assume/issues
Project-URL: Repository, https://github.com/NOWUM/peakshaving-analyzer
Keywords: peak shaving,energy framework,energy optimization,optimization
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.26.4
Requires-Dist: python-dateutil>=2.8.2
Requires-Dist: sqlalchemy>=2.0.9
Requires-Dist: pandas>=2.0.0
Requires-Dist: psycopg2-binary>=2.9.5
Requires-Dist: pyyaml>=6.0
Requires-Dist: pyyaml-include>=2.2a
Requires-Dist: fine>=2.4.1
Requires-Dist: pyomo>=6.8.0
Requires-Dist: pgeocode>=0.5.0
Requires-Dist: highspy
Requires-Dist: gurobipy
Provides-Extra: dev
Requires-Dist: ruff>=0.11.5; extra == "dev"
Requires-Dist: build>=1.2.2; extra == "dev"
Dynamic: license-file

# Peak Shaving Analyzer

This repository contains tools and utilities for analyzing and optimizing energy consumption with peak shaving strategies. The project includes data fetching, analysis, and visualization components, as well as Docker configurations for deployment.

## Table of Contents

- [Overview](#overview)
- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Examples](#examples)
- [License](#license)

## Overview

Peak shaving is a strategy to reduce energy costs by minimizing peak demand utilizing energy storage systems. This project provides tools to optimize a given consumption time series with peak-shaving reducing capacity costs and visualizing results using Grafana.

## Features

- Peak shaving optimization using [FINE by FZJ](https://github.com/FZJ-IEK3-VSA/FINE)
- Easy configuration of many parameters
- Support for dynamic prices
- Inclusion of PV system integration with automatic retrieving of generation timeseries depending on location (with detection for leap years)
- Dockerized deployment with Grafana dashboards
- Example configurations for various scenarios

## Installation

You can install peakshaving-analyzer using pip. Choose the appropriate installation method based on your needs:

### Using pip

To install the core package:

```bash
pip install peakshaving-analyzer
```

### Timescale Database and Grafana Dashboards

If you want to benefit from a supported database and integrated Grafana dashboards for scenario analysis, you can use the provided Docker Compose file.

Follow these steps:

1. Clone the repository and navigate to its directory:

```bash
git clone https://github.com/NOWUM/peakshaving-analyzer.git
cd peakshaving-analyzer
```

2. Start the database and Grafana using the following command:

```bash
docker compose up -d
```

This will launch a container for TimescaleDB and Grafana with preconfigured dashboards for analysis. You can access the Grafana dashboards at `http://localhost:3000`.

## Usage

```
from peakshaving_analyzer import Config, PeakShavingAnalyzer


config = Config("/path/to/your/config/file.yml")
psa = PeakShavingAnalyzer(config=config)
```

The optimization can be adjusted by changing values in the `config.yml` file.

If you're connecting to your own database either create the predefined tables or set `overwrite_existing_optimization` to `False` on the first optimization.

## Examples

In the `examples` directory are four examples:
* A scenario examining only a storage system using hourly values with a fixed, non-dynamic price for the used energy.
* A scenario examining only a storage system using quarterhouly values with a fixed, non-dynamic price for the used energy.
* A scenario examining only a storage system using quarterhourly values with a dynamic, time-depended price for the used energy.
* A scenario examining a storage system as well as a photovoltaic system using hourly values with a dynamic, time-depended price for the used energy.

You can run these examples with `python3 ./examples/example/main.py` from the base directory.

## License

This project is licensed under the terms of the LICENSE file.
