Skip to content

feat: add pypsa explorer to workflow#443

Merged
gincrement merged 8 commits intomasterfrom
feat/266-pypsa-explorer
Feb 9, 2026
Merged

feat: add pypsa explorer to workflow#443
gincrement merged 8 commits intomasterfrom
feat/266-pypsa-explorer

Conversation

@daniel-rdt
Copy link
Copy Markdown
Member

@daniel-rdt daniel-rdt commented Feb 4, 2026

Closes #266.

Changes proposed in this Pull Request

This PR proposes to add the PyPSA explorer to the workflow.

The PyPSA-Explorer will be launched on the first available port between 8050 and 8100 and a browser tab with the launched explorer will automatically pop open.

The explorer will be launched with the result networks of a scenario. This means if three scenarios are executed in parallel three different explorers are launched on different ports.

Tasks

  • Verify that the explorer actually pops open on all machines.

Workflow

Two new rules are added to the workflow and new configuration switch is added that controls the launch of the explorer.

  • (new) configuration switch launch_explorer: Switch to launch the explorer, per default this is False and also for the test configuration. It is True for config/config.tyndp.yaml
  • (new) rule launch_explorer that is added to the workflow under SB: Will launch the PyPSA-Explorer with all planning horizon networks.
  • (new) rule close_explorers that is also added under SB: Will close all open instances of the PyPSA-Explorer freeing up ports again.

Open issues

Notes

Checklist

  • I tested my contribution locally and it works as intended.
  • Code and workflow changes are sufficiently documented.
  • Changed dependencies are added to pixi.toml (using pixi add <dependency-name>).
  • Changes in configuration options are added in config/config.default.yaml.
  • Changes in configuration options are added in config/test/*.yaml.
  • Open-TYNDP SPDX license header added to all touched files.
  • New rules are documented in the appropriate doc/*.rst files.
  • A release note doc/release_notes.rst is added.
  • Major features are documented with up-to-date information in README and doc/index.rst.
  • Module docstrings added to new Python scripts.

@daniel-rdt daniel-rdt added this to the Release v0.6 milestone Feb 4, 2026
@daniel-rdt daniel-rdt self-assigned this Feb 4, 2026
@daniel-rdt daniel-rdt added the SB Scenario Building label Feb 4, 2026
@daniel-rdt daniel-rdt marked this pull request as ready for review February 4, 2026 10:31
@daniel-rdt daniel-rdt requested review from lisazeyen and tgilon and removed request for lisazeyen and tgilon February 4, 2026 10:31
Copy link
Copy Markdown
Collaborator

@lisazeyen lisazeyen left a comment

Choose a reason for hiding this comment

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

Great @daniel-rdt I have opened the Explorer with the test config and everything was working smoothly. I am just not sure that the current implementation is working with Windows, there is on Linux/Unix specific command which maybe is going to cause troubles. Can you find a way around? Sorry, I didn't have the the time to make any concrete suggestions on how to change it.

Comment thread rules/sb.smk Outdated
@daniel-rdt
Copy link
Copy Markdown
Member Author

daniel-rdt commented Feb 5, 2026

Great @daniel-rdt I have opened the Explorer with the test config and everything was working smoothly. I am just not sure that the current implementation is working with Windows, there is on Linux/Unix specific command which maybe is going to cause troubles. Can you find a way around? Sorry, I didn't have the the time to make any concrete suggestions on how to change it.

Thanks @lisazeyen good catch! I've consulted with Claude and docs and it seems that using an alternate argument on Windows will solve the problem.

Since I can't test this however, maybe @cdgaete you could try this out on your Windows machine?
You can try to simply run the test config with

snakemake -c1 all --configfiles config/test/config.tyndp.yaml

Note that you will have to set launch_explorer: true in the test config first.

Copy link
Copy Markdown
Collaborator

@lisazeyen lisazeyen left a comment

Choose a reason for hiding this comment

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

LGTM but probably still good if somebody runs a test on windows. You could also try to run it on one of the VM for Windows from OET.

@daniel-rdt
Copy link
Copy Markdown
Member Author

LGTM but probably still good if somebody runs a test on windows. You could also try to run it on one of the VM for Windows from OET.

Thanks! Definitely would like to test it on a Windows machine first. I am not quite sure it will be possible to test the automatic pop open of the browser tab on the VM though.

@gincrement
Copy link
Copy Markdown
Member

@daniel-rdt, I test it on my Windows machine ...

@gincrement
Copy link
Copy Markdown
Member

@daniel-rdt No browser popup observered using WIndows (WSL).
Would just add the note "Launch the PyPSA Network Explorer via browser assessing http://127.0.0.1:8050" (or so).

@daniel-rdt
Copy link
Copy Markdown
Member Author

@daniel-rdt No browser popup observered using WIndows (WSL). Would just add the note "Launch the PyPSA Network Explorer via browser assessing http://127.0.0.1:8050" (or so).

Thanks @gincrement for testing this. I unfortunately do not have time before the next release to address the issue properly to make the pop out work on Windows. I will add a logger info for now for users to access the explorer in case it does not pop open automatically. We can improve this with a follow up. I opened an issue #460 to follow up on this.

@daniel-rdt
Copy link
Copy Markdown
Member Author

@gincrement Added the message. Would be great if you could test this a final time before maybe @lisazeyen can merge this on Monday to include in our release v0.5. Thanks both! :)

@tgilon tgilon mentioned this pull request Feb 9, 2026
39 tasks
@gincrement
Copy link
Copy Markdown
Member

Shows the message as expected. Good for now!!

@gincrement gincrement merged commit b5cf1f1 into master Feb 9, 2026
6 checks passed
@gincrement gincrement deleted the feat/266-pypsa-explorer branch February 9, 2026 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

SB Scenario Building

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SUB] Integrate PyPSA-Explorer in workflow

3 participants