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

Feature uncontrolled vs controlled charging #338

Conversation

adrienmellot
Copy link
Contributor

@adrienmellot adrienmellot commented Apr 10, 2024

This PR does not fix any issue but is a step towards fixing #274 , #273 , #81 .

This separates fully electrified road transport demand into a controlled part (for now, as an annual demand to be met without any constraints), and an uncontrolled part (as a fixed timeseries profile). This share is a parameter to be decided by in the config file.

To note:

  • There is an inconsistency with the override "keep-historic-electricity-demand-from-road-transport" because we've assumed historical electrified transport to be uncontrolled. If you activate the override, you are still counting this electricity demand as uncontrolled.

Co-authored by: Francesco Sanvito sanvitofrancesco@gmail.com

Checklist

Any checks which are not relevant to the PR can be pre-checked by the PR creator. All others should be checked by the reviewer. You can add extra checklist items here if required by the PR.

  • CHANGELOG updated
  • Minimal workflow tests pass
  • Tests added to cover contribution
  • Documentation updated
  • Configuration schema updated

Copy link
Member

@brynpickering brynpickering left a comment

Choose a reason for hiding this comment

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

A few comments to address

Snakefile Outdated
@@ -98,7 +99,7 @@ rule all_tests:


rule dummy_tech_locations_template: # needed to provide `techs_and_locations_template` with a locational CSV linked to each technology that has no location-specific data to define.
message: "Create empty {wildcards.resolution} location-specific data file for the {wildcards.tech_group} tech `{wildcards.tech}`."
message: "Create empty {wildcards.resolution} location-specific data file for the {wildcards.tech_group} tech `{wildcards.tech}`." # Not used only if ruleorder is updated at top of file
Copy link
Member

Choose a reason for hiding this comment

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

Maybe update to: Update ruleorder at the top of the file if you instead want the techs_and_locations_template rule to be used to generate a file

@@ -162,6 +162,7 @@ parameters:
coaches-and-buses: Motor coaches, buses and trolley buses
passenger-cars: Passenger cars
motorcycles: Powered 2-wheelers
uncontrolled-charging-share: 0.5
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
uncontrolled-charging-share: 0.5
uncontrolled-ev-charging-share: 0.5

@@ -1,7 +1,7 @@
"""Rules to process transport sector data."""


rule download_transport_timeseries:
rule download_transport_timeseries: # TODO have correct timeseries data once RAMP has generated the new charging profile and it's been put on Zenodo
Copy link
Member

Choose a reason for hiding this comment

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

Add the TODO on the line below. Makes it easier to read

script: "../scripts/transport/road_transport_timeseries.py"


use rule create_road_transport_timeseries as create_road_transport_timeseries_historic_electrification with:
message: "Create timeseries for historic electrified road transport demand"
use rule create_uncontrolled_road_transport_timeseries as create_unctronolled_road_transport_timeseries_historic_electrification with:
Copy link
Member

Choose a reason for hiding this comment

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

spelling

"build/data/transport/timeseries/timeseries-coaches-and-buses.csv",
"build/data/transport/timeseries/timeseries-passenger-cars.csv",
"build/data/transport/timeseries/timeseries-motorcycles.csv"),
"build/data/transport/timeseries/timeseries-uncontrolled-light-duty-vehicles.csv",
Copy link
Member

Choose a reason for hiding this comment

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

Turn this into a for loop that uses the keys from the config to decide what needs to be built.

.sub(total_historically_electrified_distance.rename("value"), fill_value=0)
.to_csv(snakemake.output.road_distance_uncontrolled)
)
road_distance_historically_electrified = ( # ASSUME historically electrified road consumption is all uncontrolled
Copy link
Member

Choose a reason for hiding this comment

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

put comment in its own line (above)

Copy link
Member

Choose a reason for hiding this comment

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

I haven't looked, but how close is this to a copy-paste of the uncontrolled python file? If it is very similar, we should consider using the two files with a controlled/uncontrolled flag that decides on the functions to use etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's fairly different, because the uncontrolled scripts generate timeseries per vehicle type which are then aggregated and rescaled per resolution. This last step is similar but still different because contains different data structures. The controlled script is actually closer to the rescale.py in the heat sector.

Copy link
Member

@brynpickering brynpickering left a comment

Choose a reason for hiding this comment

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

Need to also update docs customisation.md note "demand/electrified-transport.yaml"

locations:
{% for id, location in locations.iterrows() %}
{{ id }}.techs.demand_road_transport_electrified:
{{ id }}.techs.demand_road_transport_historic_electrified:
{{ id }}.techs.demand_road_transport_electrified_uncontrolled:
Copy link
Member

Choose a reason for hiding this comment

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

Needs controlled tech here too. I'd maybe update to:

{{ id }}.techs:
  demand_road_transport_electrified_uncontrolled:
  demand_road_transport_historic_electrified_uncontrolled:
  demand_road_transport_electrified_controlled:
  

parent: supply
carrier: electricity
constraints:
resource: file=demand/road-transport-historic-electrification.csv
resource: file=demand/uncontrolled-road-transport-historic-electrification.csv
resource_min_use: 1
Copy link
Member

Choose a reason for hiding this comment

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

should this be "force_resource"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've updated it, indeed I think it makes more sense

@brynpickering brynpickering merged commit 9a4de45 into calliope-project:develop Apr 11, 2024
4 checks passed
jnnr pushed a commit to jnnr/euro-calliope that referenced this pull request Aug 27, 2024
…ontrolled-charging-share

Feature uncontrolled vs controlled charging

Co-authored by: Francesco Sanvito sanvitofrancesco@gmail.com
jnnr pushed a commit to jnnr/euro-calliope that referenced this pull request Aug 27, 2024
…ontrolled-charging-share

Feature uncontrolled vs controlled charging

Co-authored by: Francesco Sanvito sanvitofrancesco@gmail.com
jnnr pushed a commit to jnnr/euro-calliope that referenced this pull request Sep 3, 2024
…ontrolled-charging-share

Feature uncontrolled vs controlled charging

Co-authored by: Francesco Sanvito sanvitofrancesco@gmail.com
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.

2 participants