Skip to main content

Data model for energy modelling.

Project description

EnergyDataModel

🔋 Represent energy systems as Python data classes for improved modularity and readability

License: MIT PyPI version Join us on Slack All Contributors GitHub Repo stars

EnergyDataModel provides an open-source, Python-based data model that enables energy data scientists and modellers to write more modular and readable code. EnergyDataModel lets you:

  • 🧱 Modularity - Represent energy assets, energy systems and other relevant concepts as object-oriented building blocks;
  • 🏗️ Relationships - Structure your energy assets in graphs and hierarchies representing energy systems that can be serialized to files (e.g. .csv, .json, and .geojson files);
  • 👀 Visualization - Visualise energy systems maps, graphs, flows and structure using built-in plotting functions;
  • 🤓 Readability - Write more explicit Python code through human-readable expressions and built-in convenience methods;
  • 🧩 Interoperability - Convert data format to other energy-relevant data models and ontologies; and
  • 💬 Communicate - Communicate effectively in teams with a common energy system data vocabulary.

⬇️ Installation  |  📖 Documentation  |  🚀 Try out now in Colab  |  👋 Join Slack Community

Modules and Data Classes

EnergyDataModel leverages Python's Data Classes to represent energy assets as Python objects. The table below gives a summary of the available modules and data classes.

Module Data Classes
🗺️ geospatial GeoLocation, GeoLine, GeoPolygon, GeoMultiPolygon, GeoGraph
📈 timeseries ElectricityDemand, ElectricitySupply, HeatingDemand, HeatingSupply, ElectricityPrice, CarbonIntensity,
☀️ solar FixedMount, SingleAxisTrackerMount, PVArray, PVSystem, SolarPowerArea
🌬️ wind WindTurbine, WindFarm, WindPowerArea
🔋 battery Battery
💦 hydro Reservoir, HydroTurbine, HydroPowerPlant
♻️ heatpump HeatPump
⚡ powergrid Carrier, Bus, Line, Transformer, Link, SubNetwork, Network,

Explore the data model visually here.
Read the full documentation here.

Purpose and Philosphy

The aim of EnergyDataModel is to provide the energy data and modelling community with a Python-based open-source tool to enable improvement of software engineering aspects like code quality, maintainability, modularity, reusability and interoperability. We believe that bringing more rigorous software engineering practices to the energy data community has the potential to radically improve productivity, collaboration and usefulness of software tools, utimately leading to better energy decisions.

Our philosophy is aligned on usefulness and practicality over maximizing execution performance or some kind of esoteric theoretical rigor. A well-know quote by Abelson & Sussman comes to mind:

"Programs [software] are meant to be read by humans and only incidentally for computers to execute"

Making code explicit, readable and intuitive counts.

If you are interested in joining our mission to build open-source tools that improve productiveness and workflow of energy modellers worldwide - then join our Slack!

Basic usage

Create an energy system made up of two sites with co-located solar, wind and batteries and save as a JSON-file.

import energydatamodel as edm

pvsystem_1 = edm.PVSystem(capacity=2400, surface_azimuth=180, surface_tilt=25)
windturbine_1 = edm.WindTurbine(capacity=3200, hub_height=120, rotor_diameter=100)
battery_1 = edm.Battery(storage_capacity=1000, min_soc=150, max_charge=500, max_discharge=500)

site_1 = edm.Site(assets=[pvsystem_1, windturbine_1, battery_1],
                  latitude=46, 
                  longitude=64)

pvsystem_2 = edm.PVSystem(capacity=2400, surface_azimuth=180, surface_tilt=25)
windturbine_2 = edm.WindTurbine(capacity=3200, hub_height=120, rotor_diameter=100)
battery_2 = edm.Battery(storage_capacity=1000, min_soc=150, max_charge=500, max_discharge=500)

site_2 = edm.Site(assets=[pvsystem_2, windturbine_2, battery_2],
                  latitude=51, 
                  longitude=58)

portfolio = edm.Portfolio(sites=[site_1, site_2])

portfolio.to_json()

For more examples on usage and applications of EnergyDataModel see the documentation examples page here.

Installation

We recommend installing using a virtual environment like venv, poetry or uv.

Install the stable release:

pip install energydatamodel

Install the latest release:

pip install git+https://github.com/rebase-energy/EnergyDataModel.git

Install in editable mode for development:

git clone https://github.com/rebase-energy/EnergyDataModel.git
cd EnergyDataModel
pip install -e .[dev] 

Ways to Contribute

We welcome contributions from anyone interested in this project! Here are some ways to contribute to EnergyDataModel:

  • Add a new energy system assets and concepts;
  • Propose updates to existing energy assets and concepts;
  • Create a converter to new data format; or
  • Create a converter to another energy data model.

If you are interested in contributing, then feel free to join our Slack Community so that we can discuss it. 👋

Contributors

This project uses allcontributors.org to recognize all contributors, including those that don't push code.

Sebastian Haglund
Sebastian Haglund

💻
Nelson
Nelson

🤔

Licence

This project uses the MIT Licence.

Acknowledgement

The authors of this project would like to thank the Swedish Energy Agency for their financial support under the E2B2 program (project number P2022-00903)

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

energydatamodel-0.0.4.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

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

energydatamodel-0.0.4-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file energydatamodel-0.0.4.tar.gz.

File metadata

  • Download URL: energydatamodel-0.0.4.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for energydatamodel-0.0.4.tar.gz
Algorithm Hash digest
SHA256 40a5c442668aef50802670e5a2a32c307474fe4ec3393d1ee67fc1fee2fa93bc
MD5 145f377bacfd92749fa989db00ec14f6
BLAKE2b-256 fad9f4c2d272472f1e973581ed76ea463c8cc39428f5625a0f73a02a64778ca8

See more details on using hashes here.

File details

Details for the file energydatamodel-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for energydatamodel-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 771851358867eac146cf60d861b4628c477bbedad8c7c83d6716d1424c644021
MD5 0ccafdbafb6836dde15ae3214b31d6f4
BLAKE2b-256 d38fb43af80d589bd48c43ada1180921c8e1bef5c6db1d7fb99e628e9f555d7d

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