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 electrification profiles to change table #596

Merged
merged 11 commits into from
Mar 30, 2022
Merged

Conversation

jenhagg
Copy link
Collaborator

@jenhagg jenhagg commented Mar 10, 2022

Purpose

Define/implement new schema for electrification profiles and scaling by grid/zone.

What the code is doing

Define one new function add_electrification which can specify profiles and scaling for supported types: currently these are building and transportation. If specifying scaling factors by zone, the zone name is checked against the current grid object. There isn't yet validation for the profile name/version, but I'll add that if the general approach looks good.

Depending on expected usage patterns, the schema could also be "inverted" by mapping profiles to zones and scaling factors, but I think either way has trade offs in how easy it is to specify the change table and how much code is required to aggregate the profiles during the preparation phase.

Testing

New unit tests.

Usage Example/Visuals

The tests are the best usage example. The full schema will look like:

{
    "building": {
        "grid": [scale_factors],
        "zone": { zone_name: [scale_factors], ... }
    },
    "transportation": {...}
}

Where the scale_factors dict has the structure:

{profile_name_and_version_1: s_1, profile_name_and_version_2: s_2, ...} 

And 0 <= s_i <= 1

Time estimate

20 min

@jenhagg jenhagg self-assigned this Mar 10, 2022
@rouille
Copy link
Collaborator

rouille commented Mar 10, 2022

Not sure I understand why you constrain the scaling factors to be less than 1

@danielolsen
Copy link
Contributor

danielolsen commented Mar 10, 2022

Not sure I understand why you constrain the scaling factors to be less than 1

We can't change more than 100% of e.g. fossil fuel heating to electrified heating, and the profiles that we're getting from the collaborators represent 100% conversion of fossil end uses to 100% of one particular technology. See #574 for more details.

@BainanXia
Copy link
Collaborator

Not sure I understand why you constrain the scaling factors to be less than 1

The scaling factor here is essentially adoption rate.

@jenhagg jenhagg force-pushed the jon/electrification branch from c4ad40a to b240822 Compare March 10, 2022 17:28
@danielolsen
Copy link
Contributor

I like the examples shown in the tests. Being able to scale across the whole grid is a nice addition!

@rouille
Copy link
Collaborator

rouille commented Mar 11, 2022

I like the examples shown in the tests. Being able to scale across the whole grid is a nice addition!

Should we implement it for other methods?

@danielolsen
Copy link
Contributor

Should we implement it for other methods?

Eventually, yeah. There are lots of potential improvements to the ChangeTable logic/interface.

@jenhagg jenhagg force-pushed the jon/electrification branch from b240822 to afd089d Compare March 14, 2022 20:34
@jenhagg jenhagg force-pushed the jon/electrification branch from afd089d to d9a3790 Compare March 17, 2022 00:12
@jenhagg jenhagg marked this pull request as ready for review March 17, 2022 00:15
@jenhagg jenhagg changed the title Prototype - add electrification profiles to change table Add electrification profiles to change table Mar 17, 2022
@jenhagg jenhagg force-pushed the jon/electrification branch from d9a3790 to 71b11d1 Compare March 17, 2022 01:02
@danielolsen
Copy link
Contributor

Looking at this, I realize that I specified this feature incompletely. I think we need one more layer of nesting in the change table schema, because we have multiple end uses within each of buildings and transportation. So we would go from [buildings/transportation][zone/grid][technology] = adoption to [buildings/transportation][zone/grid][end_use][technology] = adoption. Currently we have:

info = {
    "New York City": {"advanced_heat_pump_v2": 0.7},
    "Western North Carolina": {
        "standard_heat_pump_v1": 0.5,
        "advanced_heat_pump_v2": 0.5,
    },
}

But I think we need something more like:

info = {
    "New York City": {
        "res_heating": {"advanced_heat_pump_v2": 0.7},
        "com_hot_water": {"advanced_heat_pump_v2": 0.7},
        "res_cooking": {"mid_efficiency": 0.5, "high_efficiency": 0.3},
    },
    "Western North Carolina": {
        "res_heating": {
            "standard_heat_pump_v1": 0.5,
            "advanced_heat_pump_v2": 0.5,
        },
    },
}

Adoption rates for various technologies still need to sum to less than one for a given (class, zone, end use). Sorry for the bad spec.

@jenhagg jenhagg force-pushed the jon/electrification branch from 2f7a87a to 90a5fe4 Compare March 24, 2022 21:56
@jenhagg jenhagg force-pushed the jon/electrification branch from 90a5fe4 to 257fb91 Compare March 29, 2022 00:14
@jenhagg jenhagg force-pushed the jon/electrification branch from 257fb91 to 51d26e2 Compare March 30, 2022 18:53
Copy link
Collaborator

@rouille rouille left a comment

Choose a reason for hiding this comment

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

Nice

@jenhagg jenhagg merged commit 4cef73d into develop Mar 30, 2022
@jenhagg jenhagg deleted the jon/electrification branch March 30, 2022 20:12
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