Building quintiles#612
Conversation
frede-arp
commented
May 22, 2026
- added better historic population data (per IMAGE region from 1700): https://ourworldindata.org/grapher/population
- added income quintiles for building material calculations
- therefore basically the whole population calcaultion was redone
- some refactoring for floorspace, to also incorporate the income quintiles
- therefore new prism model needed as new dimension added
- changed the building examples accordingly
… checking (small changes in historic values)
There was a problem hiding this comment.
I think there are some small changes to documentation that should be done.
I also have some questions about the design, especially the addition of the two new prism models, mostly from a maintenance perspective. But I cannot follow the entire implementation sufficiently at the moment to judge if these classes are indeed needed.
otherwise nice that the data was updated!
| Returns | ||
| ------- | ||
| xr.DataArray | ||
| Combined population array with dimensions ``("Area", "Quintile", "Time", "Region")``. |
There was a problem hiding this comment.
I understand why we need the new Quintile dimension. However, I am wondering of that could lead to issues with harmonization across sectors later. But that is mostly just a thought not a critique on this code
| """Compute the population throught time for all regions, and rural/urban. | ||
|
|
||
| def _equalize_quintiles(population_split: xr.DataArray, q_labels: list[str], target_area: str) -> xr.DataArray: | ||
| """Set all quintiles in a group to equal shares of a target area. |
There was a problem hiding this comment.
To me this description is not fully understandable. Could you add another sentence as to why all quintiles get an equal share?
There was a problem hiding this comment.
quintiles are per definition an equal share. SO every population quintile is the same amount of people. For historic years, where we do not have image population, these were first extrapolated according regions, rural, urban and then equalized alond the quintiles
| } | ||
|
|
||
| area_labels = { | ||
| 1: "Total", |
There was a problem hiding this comment.
Theoretically it looks like this could be done using a knowledge graph too using the quintiles and sub categories of urban-rural which sums up to total.
There was a problem hiding this comment.
but the labels are used in a context outside of knowledge graph, But yes, could be done later
| class StocksQuintiles(prism.Model): | ||
| """Stock class that can be used for different products. | ||
| A model class for managing stocks and their inflows and outflows over time, | ||
| including the computation of initial and dynamic stock values based on input data. |
There was a problem hiding this comment.
Maybe still add the quintiles part to this description?
| Type: prism.Coords[STOCK_TYPE] | ||
| Cohort: prism.Coords[COHORT] | ||
| Time: prism.Coords[TIME] | ||
| Quintile: prism.Coords[QUINTILE] |
There was a problem hiding this comment.
Is the main difference to the previous stock class that the quintile dimension was added? if so maybe we could simplify by making the previous class able to include that instead of creating a new class?
There was a problem hiding this comment.
that is a prism problem.
All dimensions used need to be determined in the class. So this is just not possible.
In the vehicles model e.g. you also need to specifiy SuperType and Type as Dimensions.
| """ | ||
| A model class for managing materials used in stock cohorts, including | ||
| inflows and outflows of materials. This version uses material intensities | ||
| (material per unit of stock) instead of weights and material fractions. |
There was a problem hiding this comment.
Also missing a description as to why we need this additional class to allow for the quintile calculation. So same question as for the stock class.
There was a problem hiding this comment.
added, see comment above
…e-materials into building_quintiles