Package: emtd
Energy Modeling Technology DataThis tool provides a slim Python wrapper to access the"technology-data"data set /Snakemakeworkflow, maintained by thePyPSAteam.🚨 🚨 Please check the license of thetechnology-datarepo, especially
regarding the applicable licences of various input (and therefore output) data files. Additional info can be found
starting at74and87. 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 StartedThe following example assumes that you are usingcondato create your environment, andpoetryto manage your
dependencies. Other ways should work in a similar fashion.Create an environment (skip if adding to an existing one; choose whatever Python version you want to use), installingpoetry(skip if using a global installation or if you are already usingpoetry), initializing yourpyproject.toml(consider also usingpoetry newinstead ofpoetry initwhen starting a project), and then addemtdto your
dependencies.(base)$condacreate-nyourenvnamepython=3.11-y(base)$condaactivateyourenvname(yourenvname)$pipinstallpoetry(yourenvname)$poetryinit(yourenvname)$poetryaddemtdNow you can run the following examplatory code:fromemtdimportEMTD# 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"]ReproducabilityTo make sure everyone using your code will get the same results fromemtd, it is advised to fix the data set to a
specific version. Consult therelease pagefor available versions,
then make sure to initialize using (e.g.):data=EMTD(target_dir="tmpdir",version="v0.6.2")Make sure to include thevin 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 initializeemtd, it will try
to update.Configuring the Snakemake workflowTo change parameters in theSnakemakeworkflow, pass adicttoEMTD: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. Consulttechnology-data/config.yamlfor the current settings
or hints at what can be changed. Also, consult theirdocumentation.Common ErrorsThe 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.0This, or similar errors, can occur if thepyproject.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.9fromscipy) 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 executinggit pull. If you've previously used atarget_dir = "tmpdirand
pulled, e.g.,version="v0.6.1", and are now usingEMTD(target_dir="tmpdir")(without version), the pull will fail;
make sure to stick to one version, or use a differenttarget_dirfor managing different versions.