Energy Modeling Technology Data
This tool provides a slim Python wrapper to access the "technology-data" data set / Snakemake workflow, maintained by the PyPSA team.
🚨 🚨 Please check the license of the
technology-datarepo, especially regarding the applicable licences of various input (and therefore output) data files. Additional info can be found starting at 74 and 87. Be aware that this wrapper can in no way guarantee that the data being pulled from the repository, or the way that is being processed, or the code retrieved from the repository, or any related information is in accordance with applicable licenses.
Getting Started
In an existing environment
Use the tool of your choice, for example uv, to add emtd to your environment:
uv add emtd
In a new environment
The following example assumes that you are using uv. Other ways should work in a similar fashion.
First setup a new environment:
uv venv
Then activate it:
Windows:
.venv\Scripts\activate
Linux:
source .venv/bin/activate
And finally add emtd to your environment:
uv add emtd
Basic usage
Now you can run the following examplatory code:
from emtd import EMTD
# Use `./tmpdir` to store intermediate results.
data = EMTD(target_dir="tmpdir")
# Get all available technologies in 2030.
data.technologies(2030)
# Get all available parameters for the technology "solar" in 2030.
data.parameters(2030, "solar")
# Get the "lifetime" of "solar" in 2030.
res = data.get(2030, "solar", "lifetime")
# Try out:
res["value"]
res["unit"]
res["source"]
Reproducibility
To make sure everyone using your code will get the same results from emtd, it is advised to fix the data set to a
specific version. Consult the release page for available versions,
then make sure to initialize using (e.g.):
data = EMTD(target_dir="tmpdir", version="v0.6.2")
Make sure to include the v in the version string. Passing "latest" will put you on the current latest version of the
technology data repository. Be aware that this can change anytime, and the next time you initialize emtd, it will try
to update.
Logging
To get more information about what is happening, you can change the default logging level, by adding the following code:
import logging
logging.basicConfig(level=logging.INFO)
Configuring the Snakemake workflow
To change parameters in the Snakemake workflow, pass a dict to EMTD:
data = EMTD(target_dir="tmpdir", params={"rate_inflation": 0.03})
This overwrites the defaults set by "technology-data", or adds to it if the respective setting is not specified there. Consult technology-data/config.yaml for the current settings or hints at what can be changed. Also, consult their documentation.
Common Errors
The current project's supported Python range (>=3.9,<4.0) is not compatible with some of the required packages Python requirement:
- scipy requires Python <3.13,>=3.9, so it will not be satisfied for Python >=3.13,<4.0
This, or similar errors, can occur if the pyproject.toml (or similar) specifies a too broad range of Python versions,
like:
[tool.poetry.dependencies]
python = "^3.9"
Changing that based on the proposed range (here <3.13,>=3.9 from scipy) to:
[tool.poetry.dependencies]
python = ">=3.9,<3.13"
will fix that.
subprocess.CalledProcessError: Command '['git', '-C', PosixPath('tmpdir'), 'pull']' returned non-zero exit status 1.
This error indicates an error during executing git pull. If you've previously used a target_dir = "tmpdir and
pulled, e.g., version="v0.6.1", and are now using EMTD(target_dir="tmpdir") (without version), the pull will fail;
make sure to stick to one version, or use a different target_dir for managing different versions.
Developing emtd
This is a rough outline of how to get started with developing emtd:
- Clone this repository:
git clone https://github.com/sstroemer/emtd.git. - Create a new environment:
uv venv. - Activate the environment:
source .venv/bin/activate. - Install the dependencies:
uv sync. - If you are using VSCode, PyCharm, etc., select
.venv/bin/pythonas the interpreter.
Depending on how you work with it, consider using uv pip install -e ..
Updating packages
Currently the proposed way is:
uv lock --upgrade
uv sync
Metadata
Release files for emtd 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| emtd-0.3.1.tar.gz | 7.0 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| emtd-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.2 kB
Release files / emtd-0.3.1.tar.gz
| Download URL | emtd-0.3.1.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
39ad09b8ae1918f863bef1b49a78e61a20d971edf40e53ce8eaef7c097d9b077
|
|
BLAKE2b-256 checksum How to use checksums |
125437159370a5fdceed6d13812d28cc777454d57901dd84601c8e4a9aa64418
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 22, 2024.
Transparency logRelease files / emtd-0.3.1-py3-none-any.whl
| Download URL | emtd-0.3.1-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d3ce7380a6dfacddec84103f5bd6595987dc2ec880ac9f511f564c67951d16de
|
|
BLAKE2b-256 checksum How to use checksums |
e89f6ab4335c4ce6ad71575a946804750f71c912655a242040850c7d098a6850
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 22, 2024.
Transparency logSecurity for emtd 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for emtd-0.3.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 22, 2024.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.