Skip to content

feat: set pypsa options via .env file#1531

Merged
lkstrp merged 8 commits intoPyPSA:masterfrom
lkstrp:dotenv-support
Feb 3, 2026
Merged

feat: set pypsa options via .env file#1531
lkstrp merged 8 commits intoPyPSA:masterfrom
lkstrp:dotenv-support

Conversation

@lkstrp
Copy link
Copy Markdown
Member

@lkstrp lkstrp commented Jan 19, 2026

Addition to #1513

@lkstrp lkstrp requested a review from coroa January 19, 2026 17:02
Copy link
Copy Markdown
Member

@coroa coroa left a comment

Choose a reason for hiding this comment

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

That is all looking good

Comment on lines +52 to +53
2. **`.env` file**: Via `python-dotenv` (if installed)
3. **Environment variables**: `PYPSA_*` (loaded once at import time)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't the priority be switched? .env with higher prio than env vars? Or am I confused?

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.

Convention is that env vars have higher priority, which is also default of dotenv

@euronion
Copy link
Copy Markdown
Contributor

Sweet <3

@lkstrp lkstrp enabled auto-merge (squash) January 26, 2026 17:02
@lkstrp lkstrp merged commit d742b44 into PyPSA:master Feb 3, 2026
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants