fix: resolve constant-constant constraint crashes and document H2 limits config - #190
Open
omari91 wants to merge 5 commits into
Open
fix: resolve constant-constant constraint crashes and document H2 limits config#190omari91 wants to merge 5 commits into
omari91 wants to merge 5 commits into
Conversation
for more information, see https://pre-commit.ci
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before asking for a review for this PR make sure to complete the following checklist:
Changes proposed in this Pull Request
n.model.add_constraints(...)calls with a newsafe_add_constraint(...)wrapper function inscripts/pypsa-de/additional_functionality.py. This safely bypasses adding inequality constraints where both the left-hand side and right-hand side resolve to 0 (which previously caused solvers like Highs/Gurobi to crash withValueError: Both sides of the constraint are constant).safe_add_constraintsystematically across functions such ash2_import_limits,h2_production_limits,capacity_limits,limit_co2, andauxiliary_flow_limits.h2_import_limits()that manually checked for empty links, as the new wrapper handles this automatically.pypsa-de.h2_import_limits.enableconfiguration toggle inconfig.de.yaml.Checklist
Required:
Changelog.md.If applicable:
scripts/lib/validation. (N/A: no pypsa-de schemas were found)doc/*.rstfiles. (N/A)