Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 16 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"projectName": "grid_builder",
"projectOwner": "PyPSA",
"repoType": "github",
"repoHost": "https://github.com",
"files": [
"README.md"
],
"imageSize": 100,
"commit": false,
"commitConvention": "none",
"contributors": [],
"contributorsPerLine": 7,
"linkToUsage": false,
"contributorsSortAlphabetically": true
}
17 changes: 11 additions & 6 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# Changes here will be overwritten by Copier
# !!!!! DO NOT MANUALLY MODIFY THIS FILE !!!!!
_commit: latest
_commit: v1.0.3
_src_path: https://github.com/modelblocks-org/data-module-template.git
author_email: xiong@tu-berlin.de
author_family_name: Xiong
author_given_name: Bobby
authors:
- email: xiong@tu-berlin.de
family_name: Xiong
given_name: Bobby
github_org: PyPSA
license: MIT
maintainers:
- email: xiong@tu-berlin.de
family_name: Xiong
given_name: Bobby
module_code_name: grid_builder
module_description: A modular Snakemake workflow for constructing and validating power
grid models using OpenStreetMap data.
module_long_name: Global power grid builder
module_short_name: grid_builder
module_human_name: Global power grid builder
12 changes: 6 additions & 6 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ assignees: ''
---

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

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

**Expected behavior**
Expand All @@ -23,9 +23,9 @@ 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):**
**Environment (please complete the following information):**
- OS: [e.g. Linux Fedora 43, Windows 11...]
- Version [e.g. v0.1.1]
- Version: [e.g. v0.1.1]

**Additional context**
Add any other context about the problem here.
5 changes: 0 additions & 5 deletions .github/ISSUE_TEMPLATE/config.yaml

This file was deleted.

11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: Modelblocks project website
url: https://www.modelblocks.org/
about: Consult our website for general information on our initiative.
- name: Documentation
url: https://modelblocks.readthedocs.io/
about: Read our documentation for general questions and guidelines.
- name: Community chat
url: https://calliope-modelblocks.zulipchat.com
about: Reach out to our community on our official Zulip chat.
70 changes: 66 additions & 4 deletions .github/workflows/check-version.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,75 @@
# Check for changes in the upstream template. If changes are found, an issue is created
name: Template check.
# 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

defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}

jobs:
copier-update:
copier-check-update:
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
uses: modelblocks-org/data-module-template/.github/workflows/template-check-version.yml@latest
env:
ISSUE_TITLE: Template update available
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Check for template updates
id: copier_check_update
run: |
update_json="$(uvx --from 'copier>=9.15.2' copier check-update --output-format json)"
echo "$update_json"
{
echo "update_available=$(jq -r '.update_available // false' <<< "$update_json")"
echo "current_version=$(jq -r '.current_version // "unknown"' <<< "$update_json")"
echo "latest_version=$(jq -r '.latest_version // "unknown"' <<< "$update_json")"
} >> "$GITHUB_OUTPUT"

- name: Check for existing update issue
if: steps.copier_check_update.outputs.update_available == 'true'
id: existing_issue
run: |
issue_count="$(gh issue list \
--repo "${{ github.repository }}" \
--state open \
--search "$ISSUE_TITLE in:title" \
--json title \
--jq "map(select(.title == \"$ISSUE_TITLE\")) | length")"
if [[ "$issue_count" -gt 0 ]]; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Open update issue
if: steps.copier_check_update.outputs.update_available == 'true' && steps.existing_issue.outputs.exists != 'true'
run: |
gh issue create \
--repo "${{ github.repository }}" \
--title "$ISSUE_TITLE" \
--body "A new version of the Modelblocks data module template is available.

Current template version: ${{ steps.copier_check_update.outputs.current_version }}
Latest template version: ${{ steps.copier_check_update.outputs.latest_version }}

Please update this project using:

\`\`\`shell
copier update --skip-answered --defaults
\`\`\`

Review the resulting changes before merging them."
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 4 additions & 4 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: Setup pixi
uses: prefix-dev/setup-pixi@v0.8.3
uses: prefix-dev/setup-pixi@v0.9.6
- name: Run integration tests
id: tests
run: pixi run --locked test
Expand All @@ -28,10 +28,10 @@ jobs:
continue-on-error: true
- name: Save integration logs
if: ${{ always() }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: integration-test-logs-${{ matrix.os }}
path: tests/integration/logs
path: tests/integration/resources/module/logs
if-no-files-found: ignore
retention-days: 30
- name: Fail if integration or linting failed
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ __pycache__

### Environments
.pixi/
!.pixi/.gitignore

### Snakemake
.snakemake/
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ repos:

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

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

Expand Down
4 changes: 4 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ 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/PyPSA/grid-builder/blob/main/.all-contributorsrc>
<https://github.com/PyPSA/grid-builder/graphs/contributors>

Bobby Xiong, <xiong@tu-berlin.de>

5 changes: 3 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
# 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."
message: If you use this software or data produced by it, please cite it using the metadata from this file.
title: "grid-builder: Global power grid builder"
repository: "https://github.com/PyPSA/grid-builder"
license: "MIT"
license: MIT
authors:
- given-names: "Bobby"
family-names: "Xiong"
email: "xiong@tu-berlin.de"
orcid: "https://orcid.org/0000-0003-2854-0730"
22 changes: 13 additions & 9 deletions INTERFACE.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
# Module Input-Output structure for automated docs generation
convention_version: v1.0.0

pathvars:
snakemake_defaults:
logs:
default: "<logs>"
description: location of snakemake log files.
resources:
default: "<resources>"
description: >-
Raw OSM files are written to retrieve/{country}_{feature}.json.
Clean features are written below clean; generic network outputs
below build (buses/lines/transformers as CSV under build/csv
and GeoJSON, including substation polygons, under build/geojson).
An interactive PyDeck map of the network, and the default target
of this workflow, is written to map.html.
description: "location of module resource (input) files."
results:
default: "<results>"
description: location of module result files.
user_resources: {}
description: "location of module result (output) files."
retrieve:
default: <retrieve>
description: >-
Raw OSM files are written to retrieve/{country}_{feature}.json.
Clean features are written below clean; generic network outputs
below build (buses/lines/transformers as CSV under build/csv
and GeoJSON, including substation polygons, under build/geojson).
An interactive PyDeck map of the network, and the default target
of this workflow, is written to map.html.
Loading
Loading