Skip to main content

No project description provided

Project description

PyZefir

Pyzefir is used to build and configure a specific class of mathematical optimization models that represent a given energy system. This System is clearly defined by identifying sources, transmission infrastructure and energy customers. The processes provided in the model are the acquisition, transfer and processing of various types of energy to meet the needs of consumers.

In the model, we distinguish between the supply side (energy sources) and the demand side (energy consumers). The key relationship that must occur in the model is the balance relation, which assumes that in each analyzed hour the volume of energy supplied to customers is equal to their energy demand.

The tool aims to find the solution of the optimization by determining how – with the given scenario assumptions – the technological structure of the given energy system will change over the next years. Subjects to optimize are the total cost of maintenance (operating costs), modernization (investment costs) and operation (variable costs) of a given energy system.

The elements of the energy system represented in the tool are energy carriers, energy sources, energy storage facilities, transmission infrastructure elements and energy consumers.

Pyzefir module

Install repository from global pip index

pip install pyzefir

Make setup

Check if make is already installed

make --version

If not, install make

sudo apt install make

Make stages

Install virtual environment and all dependencies

make install

Run linters check (black, pylama)

make lint

Run unit and fast integration tests (runs lint stage before)

Make unit

Run integration tests (runs lint and unit stages before)

make test

Remove temporary files such as .venv, .mypy_cache, .pytest_cache etc.

make clean

Creating project environment

You can create virtual environment using make:

make install

or manually:

# Create and source virtual Environment
python -m venv .venv
source .venv/bin/active

# Install all requirements and dependencies
pip install .
pip install .[dev]

# Init pre-commit hook
pre-commit install

Preparation of input data

Run input structure creator

structure-creator --help

Usage: structure-creator [OPTIONS]
Options:
  -i, --input_path PATH     Input data for the creator.  [required]
  -o, --output_path PATH    Path to dump the results.  [required]
  -s, --scenario_name TEXT  Name of the scenario.  [required]
  -h, --n_hours INTEGER     N_HOURS constant.
  -y, --n_years INTEGER     N_YEARS constant.
  --help                    Show this message and exit.

E.g.

structure-creator -i pyzefir\resources\structure_creator_resources -o pyzefir\results -s base_scenario -h 8760 -y 20

How structure creator resources directory must look like:

.
└── structure_creator_resources/
    ├── cap_range/
    │   ├── cap_base.xlsx
    │   ├── cap_max.xlsx
    │   └── cap_min.xlsx
    ├── lbs/
    │   ├── boiler_coal_new_lkt.json
    │   ├── boiler_gas_lkt.json
    │   └── ...
    ├── scenarios/
    │   └── base_scenario/
    │       ├── fractions/
    │       │   ├── boiler_coal_new_lkt.xlsx
    │       │   ├── boiler_gas_lkt.xlsx
    │       │   └── ...
    │       ├── cost_parameters.xlsx
    │       ├── fuel_parameters.xlsx
    │       ├── n_consumers.xlsx
    │       ├── relative_emission_limits.xlsx
    │       ├── technology_cap_limits.xlsx
    │       ├── technology_type_cap_limits.xlsx
    │       └── yearly_demand.xlsx
    ├── subsystems/
    │   ├── heating_subsystem.json
    │   └── kse_subsystem.json
    ├── aggr_types.json
    ├── configuration.xlsx
    ├── emission_fees.json
    └── global_techs.json

Simulation run

  1. Prepare config.ini file (look at config_example.ini file in project directory)

:information_source: The section create of config.ini file is used for structure creator only, so if you're not going to use structure-creator do not add the section.

  1. Run pyzefir
pyzefir --help

Usage: pyzefir [OPTIONS]
Options:
  -c, --config PATH  Path to *.ini file.  [required]
  --help             Show this message and exit.

E.g.

pyzefir -c pyzefir/config_basic.ini

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

pyzefir-0.3.1.tar.gz (139.3 kB view details)

Uploaded Source

Built Distribution

pyzefir-0.3.1-py3-none-any.whl (237.9 kB view details)

Uploaded Python 3

File details

Details for the file pyzefir-0.3.1.tar.gz.

File metadata

  • Download URL: pyzefir-0.3.1.tar.gz
  • Upload date:
  • Size: 139.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pyzefir-0.3.1.tar.gz
Algorithm Hash digest
SHA256 7207612a2939e0137a15c4c88a9c12194c093d77f411d06355aca6567ca66aa4
MD5 6af120dd576d207589379ec82ede2234
BLAKE2b-256 a257a62b4d18a799935725130b4d944bf0aabd000ba143cd345c2f218282760c

See more details on using hashes here.

File details

Details for the file pyzefir-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: pyzefir-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 237.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pyzefir-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 05b3ec3521a00687aaa497d91b67858d4fe2c638f8e820857bafaea1b8988386
MD5 cab5d23b29ee28e5a9e8bfd11d5752b0
BLAKE2b-256 30d5c116559da8840aaa513c0f161b73e38ec37dcbadd9f2a607b7904b214f5d

See more details on using hashes here.

Supported by

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