-
Notifications
You must be signed in to change notification settings - Fork 249
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 option for carbon capture in integrated steelworks (Sourcery refactored) #753
Conversation
if isinstance(item, dict): | ||
return item[investment_year] | ||
else: | ||
return item | ||
return item[investment_year] if isinstance(item, dict) else item |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function get
refactored with the following changes:
- Replace if statement with if expression (
assign-if-exp
)
scripts/prepare_sector_network.py
Outdated
if snakemake.wildcards.clusters[-1:] == "m": | ||
genmap = busmap_s | ||
else: | ||
genmap = clustermaps | ||
|
||
genmap = busmap_s if snakemake.wildcards.clusters[-1:] == "m" else clustermaps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function update_wind_solar_costs
refactored with the following changes:
- Replace if statement with if expression (
assign-if-exp
)
scripts/prepare_sector_network.py
Outdated
to_drop = list(n.buses.query("carrier not in ['AC', 'DC']").carrier.unique()) | ||
if to_drop: | ||
if to_drop := list( | ||
n.buses.query("carrier not in ['AC', 'DC']").carrier.unique() | ||
): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function remove_non_electric_buses
refactored with the following changes:
- Use named expression to simplify assignment and conditional (
use-named-expression
)
augmentation = list( | ||
if augmentation := list( | ||
k_edge_augmentation(G, k_edge, avail=complement_edges.values) | ||
) | ||
|
||
if augmentation: | ||
): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function add_storage_and_grids
refactored with the following changes:
- Use named expression to simplify assignment and conditional (
use-named-expression
)
for more information, see https://pre-commit.ci
Pull Request #719 refactored by Sourcery.
If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.
NOTE: As code is pushed to the original Pull Request, Sourcery will
re-run and update (force-push) this Pull Request with new refactorings as
necessary. If Sourcery finds no refactorings at any point, this Pull Request
will be closed automatically.
See our documentation here.
Run Sourcery locally
Reduce the feedback loop during development by using the Sourcery editor plugin:
Review changes via command line
To manually merge these changes, make sure you're on the
blast-furnace-with-cc
branch, then run:Help us improve this pull request!