Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
9e61911
Set up module from template
jnnr Jun 17, 2025
43996b2
Add rules for download, clean and disaggregation
jnnr Jun 23, 2025
9a90e98
Save annual demand disaggregated and profiles separately
jnnr Jun 24, 2025
67a237c
Aggregate and use country profiles
jnnr Jun 25, 2025
9678279
Include file name in rule output to connect dag
jnnr Jun 25, 2025
d03ed2c
Add wildcard for shapes and pass countries as parquet
jnnr Jun 25, 2025
b286282
Map countries by hard-coded mapping to cover GBR
jnnr Jul 4, 2025
5391529
Fix plots
jnnr Jul 4, 2025
e1ebb35
Add hard-coded country mapping
jnnr Jul 4, 2025
7def9d8
Fix file extension
jnnr Jul 7, 2025
df760b5
Set index to shape_id
jnnr Jul 7, 2025
3007362
Download historic load from ENTSO-E
jnnr Jul 7, 2025
811f5db
Simplify and revise NaN handling
jnnr Jul 9, 2025
b07dc3b
Rename script
jnnr Jul 9, 2025
119105a
Keep raster data internal in resources/automatic
jnnr Jul 9, 2025
de9a66e
Avoid Norway turning into None in yaml
jnnr Jul 9, 2025
eeebbef
Allow to internally switch btw entsoe data from api download or opsd
jnnr Jul 9, 2025
57ad404
Add heatmap of missing data
jnnr Jul 9, 2025
4c76fa8
Indicate unit in final result file name
jnnr Jul 9, 2025
34eeea4
Let user configure the source of ENTSOE data
jnnr Jul 10, 2025
bbec532
Adhere to shapes data schema
jnnr Jul 17, 2025
56afb6b
Fix raster map
jnnr Jul 17, 2025
15d70ed
Document the module's interface
jnnr Nov 3, 2025
e856e37
Move plots to '_plots' module
jnnr Nov 3, 2025
9750566
Validate data schemas with pandera
jnnr Nov 4, 2025
5bcdc21
Clean up scripts
jnnr Nov 4, 2025
5a8a0fd
Adapt integration test
jnnr Nov 4, 2025
14ff142
Set index to shape_id before disaggregating
jnnr Nov 5, 2025
86e8c8c
Clip population to ENTSO-E area defined in internal settings
jnnr Nov 5, 2025
9084983
Add plot of national load profiles
jnnr Nov 5, 2025
8e2adf6
Refine check of final profile and drop regions with NaN annual demand
jnnr Nov 5, 2025
089155e
Add line break
jnnr Nov 5, 2025
393bec3
Adapt scope for clipping
jnnr Nov 5, 2025
90aca68
Set up two test cases
jnnr Nov 5, 2025
f9dfa66
Adapt figsize
jnnr Nov 5, 2025
9892751
Tweak plot
jnnr Nov 5, 2025
f461a95
Add a bit more documentation
jnnr Nov 5, 2025
323e809
Run copier update
jnnr Nov 12, 2025
46e3f25
Attempt to pass snakemake linting in CI
jnnr Nov 12, 2025
6c1212d
Complete INTERFACE.yaml
jnnr Nov 13, 2025
bae298e
Add test-integration as a job for pixi
jnnr Nov 13, 2025
e553a0e
Make string to pass schema validation
jnnr Nov 13, 2025
781e125
Add missing requirement pydantic
jnnr Nov 13, 2025
147df15
Add pixi.lock
jnnr Nov 13, 2025
c3ed0f9
Switch to Apache 2.0 License
jnnr Nov 13, 2025
47c0120
Drop obsolete config attributes
jnnr Nov 13, 2025
8ef4266
Use the correct env for cleaning
jnnr Nov 13, 2025
6829908
Use pycountry instead of hard-coded mapping
jnnr Nov 13, 2025
dd847d7
Harmonise rule name and log name
jnnr Nov 13, 2025
4853fab
Include README in docs/index.md
jnnr Nov 13, 2025
0deb67f
Use config to determine start:end of api download
jnnr Nov 13, 2025
daa1992
Update to latest data-module-template
jnnr Jun 4, 2026
356281f
Run copier recopy for full template update
jnnr Jun 4, 2026
a273e61
Make assertion more robust
jnnr Jun 4, 2026
a77c92c
Automatically download test data
jnnr Jun 4, 2026
204c356
Use pathvars
jnnr Jun 4, 2026
dfc6958
Update pixi.lock
jnnr Jun 4, 2026
871a280
Reduce temporal range of integration test
jnnr Jun 4, 2026
92d2a38
Use pathvars and fix path references
jnnr Jun 4, 2026
8ef6962
Separate integration test and local test
jnnr Jun 5, 2026
e2fb9f8
Fix pathvars
jnnr Jun 5, 2026
47f9f0d
Fix incompatibility with pandas 3.0.0
jnnr Jun 5, 2026
4dfa03d
Refine documentation
jnnr Jun 8, 2026
a1a4d93
Move plots of raw data down the pipeline
jnnr Jun 8, 2026
cbfa42b
Refine profile plot
jnnr Jun 8, 2026
9dc76b6
Remove obsolete plot
jnnr Jun 9, 2026
a432cb8
Add pathvars throughout to avoid copying data
jnnr Jun 9, 2026
1a82967
Remove obsolete plot from INTERFACE.yaml
jnnr Jun 9, 2026
54275a0
Unzip only one file, in a OS-independent way
jnnr Jun 9, 2026
76ea298
Refine paths of log files
jnnr Jun 9, 2026
70537a8
Move NaN-filling to the disaggregation script
jnnr Jun 9, 2026
e82c040
Fixed logging:
irm-codebase Jun 15, 2026
05a30ba
Remove unnecessary files and fix testing safety:
irm-codebase Jun 15, 2026
a45a841
Update mentions of calliope/clio to Modelblocks
irm-codebase Jun 15, 2026
6f4bd19
Internal YAML schema updates:
irm-codebase Jun 15, 2026
b32a068
Improved download rule safety:
irm-codebase Jun 15, 2026
5856398
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 15, 2026
75d5b1f
Use rasterio clip wrapper to clip population data
irm-codebase Jun 16, 2026
b1e3c6a
Implement safer global wildcard "shape":
irm-codebase Jun 16, 2026
50608fe
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 16, 2026
996e2df
Clip the population raster using the provided shape file
irm-codebase Jun 16, 2026
92c1efc
Use chunked data for gregor disaggregation
irm-codebase Jun 16, 2026
4b0dd09
Environment fixes
irm-codebase Jun 18, 2026
1bf72cb
Merge pull request #2 from modelblocks-org/feature/initial-module-fixes
jnnr Jun 25, 2026
5bfbc00
Update pixi.lock
jnnr Jun 25, 2026
c214d84
Get secret from environment variable if needed
jnnr Jun 25, 2026
84b2290
Pin clio-tools version before template update
jnnr Jun 25, 2026
02dc3b8
Download geospatial test bench files as input for tests
jnnr Jun 25, 2026
faf96dd
Fix reference to secret
jnnr Jun 25, 2026
0261e47
Rewire test fixtures
jnnr Jun 25, 2026
35ad2da
Adapt fixture's scope
jnnr Jun 25, 2026
2f1a5ee
Simplify config key
jnnr Jun 25, 2026
05e86ef
Fix previous adaption
jnnr Jun 25, 2026
621639d
Correct clauses
jnnr Jun 25, 2026
0f07aef
Raise error if token is not provided
jnnr Jun 25, 2026
48b8d71
Set environment variable with expected name
jnnr Jun 25, 2026
bda975c
Drop buffer argument in calling clip wrapper
jnnr Jun 25, 2026
45b055d
Use older version of clip wrapper in attempt to fix on windows
jnnr Jun 25, 2026
86e83f0
Re-rout default pathvars in integration test
jnnr Jun 25, 2026
9e78eba
Fix target rule of integration test
jnnr Jun 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Changes here will be overwritten by Copier
# !!!!! DO NOT MANUALLY MODIFY THIS FILE !!!!!
_commit: latest
_src_path: https://github.com/modelblocks-org/data-module-template.git
author_email: j.a.c.launer@tudelft.nl
author_family_name: Launer
author_given_name: Jann
github_org: modelblocks-org
license: Apache-2.0
module_description: This module prepares electricity demand timeseries for Europe
at arbitrary resolution
module_long_name: Data module for electricity demand in Europe
module_short_name: module_demand_electricity
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Documentation: https://EditorConfig.org
# Inspired by Django .editorconfig file

root = true

[*]
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
end_of_line = lf
insert_final_newline = true
charset = utf-8

[*.{yaml,yml,.cff}]
indent_size = 2

[*.md]
trim_trailing_whitespace = true
indent_size = 4

[*.{diff,patch}]
trim_trailing_whitespace = false
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. Linux Fedora 43, Windows 11...]
- Version [e.g. v0.1.1]

**Additional context**
Add any other context about the problem here.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: General information
url: https://www.modelblocks.org/
about: Please consult our website for general information on the Modelblocks methodology.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
18 changes: 18 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Fixes #

## Summary of changes in this pull request

*
*
*

## Reviewer checklist

* [ ] There are no `pip` dependencies in the module's environment files (`workflow/envs/`).
* [ ] All rules use `pathvars` (e.g., `<results>`) in their inputs and outputs.
* [ ] The integration test-suite is successful, including:
* [ ] `pre-commit.ci` tests pass.
* [ ] tests pass for all relevant OS configurations (linux, osx, windows).
* [ ] Module documentation is up-to-date, including:
* [ ] `INTERFACE.yaml` mentions all relevant `pathvars` and `wildcards`.
* [ ] `README.md` describes how to use the module and has the necessary citations.
13 changes: 13 additions & 0 deletions .github/workflows/check-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Check for changes in the upstream template. If changes are found, an issue is created
name: Template check.
on:
workflow_dispatch:
schedule:
- cron: '0 0 1 * *' # Runs at 00:00 UTC on the 1st day of every month

jobs:
copier-update:
permissions:
contents: read
issues: write
uses: modelblocks-org/data-module-template/.github/workflows/template-check-version.yml@latest
43 changes: 43 additions & 0 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# !!!!! DO NOT MODIFY UNLESS ABSOLUTELY NECESSARY !!!!!
# This workflow helps standardise integration tests across data modules
name: Pull Request CI tests for Modelblocks data modules
on:
pull_request:
branches:
- "main"
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
- name: Setup pixi
uses: prefix-dev/setup-pixi@v0.8.3
- name: Run integration tests
env: # Set the secret as an environment variable
TOKEN_ENTSOE: ${{ secrets.TOKEN_ENTSOE }}
id: tests
run: pixi run test-integration
continue-on-error: true
- name: Run snakemake linting
id: linting
run: |
pixi run snakemake --lint --snakefile workflow/Snakefile
pixi run snakemake --lint --snakefile tests/integration/Snakefile
continue-on-error: true
- name: Save integration logs
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: integration-test-logs-${{ matrix.os }}
path: tests/integration/resources/module/logs
if-no-files-found: ignore
retention-days: 30
- name: Fail if integration or linting failed
if: ${{ steps.tests.outcome == 'failure' || steps.linting.outcome == 'failure' }}
run: exit 1
11 changes: 11 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Release

on:
release:
types: [released]

jobs:
release-workflow:
permissions:
contents: write
uses: modelblocks-org/data-module-template/.github/workflows/template-release.yml@latest
29 changes: 29 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
### OS-specific
.DS_Store

### Editors
*~
\#*\#
**/.vscode
.$*

### Byte-compiled files
__pycache__
*.pyc

### Environments
.pixi/

### Snakemake
.snakemake/
gurobi.log

### Notebooks
.ipynb_checkpoints

# Ignore mutable folders
**/logs/*
**/resources/*
**/results/*
**/temp/*
**/tmp/*
48 changes: 48 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
default_language_version:
python: python3

repos:
# Generic 'file quality' testing
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
# Machine-friendliness
- id: trailing-whitespace
- id: end-of-file-fixer
# Repo quality
- id: check-added-large-files
args: [--enforce-all]
exclude: ^pixi\.lock$
- id: forbid-submodules
- id: check-case-conflict
- id: check-illegal-windows-names
- id: check-merge-conflict
- id: debug-statements
# Detect config. file issues
- id: check-json
- id: check-yaml
args: [--unsafe]

# Python file formatting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.6
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format

# Snakemake file formatting
- repo: https://github.com/snakemake/snakefmt
rev: v1.0.0
hooks:
- id: snakefmt

# Spelling
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
files: .*\.(py|smk|md)$|^Snakefile$

ci: # https://pre-commit.ci/
autoupdate_schedule: quarterly
5 changes: 5 additions & 0 deletions .snakemake-workflow-catalog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Integration with https://snakemake.github.io/snakemake-workflow-catalog/#
usage:
software-stack-deployment:
conda: true
report: false
7 changes: 7 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This is the list of contributors for copyright purposes.

This does not necessarily list everyone who has contributed to this software's
code or documentation. For a full contributor list, see:
<https://github.com/calliope-project/module_demand_electricity/graphs/contributors>

Jann Launer, <j.a.c.launer@tudelft.nl>
11 changes: 11 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Citation file
# For more information, see:
# https://citation-file-format.github.io/
cff-version: 1.2.0
message: If you use this software or data produced by it, please cite it using the metadata from this file.
title: "Modelblocks - module_demand_electricity: Data module for electricity demand in Europe"
repository: "https://github.com/modelblocks-org/module_demand_electricity"
license: Apache 2.0
authors:
- given-names: Jann
family-names: Launer
29 changes: 29 additions & 0 deletions INTERFACE.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Module Input-Output structure for automated doc. generation
pathvars:
snakemake_defaults:
logs:
default: "<logs>"
description: location of rule log files.
resources:
default: "<resources>"
description: "location of module resource files."
results:
default: "<results>"
description: "location of module results."

user_resources:
token_entsoe:
default: "<resources>/user/token_entsoe.txt"
description: "User token for ENTSO-E API access."
shapes:
default: "<resources>/user/{shape}/shapes.parquet"
description: >
Shapes to aggregate the output data to.
IMPORTANT: they must add up to the full spatial extent of the country.
The module's processing requires it.
results:
demand_electricity_MW:
default: "<results>/{shape}/demand_electricity_MW.parquet"
description: Electricity demand profile per custom shape in units of MW.
wildcards:
shape: Name of the custom shape is a wildcard to allow multiple outputs based on different shapes.
Loading
Loading