Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Linopy to PyPSA-Eur #448

Closed
wants to merge 33 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
4f1364e
add battery constraint, not solvable
pz-max Dec 7, 2022
60d4fd0
test reserve constraint, broadcast error at solving
pz-max Dec 7, 2022
2897838
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 7, 2022
7192f79
remove compat.py, fix battery constraint
pz-max Dec 12, 2022
5e599c6
fix merge conflict
pz-max Dec 12, 2022
bcf04e0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 12, 2022
d9a73ea
fix add_BAU_constraint
pz-max Dec 12, 2022
5605bb8
resolve merge conflict
pz-max Dec 12, 2022
f14d8e8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 12, 2022
48c4817
fix docstring
pz-max Dec 12, 2022
b6ca301
add safe constraint
pz-max Dec 12, 2022
722248a
fix merge conflict
pz-max Dec 12, 2022
da81576
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 12, 2022
4626d5a
remove merge conflict notes
pz-max Dec 12, 2022
0e6191d
fix typo
pz-max Dec 12, 2022
ff84025
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 12, 2022
d919553
Merge branch 'master' into linopy
pz-max Dec 12, 2022
21946b3
rewrite BAU constraint fix EQ constraint
pz-max Dec 15, 2022
18c73d0
convert reserve constraint to Linopy
pz-max Dec 16, 2022
bde3075
fix CCL constraint for one country
pz-max Dec 18, 2022
01ba3e8
Merge branch 'master' into linopy
pz-max Dec 18, 2022
a2cb6a9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 18, 2022
34f1b49
clean import and variables
pz-max Dec 18, 2022
a7a3698
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 18, 2022
21c7fd7
fix reserve constraint for multiple countries by sum correction
pz-max Dec 19, 2022
df4f7d9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 19, 2022
1f27074
fix CCL and code cleanup
pz-max Dec 20, 2022
b7501db
solve merge conflict
pz-max Dec 20, 2022
48c287d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 20, 2022
7dd5665
Merge branch 'master' into linopy
pz-max Dec 20, 2022
781d53c
Merge branch 'master' into linopy
pz-max Jan 10, 2023
2db860a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 10, 2023
6008285
Merge branch 'master' into linopy
pz-max Mar 9, 2023
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
Prev Previous commit
Next Next commit
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 12, 2022
commit f14d8e8aa7a100e07e4958fd65628cba3c6cc079
11 changes: 5 additions & 6 deletions scripts/solve_network_linopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,13 @@ def add_BAU_constraints(n, config):
"""
Constraint enforces minimum generation expansion shared between carriers.

Requires to specify BAU_mincapacities in config.yaml.
Requires to specify BAU_mincapacities in config.yaml.

Parameters
----------
n : pypsa.Network
config : dict

Example
-------
config.yaml requires to specify BAU_mincapacities:
Expand All @@ -261,9 +261,8 @@ def add_BAU_constraints(n, config):
capacity_variable = n.model["Generator-p_nom"]
ext_i = n.generators.query("p_nom_extendable")
ext_carrier_i = ext_i.carrier.rename_axis("Generator-ext").rename("Generator-ext")
lhs = (
linopy.LinearExpression.from_tuples((1, capacity_variable))
.groupby_sum(ext_carrier_i)
lhs = linopy.LinearExpression.from_tuples((1, capacity_variable)).groupby_sum(
ext_carrier_i
)
rhs = mincaps[lhs.coords["Generator-ext"].values].rename_axis("Generator-ext")
n.model.add_constraints(lhs, ">=", rhs, "bau_mincaps")
Expand Down Expand Up @@ -365,7 +364,7 @@ def add_operational_reserve_margin(n, sns, config):
https://genxproject.github.io/GenX/dev/core/#Reserves.
"""
add_operational_reserve_margin_constraint(n, sns, config)
#update_capacity_constraint(n)
# update_capacity_constraint(n)


def add_battery_constraints(n):
Expand Down