Skip to content
Open
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
12 changes: 6 additions & 6 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@
"files": [
"README.md"
],
"contributorsSortAlphabetically": true,
"contributorsPerLine": 7,
"linkToUsage": false,
"imageSize": 100,
"commit": false,
"commitConvention": "none",
"imageSize": 100,
"contributors": [
"contributors": [
{
"login": "sjpfenninger",
"name": "Stefan Pfenninger-Lee",
Expand Down Expand Up @@ -52,5 +49,8 @@
"ideas"
]
}
]
],
"contributorsPerLine": 7,
"linkToUsage": false,
"contributorsSortAlphabetically": true
}
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changes here will be overwritten by Copier
# !!!!! DO NOT MANUALLY MODIFY THIS FILE !!!!!
_commit: latest
_commit: v1.0.2
_src_path: https://github.com/modelblocks-org/data-module-template
author_email: s.pfenninger@tudelft.nl
author_family_name: Pfenninger-Lee
Expand Down
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 }}
7 changes: 3 additions & 4 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.12"]
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 test-integration
Expand All @@ -30,7 +29,7 @@ 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/resources/module/logs
Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/release.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ __pycache__
*.pyc

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

### Snakemake
.snakemake/
Expand Down
3 changes: 3 additions & 0 deletions .pixi/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!.gitignore
!config.toml
1 change: 1 addition & 0 deletions .pixi/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pinning-strategy = "latest-up"
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ default_language_version:
repos:
# Generic 'file quality' testing
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
# Machine-friendliness
- id: trailing-whitespace
Expand All @@ -25,21 +25,21 @@ repos:

# Python file formatting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.6
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: v0.11.4
rev: v2.0.2
hooks:
- id: snakefmt

# Spelling
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
rev: v2.4.2
hooks:
- id: codespell
files: .*\.(py|smk|md)$|^Snakefile$
Expand Down
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,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_area_potentials/graphs/contributors>
<https://github.com/modelblocks-org/module_area_potentials/graphs/contributors>

Linh Ho-Tran, <L.Ho@tudelft.nl>
Stefan Pfenninger-Lee, <s.pfenninger@tudelft.nl>
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
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_area_potentials: Area potentials"
repository: "https://github.com/calliope-project/module_area_potentials"
repository: "https://github.com/modelblocks-org/module_area_potentials"
license: Apache-2.0
authors:
- given-names: Linh
Expand Down
10 changes: 6 additions & 4 deletions INTERFACE.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# Module Input-Output structure for automated doc. generation
# Module Input-Output structure for automated docs generation
convention_version: v1.0.0

pathvars:
snakemake_defaults:
logs:
default: "<logs>"
description: location of rule log files.
description: location of snakemake log files.
resources:
default: "<resources>"
description: "location of module resource files."
description: "location of module resource (input) files."
results:
default: "<results>"
description: "location of module results."
description: "location of module result (output) files."
user_resources:
shapes:
default: "<resources>/user/shapes/{shape}.parquet"
Expand Down
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,21 @@ cd module_area_potentials
pixi install --all
```

Please be aware that this is a multi-environment project (see [pixi.toml](./pixi.toml) for details).
- `default`: used for development and integration testing.
Because it contains `Snakemake`, `conda` and `pytest` as dependencies it **should not be used** in `Snakemake` rules.
- `module`: contains minimal dependencies used in `Snakemake` rules.
If modified, be sure to export it to `Snakemake` so it can be recreated by module users:

```shell
# create module.yaml and conda-spec pin files in workflow/envs/
pixi run export-snakemake-env module
```


## Testing
<!-- Please do not modify this templated section -->

For testing, simply run:

```shell
Expand Down Expand Up @@ -139,7 +154,7 @@ This module is based on the following research and datasets:

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
Thanks goes to these wonderful people, sorted alphabetically ([emoji key](https://allcontributors.org/en/reference/emoji-key/)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
Expand All @@ -157,7 +172,6 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
1 change: 1 addition & 0 deletions figures/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# For module documentation figures
Loading
Loading