PyPSA / PyPSA/pypsa-usa

Revise urban/rural popualtion assignments

Open
#72 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Sector
Dominant language
Python
Stars
148
Forks
55
Avg merge
2d 11h
Merged PRs (30d)
18

Description

Feature Request

In PyPSA-Eur, general urban/rural rates are given at a country level, then rural cells are assigned based on population density until the rural percentage for the country is reached.

In the rule build_population_layout, the rural and urban population are assigned on a county by county level. In some cases, where the county is smaller then a cell cutout, I believe some odd behaviour is happening. Therefore, rural/urban rates are the same for each cell in a county.

It would be nice to synchronize logic with PyPSA-Eur.

Suggested Solution

Commented code in build_population_layout.py has a suggested implementation.

https://github.com/PyPSA/pypsa-usa/blob/67c0d271bffff65a9127e05616fa8ceb7d8a9f95/workflow/scripts/build_population_layouts.py#L176-L236

Additional Info

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with build_population_layout.py and compare its commented implementation with the referenced PyPSA-Eur build_population_layouts.py section. Trace how rural and urban populations are assigned across counties and cells, then verify that the resulting rates match the PyPSA-Eur logic, including counties smaller than a cell cutout.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.