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

Improve inputs for buildings retrofit calculations #800

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

ekatef
Copy link
Contributor

@ekatef ekatef commented Dec 11, 2023

Changes proposed in this Pull Request

The PR is intended to update building stock data used in calculations for retrofitting costs. The following changes are suggested.

  1. Integrate updated hotmaps data taken from gitlab repo.
  2. Removes a patch for Poland, which may be replaced by a recent fix of data structure: the problem for Poland was caused by using a singular form for Construction features (U-value) instead of plural.

Checklist

  • I tested my contribution locally and it seems to work fine.
  • Code and workflow changes are sufficiently documented.
  • Changed dependencies are added to envs/environment.yaml.
  • Changes in configuration options are added in all of config.default.yaml.
  • Changes in configuration options are also documented in doc/configtables/*.csv.
  • A release note doc/release_notes.rst is added.

@ekatef
Copy link
Contributor Author

ekatef commented Dec 12, 2023

Not sure about a proper strategy to add the updated hotmaps dataset to the repo.

Data inputs for retrofitting are committed into data/retro/ and we could add the updated hotmaps there, but currently data folder is git-ignored. Which probably implies that this way is not a preferable one.

Apart of that, not sure it we want to keep the previous version of hotmaps dataset, or replace it with an updated version.

@martacki what is you vision of the points above?

rules/build_sector.smk Outdated Show resolved Hide resolved
@ekatef ekatef marked this pull request as ready for review March 15, 2024 22:09
@ekatef
Copy link
Contributor Author

ekatef commented Mar 15, 2024

The PR was put on hold for quite a while due to some anomalies found in the response on the data update. After digging into the data, it has been found that the anomalies are linked with the structure of the data updates itself.

The PR is ready for review, but may need some additional local testing to ensure that it's fully consistent with all the latest changes.

Update: the local testing successful with an additional pandas-related fix.

@martacki please, feel free to review, when you have time 🙂

@ekatef
Copy link
Contributor Author

ekatef commented Mar 27, 2024

Update: added a number of additional maintenance fixes to address recent pandas deprecations:

@ekatef
Copy link
Contributor Author

ekatef commented Mar 28, 2024

As a comment, these updates of hotmaps data are in fact application of some country-specific scaling coefficients. That is an example of how data structure looks like:

image

The testing has confirmed that these changes are accurately transferred to the building stock data in the model, and effect mainly the overall area data floor_area_elec_s_{n_clusters}.csv.

Copy link
Member

@martacki martacki left a comment

Choose a reason for hiding this comment

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

Hi @ekatef I tried to evaluate your implementation, comparing the resulting non-annualised costs both from your implementation as well as from the master branch (that's why I merged master).
Also, I compared the resulting p_nom_max values for retrofitting. Here are the results:

comparing costs, there are small differences of below 1 EUR/m2 for most countries, which I'd ignore. 1-2%, seems reasonable.

Only for PL, the results are quite heavy, but only for costs, not for the potential dE savings:
For the residential sector, the costs are exactly 50% compared to the current master branch, for services they're exactly 2/3 and the total costs are 65% of the costs for the master branch (moderate scenario).

For the ambitious scenario, the residential is also exactly 50% of what's in current master, but the costs for the services sector is also exactly 50%. Therefore, total is also 50%. I wonder what is the impact on Poland?

When looking on the potential (how much "MW" of retrofitting can be installed), the update to new HOTMAPS does have a larger impact (positive means that the new potential is smaller than before):
comparison
comparisonp
But given that the differences are also below 3%, I'd say that that's fine.

The generation profile is exactly the same in both branches (p_min_pu and p_max_pu)

I'd say this looks good, it would be just useful to understand the impact on PL, mainly on the costs. I understand that you're suggesting to use the HOTMAPS data for PL, instead of Eurostat data. Maybe this is where the huge difference comes from? Would be good to know which of these sources is more accurate.

@martacki
Copy link
Member

martacki commented Apr 17, 2024

Had also a look into the capital_costs of the prepared network (not the EUR/m2, but the resulting costs after multiplying the costs per m2 with the floor area), and here's the result - which will have the biggest impact (annualised costs) on the results: (positive means the costs are now lower, negative numbers mean they're higher).

comparison
comparisonp

looks in line with the plot you posted, however I'm a bit worried about the tremendous increase of costs with the new update, retrofitting will be 60-100% more expensive in approx. half of all the countries...

@fneum
Copy link
Member

fneum commented May 20, 2024

Let me know when this should be reviewed to go into the master. It would be good to have a rough sense for where the cost differences come from.

The added input file should definitely not be part of the git repository.

I would switch to a remote input and also purge the file from the git history:

Purging

pip install git-filter-repo
git filter-repo --path data/retro/data_building_stock.csv --invert-paths
git push origin --force --all

Remote Input

rule ...:
    input:
        building_stock=storage(
            "https://gitlab.com/hotmaps/building-stock/-/raw/master/data/building_stock.csv",
            keep_local=True,
        ),

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.

3 participants