Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
c77f716
adding dev container config
drifter089 Oct 10, 2024
b076ea3
updated docekr file
drifter089 Oct 10, 2024
96d333b
updated docker file
drifter089 Oct 10, 2024
151bc2d
update: include java
GbotemiB Oct 14, 2024
05cf1c4
docker docs init
GbotemiB Oct 14, 2024
0d65aac
review welcome message for new users
GbotemiB Oct 14, 2024
a3d22ca
running tutorial before push
drifter089 Oct 21, 2024
952583a
fixing clone command in CI
drifter089 Oct 21, 2024
9a1fb06
fixing variable value
drifter089 Oct 21, 2024
ad189c5
Fix issue of adding H2 store in `add_extra_components` rule (#1134)
yerbol-akhmetov Oct 15, 2024
fffe9c7
[pre-commit.ci] pre-commit autoupdate (#1131)
pre-commit-ci[bot] Oct 16, 2024
ed8e300
Add a restriction to rasterio version (#1146)
ekatef Oct 16, 2024
95e0aab
Enable configfile specification for mock_snakemake (#1135)
yerbol-akhmetov Oct 16, 2024
fb5c61b
update: set env file required for cluster network
GbotemiB Oct 22, 2024
4fc5fc3
update: include mac into the CI
GbotemiB Oct 28, 2024
b54eacd
adding user as secret
drifter089 Oct 29, 2024
5a6e210
delete duplicate file and add user as secret
drifter089 Oct 29, 2024
8abaa7b
setup docekr on macos
drifter089 Oct 29, 2024
a2f570e
trying colima for docekr setup on mac
drifter089 Oct 29, 2024
9f4a0bf
adding mac docker setup
drifter089 Oct 29, 2024
928195e
installing colima on mac
drifter089 Oct 29, 2024
d50db33
disable buildkit for docker
drifter089 Oct 29, 2024
781f8ee
add buildx plugin
drifter089 Oct 29, 2024
d6188d2
include documentation for using docker container
GbotemiB Nov 6, 2024
49e5c5f
update docker docs
GbotemiB Nov 6, 2024
4117756
include docker readme
GbotemiB Nov 7, 2024
9a5dc0f
updated CI to build on ubuntu only and test on both
drifter089 Nov 13, 2024
07590df
pushing test image before runningn tests
drifter089 Nov 13, 2024
9629a2e
adding updated build action
drifter089 Nov 13, 2024
fc27e5a
removing cache
drifter089 Nov 13, 2024
a0ba73a
removing tagging
drifter089 Nov 13, 2024
e1c4054
adding no cache to build
drifter089 Nov 13, 2024
bc4e8fb
no need to push again after checking
drifter089 Nov 13, 2024
a392df6
Rename the sector test file
ekatef Nov 29, 2024
1cc06d2
Change a name of the config of the sector test
ekatef Nov 29, 2024
bf33ab2
Fix a comment
ekatef Nov 29, 2024
5221dff
Improve consistency of the test configs
ekatef Nov 29, 2024
732fcbd
Harmonize add_brownfield
ekatef Nov 30, 2024
4959a11
Update wildcards for mock_snakemake across scripts
ekatef Dec 4, 2024
513d8bc
Update a test file name in Makefile
ekatef Dec 4, 2024
52e5fce
Merge pull request #2 from pypsa-meets-earth/main
GbotemiB Dec 6, 2024
4d98000
Update devcontainer.yml
GbotemiB Dec 6, 2024
c610ddc
Update Dockerfile
drifter089 Dec 6, 2024
9c983ca
Update Dockerfile
GbotemiB Dec 6, 2024
c5c823f
Merge pull request #3 from drifter089/main
GbotemiB Dec 7, 2024
a6be076
Merge branch 'main' into harmonise_wildcards
ekatef Dec 10, 2024
229235e
Fix refuse
ekatef Dec 10, 2024
68bb45d
pre-commit bot run
drifter089 Dec 11, 2024
dca591b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 11, 2024
6effd98
Delete .github/.devcontainer/test.sh
drifter089 Dec 11, 2024
d793625
Update devcontainer.yml
drifter089 Dec 11, 2024
dbc8bfd
add custom flag for custom airport data
GbotemiB Dec 11, 2024
172fab7
Merge branch 'main' into custom-airports
GbotemiB Dec 12, 2024
05e692d
Merge branch 'main' of github.com:pypsa-meets-earth/pypsa-earth into …
GbotemiB Dec 13, 2024
4d659a3
fix precommit issues
GbotemiB Dec 13, 2024
7be258b
Merge branch 'main' into custom-airports
GbotemiB Dec 13, 2024
1420450
trigger and image name
drifter089 Dec 14, 2024
c8654cf
Update setup.sh
drifter089 Dec 14, 2024
a7fcdb3
Release v0.5.0 (#1238)
ekatef Dec 14, 2024
8212659
Merge pull request #1235 from GbotemiB/custom-airports
Eddy-JV Dec 15, 2024
b02ec4f
adjust path implementation for Windows
GbotemiB Dec 17, 2024
bac4ac3
keep custom data
GbotemiB Dec 17, 2024
d3e00d5
adjusted conditional position to avoid computation when custom data i…
GbotemiB Dec 17, 2024
a75ef4c
include base directory incase of running outside of root directory
GbotemiB Dec 17, 2024
7185b74
Update build_powerplants.py (#1242)
milyas009 Dec 18, 2024
1e5a569
Merge branch 'main' into fix-paths
GbotemiB Dec 19, 2024
fdc14d3
Update release_notes.rst
GbotemiB Dec 19, 2024
619c0c2
Update release_notes.rst
davide-f Dec 19, 2024
ec37fe1
Merge pull request #1241 from GbotemiB/fix-paths
davide-f Dec 20, 2024
d0312ee
Fix earth-osm version
davide-f Dec 20, 2024
67d6325
Merge branch 'main' into harmonise_wildcards
ekatef Dec 20, 2024
17c7030
Merge pull request #1223 from ekatef/harmonise_wildcards
davide-f Dec 20, 2024
302f45a
Introducing an option for the user to decide on simplifying GADM shap…
SermishaNarayana Dec 20, 2024
e03d724
restore BJ to country selection
GbotemiB Dec 21, 2024
5dfae1c
Add a workflow to manually update pinned environments for PR (#1250)
ekatef Dec 21, 2024
b1ff298
Update documenter frequency (#1252)
davide-f Dec 21, 2024
62a4bfa
update FT to account for Hydrogen and Electricity input (#1226)
GbotemiB Dec 23, 2024
236e0d0
Bypass external urls (#1257)
davide-f Dec 23, 2024
3dc6ddc
update gdrive link (#1259)
davide-f Dec 23, 2024
a0fa30f
Fix docs (#1260)
davide-f Dec 23, 2024
57900e7
Merge branch 'main' into devContainers
GbotemiB Dec 23, 2024
afd9712
Include dev container and docker feature
GbotemiB Dec 23, 2024
5c5c2b0
Restore environment (#1048)
ekatef Dec 23, 2024
4760a39
Update welcome message
GbotemiB Dec 23, 2024
c931b51
Update devcontainer.yml
GbotemiB Dec 23, 2024
1c3e3f4
Update Docker.MD
GbotemiB Dec 23, 2024
65c1ca3
Update Docker.MD
GbotemiB Dec 23, 2024
3106356
Update Docker.MD
GbotemiB Dec 23, 2024
5c96022
revert config.tutorial.yaml
GbotemiB Dec 23, 2024
0c042a0
Update docker_containers.rst
GbotemiB Dec 23, 2024
ee987ba
Merge branch 'main' into devContainers
GbotemiB Dec 23, 2024
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: 12 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// SPDX-FileCopyrightText: PyPSA-Earth and PyPSA-Eur Authors
//
// SPDX-License-Identifier: CC-BY-4.0
// For format details, see https://aka.ms/devcontainer.json.
{
"name": "pypsa earth dev",
"image": "ghcr.io/drifter089/pypsa-earth:latest",
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces,type=bind,consistency=cached",
"initializeCommand": "docker pull ghcr.io/drifter089/pypsa-earth:latest",
"workspaceFolder": "/workspaces",
"postAttachCommand": "bash .devcontainer/setup.sh"
}
6 changes: 6 additions & 0 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# SPDX-FileCopyrightText: PyPSA-Earth and PyPSA-Eur Authors
#
# SPDX-License-Identifier: CC-BY-4.0
#!/bin/sh

cat .devcontainer/welcome-message.txt
23 changes: 23 additions & 0 deletions .devcontainer/welcome-message.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# SPDX-FileCopyrightText: PyPSA-Earth and PyPSA-Eur Authors
#
# SPDX-License-Identifier: CC-BY-4.0



👋 Welcome to the PyPSA-Earth Development Environment!

We’re excited to have you here! This setup allows you to use and contribute to PyPSA-Earth using a development container in VS Code.

📖 Getting Started for New Users

• For a step-by-step guide on setting up your environment, debugging, and making your first contribution, refer to the PyPSA-Earth README here: (https://github.com/pypsa-meets-earth/pypsa-earth/blob/main/README.md). It covers everything you need to know as a newcomer.
• The configuration files for the development container are located in the .github/.devcontainer folder.

💡 Tips for New Users

• Make the most of VS Code by using the Command Palette (Cmd/Ctrl + Shift + P or F1) for quick access to features and commands.
• If you’re new to development containers, learn the basics at containers.dev.

🚀 Start Exploring and Happy Coding!

Don’t hesitate to reach out if you need help—our community is here to support you. You can access our discord server here: https://discord.gg/AnuJBk23FU
33 changes: 33 additions & 0 deletions .github/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "pypsa earth dev",
"build": {
"dockerfile": "../../Dockerfile"
},

"features": {
"ghcr.io/devcontainers-contrib/features/bash-command:1": {},
"ghcr.io/eliises/devcontainer-features/bash-profile:1": {}
},
"customizations": {
"vscode": {
"terminal.integrated.profiles.linux": {
"bash": {
"path": "/bin/bash"
}
},
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-azuretools.vscode-docker",
"ms-toolsai.jupyter",
"zainchen.json",
"tomoki1207.pdf",
"grapecity.gc-excelviewer"
]
}
},

"postCreateCommand": "python -m pip install --upgrade debugpy"
}
32 changes: 32 additions & 0 deletions .github/workflows/devcontainer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Dev Container Build and Push Image

on:
workflow_dispatch:
push:
branches: [main]
paths:
- envs/linux-pinned.yaml

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v1

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_TOKEN }}

- name: Build Dev Container Image
uses: devcontainers/ci@v0.3
with:
subFolder: .github
cacheFrom: ghcr.io/${{ github.repository }}-dev-env
imageName: ghcr.io/${{ github.repository }}-dev-env
push: always
4 changes: 3 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
on:
schedule:
- cron: "0 5 * * 0"
- cron: "0 5 1 * *"
workflow_dispatch:

jobs:
contrib-readme-job:
runs-on: ubuntu-latest
name: A job to automate contrib in readme
if: ${{ github.repository_owner == 'pypsa-meets-earth' && github.ref == 'refs/heads/main'}}
steps:
- name: Contribute List
uses: akhilmhdh/contributors-readme-action@v2.3.10
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/update-pinned-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ on:

jobs:
update-pinned-environment:
if: ${{ github.ref == 'refs/heads/main' }}
# the update is always needed for env changes in main and sometimes for other branches
if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' }}
name: Update pinned envs
runs-on: ${{ matrix.os }}-latest
strategy:
Expand Down
58 changes: 58 additions & 0 deletions Docker.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<!--
SPDX-FileCopyrightText: PyPSA-Earth and PyPSA-Eur Authors

SPDX-License-Identifier: AGPL-3.0-or-later
-->
# PyPSA-Earth Development Environment Setup with Docker

This guide provides an alternative way to set up a development environment for **PyPSA-Earth** using Docker containers. This method is particularly useful for users who are not familiar with programming or Python, or who prefer not to install Python directly on their local machine. Using Docker simplifies setup by creating a self-contained environment for PyPSA-Earth.

## Prerequisites

### 1. Install Docker

Ensure Docker is installed on your system. Follow the instructions for your operating system:

- **Windows**: [Docker for Windows](https://docs.docker.com/desktop/install/windows-install/)
- **Linux**: [Docker for Linux](https://docs.docker.com/desktop/install/linux/)
- **MacOS**: [Docker for MacOS](https://docs.docker.com/desktop/install/mac-install/)

### 2. Install Visual Studio Code(VSC)

You can use the link [here](https://code.visualstudio.com/download) to install Visual Studio Code on your operating system. Ensure to select the most compatible file for your operating system.

### 3. Install GitHub Desktop

You will also need GitHub Desktop to clone the PyPSA-Earth repository. Install GitHub Desktop for your operating system from [here](https://desktop.github.com/download/).

## Steps to Set Up PyPSA-Earth with Docker

### Step 1: Clone the Repository

1. Open **GitHub Desktop**.
2. Go to **File** > **Clone Repository**.
3. Paste the following URL in the URL field:

```bash
https://github.com/pypsa-meets-earth/pypsa-earth.git
```

4. Click on **Clone**.
5. Choose the location where you want to save the repository on your local machine.
6. After cloning, click on **Current Branch: main** and select `devContainers`.
7. Click on **Open in Visual Studio Code**.

### Step 2: Rebuild and Open in Container

1. Open the cloned repository in **VSCode**.
2. Click on the icon located at the bottom left corner of the VSCode window.
3. Select **Reopen in Container**.
4. Wait for the container to build and for the repository to open in the container.

Once these steps are completed, your development environment will be ready, and you can start using **PyPSA-Earth** in the Docker container.

---

You are now all set up! You can use the development environment to explore PyPSA-Earth and make modifications as needed within the Docker container.

You can start running the tutorial [here](https://pypsa-earth.readthedocs.io/en/latest/short_tutorial.html)
33 changes: 33 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# SPDX-FileCopyrightText: PyPSA-Earth and PyPSA-Eur Authors
#
# SPDX-License-Identifier: CC-BY-4.0
FROM condaforge/mambaforge

RUN conda update -n base conda
RUN conda install -n base conda-libmamba-solver
RUN conda config --set solver libmamba

RUN apt-get update && apt-get install -y bash git && apt-get install gcc -y

WORKDIR /pypsa-earth

COPY ./envs ./temp

RUN conda env create -n pypsa-earth -f temp/linux-pinned.yaml

RUN conda init bash

RUN touch ~/.bashrc && echo "conda activate pypsa-earth" >> ~/.bashrc

SHELL ["/bin/bash", "--login", "-c"]

ENV PATH /opt/conda/envs/pypsa-earth/bin:$PATH

RUN conda install conda-forge::openjdk -y

RUN rm -r temp

RUN conda clean -afy && \
rm -rf /tmp/*

CMD ["bash"]
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test:
snakemake solve_all_networks -call --configfile config.tutorial.yaml configs/scenarios/config.NG.yaml
snakemake solve_all_networks_monte -call --configfile config.tutorial.yaml test/config.monte_carlo.yaml
snakemake solve_all_networks -call --configfile config.tutorial.yaml test/config.landlock.yaml
snakemake -c4 solve_sector_networks --configfile config.tutorial.yaml test/config.test1.yaml
snakemake -c4 solve_sector_networks --configfile config.tutorial.yaml test/config.sector.yaml
echo "All tests completed successfully."

setup:
Expand All @@ -24,5 +24,5 @@ clean:
snakemake -j1 solve_all_networks --delete-all-output --configfile config.tutorial.yaml configs/scenarios/config.NG.yaml
snakemake -j1 solve_all_networks_monte --delete-all-output --configfile test/config.monte_carlo.yaml
snakemake -j1 run_all_scenarios --delete-all-output --configfile test/config.landlock.yaml
snakemake -j1 solve_sector_networks --delete-all-output --configfile test/config.test1.yaml
snakemake -j1 solve_sector_networks --delete-all-output --configfile test/config.sector.yaml
echo "Clean-up complete."
Loading