Skip to content
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
111ccb8
feat: add windows installer
coroa Dec 17, 2025
cca7a79
fix: use python unbuffered on windows
coroa Dec 17, 2025
1521ce0
fix: install git into windows environment
coroa Dec 17, 2025
3a57786
fix: windows installer needs to locate binaries first
coroa Dec 18, 2025
6370764
feat: add shell script for building windows installer
coroa Dec 18, 2025
8e12d4b
fix: Speed up uninstalling by batch removing directories first
coroa Dec 18, 2025
a32d411
fix: gitignore installer build artifacts
coroa Dec 18, 2025
e247c8d
fix: small fixes to windows installer
coroa Dec 18, 2025
23aad3d
fix(installer): clean up wording slightly
coroa Dec 18, 2025
65cdc18
feat: bundle repository into windows installer
coroa Dec 18, 2025
c1b01aa
fix: make sure no spaces are in repository directory
coroa Dec 18, 2025
e2f573d
feat: add gh workflow to build and attach the windows installer to re…
coroa Dec 18, 2025
3134006
Add documentation and release notes
coroa Dec 18, 2025
70b7287
Update pixi.lock
coroa Dec 18, 2025
413c192
Updates README.md
coroa Dec 18, 2025
5476bb9
fix: remove pixi from installer name
coroa Dec 18, 2025
4a7a7ea
fix: add INSTDIR to PATH
coroa Dec 19, 2025
7f4b99d
fix: install snakemake from open-tyndp channel
coroa Jan 2, 2026
7fc3c91
feat: make pixi environment install optional
coroa Jan 2, 2026
6edcc1b
fix: add version constraints
coroa Jan 3, 2026
13a809e
fix: update snakemake-minimal to 9.14.5+opentyndp.1
coroa Jan 5, 2026
312360e
fix: compatibility of build_gas_* rules with pyogrio >=0.12.0
coroa Jan 5, 2026
4acaff0
fix: apply suggestions from thomas
coroa Jan 7, 2026
4359f3a
Apply suggestion from Thomas on windows-installer Readme
coroa Jan 7, 2026
f5b23a7
fix(docs): fix installation heading levels
coroa Jan 7, 2026
c3746d7
fix typo
coroa Jan 7, 2026
af27714
Update pixi.toml
coroa Jan 7, 2026
73b9de1
doc: add installer in the documentation
tgilon Jan 8, 2026
3adcb15
Merge branch 'master' into feat/add-windows-installer
tgilon Jan 8, 2026
8305723
Merge branch 'master' into feat/add-windows-installer
tgilon Jan 8, 2026
d121000
chore: solve merge conflicts
tgilon Jan 8, 2026
d76983c
Merge branch 'master' into feat/add-windows-installer
tgilon Jan 8, 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
53 changes: 53 additions & 0 deletions .github/workflows/release-installer.yaml

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is difficult to review. Have you tested it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this is still untested. it would need to be run on an existing release. i think i could run it on 0.4.1.

@coroa coroa Jan 7, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd propose to merge this and #357 now and try to create a 0.4.2a1 release, ie. an alpha release.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good for me to release an alpha. Following the SemVer convention, I would suggest v0.4.2-alpha and mark it as a pre-release.

@coroa coroa Jan 8, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As always everyone has their own ideas about how stuff ideally looks like: Python packaging user guide, but python is flexible and will be fine with your suggestion too, ie check the section on normalization.

Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# SPDX-FileCopyrightText: Contributors to Open-TYNDP <https://github.com/open-energy-transition/open-tyndp>
#
# SPDX-License-Identifier: MIT

name: Build and Attach Installer to Release

on:
release:
types: [published]
workflow_dispatch:
inputs:
release_tag:
description: 'Release tag to attach installer to'
required: true
type: string

jobs:
build-and-attach-installer:
name: Build Windows Installer and Attach to Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.release.tag_name || inputs.release_tag }}

- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.9.3
with:
pixi-version: v0.59.0
cache: true
cache-write: false

- name: Get version from release tag
id: get_version
run: |
TAG="${{ github.event.release.tag_name || inputs.release_tag }}"
VERSION=${TAG#v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "tag=$TAG" >> $GITHUB_OUTPUT

- name: Build Windows installer
env:
VERSION: ${{ steps.get_version.outputs.version }}
run: |
utils/windows-installer/build_installer.sh

- name: Upload installer to release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release upload ${{ steps.get_version.outputs.tag }} utils/windows-installer/open-tyndp-*.exe --clobber
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,6 @@ CLAUDE.local.md

linopy-problem-*
linopy-solve-*

# Installer build artifacts
*.exe
Comment thread
tgilon marked this conversation as resolved.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ While multiple TYNDP features are already introduced to the Open-TYNDP model, th

## 1. Installation

### Option A: Windows Installer (Recommended for Windows)

For Windows users, download the latest installer (e.g., `open-tyndp-0.4.0-pixi-Windows-x86_64.exe`) from the [releases page](https://github.com/open-energy-transition/open-tyndp/releases) and run it. The installer automatically sets up everything you need, including pixi, the repository, and the conda environment. See `utils/windows-installer/README.md` for details.

### Option B: Manual Installation (All Platforms)

Clone the repository:

```sh
Expand Down
7 changes: 7 additions & 0 deletions REUSE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,10 @@ path = [
]
SPDX-FileCopyrightText = "Open Energy Transition gGmbH"
SPDX-License-Identifier = "MIT"

[[annotations]]
path = [
"utils/windows-installer/oet_logo.*",
]
SPDX-FileCopyrightText = "Open Energy Transition gGmbH"
SPDX-License-Identifier = "CC-BY-4.0"
Comment thread
tgilon marked this conversation as resolved.
23 changes: 23 additions & 0 deletions doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,29 @@ The subsequently described installation steps are demonstrated as shell commands
directory in which the commands following the ``%`` should be entered.


.. _windows_installer:

Windows Installer (Recommended for Windows)
============================================
Comment thread
coroa marked this conversation as resolved.
Outdated

For Windows users, the easiest way to install Open-TYNDP is using the automated installer. Download the latest installer executable (e.g., ``open-tyndp-0.4.0-pixi-Windows-x86_64.exe``) from the `GitHub releases page <https://github.com/open-energy-transition/open-tyndp/releases>`__ and run it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about releasing a v0.4.2 to get the installer attached to the latest release?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that would be ideal i think.


The installer will:

1. Install pixi package manager to ``%LOCALAPPDATA%\open-tyndp``
2. Extract the repository files to your chosen installation directory
3. Set up the conda environment automatically via ``pixi install``
4. Create Start Menu shortcuts for easy access:

- **Open-TYNDP PowerShell** - Launch PowerShell with environment activated
- **Open-TYNDP Command Prompt** - Launch Command Prompt with environment activated

For more details about the installer, see ``utils/windows-installer/README.md`` in the repository.

.. note::
If you prefer manual installation or need more control over the setup process, follow the instructions below for cloning the repository and installing dependencies manually.


.. _clone_repo:

Clone the Repository
Expand Down
2 changes: 2 additions & 0 deletions doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Release Notes
Upcoming Open-TYNDP Release
================

* Added automated Windows installer for easy setup on Windows systems. The installer bundles pixi, the repository, and sets up the conda environment automatically. Installer executables are automatically built and attached to GitHub releases. See ``utils/windows-installer/`` for details.


Upcoming PyPSA-Eur Release
================
Expand Down
19,781 changes: 9,358 additions & 10,423 deletions pixi.lock

Large diffs are not rendered by default.

16 changes: 14 additions & 2 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,18 @@

[workspace]
authors = ["Contributors to Open-TYNDP"]
channels = ["conda-forge", "bioconda", "gurobi"]
channels = ["conda-forge", "bioconda", "gurobi", "https://repo.prefix.dev/open-tyndp"]
name = "pypsa-eur"
platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"]
version = "0.1.0"

[target.win-64.activation.env]

# Local snakemake jobs often fail with status code 120, due to stdout/stderr interleaving
# on windows, running python unbuffered works around the issue. Ideally we would stop using
# stdout/stderr and use a proper logging infrastructure
PYTHONUNBUFFERED = "1"

[tasks]

reset = """bash -c '
Expand Down Expand Up @@ -63,13 +70,14 @@ matplotlib = ">=3.10.7"
memory_profiler = ">=0.61.0"
netcdf4 = ">=1.7.2"
networkx = ">=3.5"
numpy = ">=1.26.4"
numpy = ">=1.26.4,<2"
openpyxl = ">=3.1.5"
pandas = ">=2.1"
plotly = ">=6.4.0"
powerplantmatching = ">=0.5.15"
pre-commit = ">=4.3.0"
proj = ">=9.6.2"
pydeck = ">=0.8"
Comment thread
tgilon marked this conversation as resolved.
Outdated
pylint = ">=4.0.2"
pypsa = ">=0.35.2"
pyscipopt = ">=5.6.0"
Expand Down Expand Up @@ -179,8 +187,12 @@ tyndp = """bash -c '
all-tests = {depends-on = ["tyndp-sb-test", "tyndp-cba-test", "clean-tyndp", "integration-tests", "clean-tests", "unit-tests"]}

[feature.open-tyndp.dependencies]
snakemake-minimal = { version = ">=9", channel = "https://repo.prefix.dev/open-tyndp" }
Comment thread
coroa marked this conversation as resolved.
pixi-pycharm = ">=0.0.9"

[feature.open-tyndp.target.win-64.dependencies]
git = ">=2.52.0"

[environments]
doc = { features = ["doc"], no-default-feature = true }
test = ["test"]
Expand Down
4 changes: 2 additions & 2 deletions scripts/build_gas_input_locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@
production sites with data from SciGRID_gas and Global Energy Monitor.
"""

import json
import logging

import geopandas as gpd
import pandas as pd

from scripts._helpers import configure_logging, set_scenario_config
from scripts.build_gas_network import unnest_struct
from scripts.cluster_gas_network import load_bus_regions

logger = logging.getLogger(__name__)


def read_scigrid_gas(fn):
df = gpd.read_file(fn)
expanded_param = df.param.apply(json.loads).apply(pd.Series)
expanded_param = unnest_struct(df.param)
df = pd.concat([df, expanded_param], axis=1)
df.drop(["param", "uncertainty", "method"], axis=1, inplace=True)
df = df.loc[:, ~df.columns.duplicated()] # duplicated country_code column
Expand Down
11 changes: 8 additions & 3 deletions scripts/build_gas_network.py
Comment thread
tgilon marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,16 @@ def diameter_to_capacity(pipe_diameter_mm):
return a3 + m3 * pipe_diameter_mm


def unnest_struct(s):
if isinstance(s.iloc[0], str):
s = s.apply(json.loads)
return s.apply(pd.Series)


def load_dataset(fn):
df = gpd.read_file(fn)
param = df.param.apply(json.loads).apply(pd.Series)
cols = ["diameter_mm", "max_cap_M_m3_per_d"]
method = df.method.apply(json.loads).apply(pd.Series)[cols]
param = unnest_struct(df.param)
method = unnest_struct(df.method)[["diameter_mm", "max_cap_M_m3_per_d"]]
method.columns = method.columns + "_method"
df = pd.concat([df, param, method], axis=1)
to_drop = ["param", "uncertainty", "method", "tags"]
Expand Down
Loading