Skip to content
Merged
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
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Bug report
about: For general problems with the documentation
title: ''
labels: bug
assignees: ''

---

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

**To Reproduce**
Steps to reproduce the issue:
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.

**Additional context**
Add any other context about the problem here.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
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 reach out through our website for general questions.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/guideline-suggestion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Guideline suggestion
about: Suggest an idea to make modelblocks better!
title: ''
labels: enhancement
assignees: ''

---

**Is this suggestion 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.
19 changes: 19 additions & 0 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: CI

on:
pull_request:
branches: [ main ]

jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: setup-pixi
uses: prefix-dev/setup-pixi@v0.9.4
- name: Run tests
run: pixi run test
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ build/
dist/
wheels/
*.egg-info
src/clio_tools/_version.py

# Virtual environments
.venv
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# https://citation-file-format.github.io/
cff-version: 1.2.0
message: Please cite this project using the metadata from this file.
title: "modelblocks - Re-usable building blocks for energy system models"
title: "modelblocks - Reusable building blocks for energy system models"
repository: https://github.com/modelblocks-org/docs
license: Apache 2.0
version: 0.0.1
Expand Down
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
# A framework for modular and easy to understand energy modelling tools
# Modelblocks documentation

`clio` aims to be a collection modularisation guidelines and tools that help energy modellers produce high-quality research that is repeatable, understanable and easy to use.
`modelblocks` aims to be a collection modular tools and modularisation guidelines that help energy modellers produce high-quality research that is repeatable, understanable, and easy to use.

Please read all about it in our [documentation](https://clio.readthedocs.io/en/stable/)!
Please read all about it in our [documentation](https://modelblocks.readthedocs.io/en/stable/)!

## `clio` development
## `modelblocks` documentation development

Install [`pixi`](https://pixi.sh/latest/) and run:
We rely on [`pixi`](https://pixi.sh/latest/) for development and maintenance.
To install, simply run the following:

```bash
git clone git@github.com:calliope-project/clio.git
cd clio
pixi install --all # Installs both default and developer dependencies
git clone git@github.com:modelblocks-org/docs.git
cd docs
pixi install --all
```

## Helper commands

- `pixi run build-docs`: build a local version of the documentation
- `pixi run serve-docs`: render the documentation on your browser
- `pixi run style`: run CI linting, refractoring and spellchecking
- `pixi run test`: quick local test of the documentation
30 changes: 16 additions & 14 deletions docs/Background/our_framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,31 @@ These are topic-specific data-generating [`snakemake`](https://snakemake.github.
Below is an example of how a data module can be accessed by another workflow.

```python
# Include local module configuration.
configfile: "config/modules/foobar.yaml"
# Load the module configuration
with open(workflow.source_path("config/geoboundaries.yaml"), "r") as file:
config_geoboundaries = yaml.safe_load(file.read())

module foobar:
module geoboundaries:
# Request a specific module version.
snakefile:
github(
"calliope-project/foobar",
"modelblocks-org/module_geo_boundaries",
path="workflow/Snakefile",
tag="v1.0.0"
tag="v0.1.9"
)
# Module configuration has its own key to ensure isolation.
config: config["foobar"]
# A prefix is added to isolate module input/output files.
prefix: "results/module_foobar"
# Specify the module configuration.
config: config_geoboundaries
# Pathvars let you tune input/output file location.
pathvars:
shapes="results/module_geoboundaries/shapes.parquet"

# Rewrite rule names to avoid naming conflicts
use rule * from foobar as module_foobar_*
use rule * from geoboundaries as module_geoboundaries_*
```

??? note "Template"

All data modules should follow [our standardised template](https://github.com/calliope-project/data-module-template).
All data modules should follow [our standardised template](https://github.com/modelblocks-org/data-module-template).
This template provides a baseline for developers to ensure the following.

- Version-specific access via version tags.
Expand All @@ -81,9 +83,9 @@ These are study-specific workflows that combine the outputs of all other types o
Since they tend to be study-specific, they will rarely (if ever) be accessed by other tools or components.
It is perfectly possible to ensure that a model builder can be accessed modularly, but this is not required.

## The `clio_tools` integration utilities
## The `clio_tools` integration utility

To save time and enable component developers to check against the latest `clio` standards, we provide the `clio_tools` library.
To save time and enable component developers to check against the latest `modelblocks` standards, we provide the `clio_tools` library.
This is a set of useful utility functions, geared towards ensuring smooth interfacing.

For more information, check [`clio_tools`](https://github.com/modelblocks-org/clio-tools)
For more information, check [`clio_tools`](https://github.com/modelblocks-org/clio-tools).
4 changes: 2 additions & 2 deletions docs/Developer_guidelines/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ If you don't, we recommend following `mamba`'s [installation advice](https://git
mamba install -c conda-forge copier
```

2. Call the `copier` template of the type of component you wish to make. Currently, we only support [data modules](https://github.com/calliope-project/data-module-template).
2. Call the `copier` template of the type of component you wish to make. Currently, we only support [data modules](https://github.com/modelblocks-org/data-module-template).

```shell
copier copy 'https://github.com/calliope-project/data-module-template'
copier copy 'https://github.com/modelblocks-org/data-module-template'
```

3. You'll be prompted with some questions. After answering them, `copier` will auto-generate the module for you.
Expand Down
15 changes: 4 additions & 11 deletions docs/Developer_guidelines/requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

We enforce the following requirements in all projects.

1. **Open-source code**: projects must use either MIT or Apache 2.0, which are both [OSI approved](https://opensource.org/licenses) open-source licenses, and they must be openly available in platforms such as GitHub.
1. **Open-source code**: projects must use either Apache 2.0 or MIT open-source licenses, which are [OSI approved](https://opensource.org/licenses), and they must be openly available in platforms such as GitHub.
2. **Open data**: data produced by projects (dataset tools and data modules in particular) should use a [CC-BY-4.0 license](https://creativecommons.org/licenses/by/4.0/) whenever possible.
3. **Versioning**: projects must be version controlled with official releases, which can be used to specify the version of the project used in a study and/or dataset, and an accompanying CHANGELOG. Project developers are free to choose their preferred approach (e.g., [SemVer](https://semver.org/) or [CalVer](https://calver.org/)).
4. **Testing**: projects must employ some type of testing to ensure quality and long-term stability. The approach will vary depending on the type of project:
Expand Down Expand Up @@ -46,7 +46,7 @@ The following is a list of general advice on how to format files to help tools i

???+ example "Example of a tidy table"

| year | country_id | shape_id | demand |
| year | country_id | shape_id | demand_mwh |
|---------------|------------------|------------------|--------------|
| 2020 | ITA | North | 4500 |
| 2020 | ITA | East | 4800 |
Expand All @@ -68,20 +68,13 @@ The following is a list of general advice on how to format files to help tools i
"shape_id": "no_unit",
"demand": "mwh"
}
dataframe.attrs["source"] = "github.com/calliope-project/clio"
dataframe.attrs["source"] = "github.com/modelblocks-org/docs"
dataframe.attrs["license"] = "CC-BY-4.0"
dataframe.to_parquet('my_data.parquet')
```

3. **Raster data**: we prefer to use GeoTIFF (.tiff) files.
4. **Polygon data**: we prefer [GeoParquet](https://geoparquet.org/) (.parquet) files.

??? example "Example shapefiles in our standard format"

You can find some simple examples of our standard data format in the `clio/resources/shapes` folder.

--8<-- "resources/shapes/README.md:docs"

5. **Gridded data**: we prefer to use [netCDF](https://www.unidata.ucar.edu/software/netcdf/) (.nc) files.

## Metadata conventions
Expand All @@ -95,7 +88,7 @@ The following is a list of general advice on how to format files to help tools i

???+ example "Example of tabular subnational data"

| country_id | shape_id | shape_spec | demand |
| country_id | shape_id | shape_spec | demand_mwh |
|------------------|------------------|------------------|--------------|
| DEU | DE13 | NUTS2024 | 4500 |
| DEU | DE14 | NUTS2024 | 4800 |
Expand Down
2 changes: 1 addition & 1 deletion docs/Developer_guidelines/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ This would quickly become confusing without some level of standardisation, so ou
- Automatically generated documentation in a standard format, providing a familiar structure across all data modules.
- Automatic checks for template updates, aiding module developers in keeping up with the latest standard.

URL: <https://github.com/calliope-project/data-module-template>
URL: <https://github.com/modelblocks-org/data-module-template>

## Model builder template

Expand Down
14 changes: 7 additions & 7 deletions docs/Modules/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ Currently, the following data modules are available.

The modules are currently in active development. A more detailed documentation showing the capability of each module will be coming soon.

- [module_area_potentials](https://github.com/calliope-project/module_area_potentials)
- [module_demand_electricity](https://github.com/calliope-project/module_demand_electricity)
- [module_electricity_grid](https://github.com/calliope-project/module_electricity_grid)
- [module_geoboundaries](https://github.com/calliope-project/module_geo_boundaries)
- [module_hydropower](https://github.com/calliope-project/module_hydropower)
- [module_powerplants](https://github.com/calliope-project/module_powerplants)
- [module_pv_wind](https://github.com/calliope-project/module_pv_wind)
- [module_area_potentials](https://github.com/modelblocks-org/module_area_potentials)
- [module_demand_electricity](https://github.com/modelblocks-org/module_demand_electricity)
- [module_electricity_grid](https://github.com/modelblocks-org/module_electricity_grid)
- [module_geoboundaries](https://github.com/modelblocks-org/module_geo_boundaries)
- [module_hydropower](https://github.com/modelblocks-org/module_hydropower)
- [module_powerplants](https://github.com/modelblocks-org/module_powerplants)
- [module_pv_wind](https://github.com/modelblocks-org/module_pv_wind)

If you think that an important topic is not covered by the modules above, feel free to develop your own module! Please read the [developer guidelines](../Developer_guidelines/getting_started.md) to learn how to get started. Our templates and recommended good practices are ready to help you, so your module will work smoothly from the start.
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Home

Welcome to [`clio`](https://github.com/calliope-project/clio)!
Welcome to the [`modelblocks`](https://www.modelblocks.org/) documentation!

Our main purpose is enabling energy researchers and institutions to share, reuse and improve the data workflows used to construct Energy System Models in a decentralised way.
We aim to do this by providing an expanding collection of high-quality modular workflows used for peer-reviewed research, inspired by `snakemake`'s [workflow catalog](https://snakemake.github.io/snakemake-workflow-catalog/).

In essence, we wish to turn very complex models that are hard to maintain and reuse into a range of digestible, well supported tools that get better and better over time!
We wish to turn very complex models that are hard to maintain and reuse into a range of digestible, well supported tools that get better and better over time!

![modules](./images/modular.png)

Expand Down
14 changes: 7 additions & 7 deletions mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

site_name: modelblocks
site_url: https://modelblocks.readthedocs.io/
repo_name: clio
repo_name: docs
repo_url: https://github.com/modelblocks-org/docs/
edit_uri: edit/main/docs/
theme:
Expand All @@ -22,24 +22,24 @@ theme:
toggle:
icon: material/brightness-auto
name: Switch to light mode
primary: red
accent: pink
primary: teal
accent: blue grey
# Palette toggle for light mode
- media: "(prefers-color-scheme: light)"
scheme: default
toggle:
icon: material/weather-sunny
name: Switch to dark mode
primary: red
accent: pink
primary: teal
accent: blue grey
# Palette toggle for dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/weather-night
name: Switch to system preference
primary: red
accent: pink
primary: teal
accent: blue grey
markdown_extensions:
- admonition
- pymdownx.tasklist:
Expand Down
Loading
Loading