ImperialCollegeLondon / ImperialCollegeLondon/virtual_ecosystem
PlantsModel - moving to clear cohort / cell calculations
Open
@davidorme is already working on this.
Since Jul 27, 2026.
- Dominant language
- Python
- Stars
- 20
- Forks
- 5
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 34
Description
The current implementation nests cohort data within communities, but actually most calculations can be done in parallel across all cohorts, with cell_id recorded in self.cohorts. This should give clearer and faster code by restricting the amount of time spent in cell_id loops.
- The
communitiesattribute disappears. - The following attributes go from
dict[int, XYZ]to justXYZself.biomasses(This change probably has the most engineering and, since we want to rework the internals of Biomasses anyay, probably best done as a separate issue, although the temporary glue holding the join together would be finicky)self.stem_allocationsself.growth_incrementsself.per_stem_gpp(probably becomes a field inself.cohorts)self.per_stem_transpiration(also probably becomes a field inself.cohorts)
- The
self.canopiesattribute stays asdict[cell_id, Canopy]
The update flow would be:
- Mortality - applied across all cohorts (drop current
cell_idloop) - Recruitment - applied across all cohorts (drop current
cell_idloop) - Update allometry - a single StemAllometry object across cohorts. (drop current
cell_idloop updating community objects). - Herbivory - applied across all cohorts
- Calculate canopies - CELL level calculations (store cohort indices on canopy object).
- Update canopy layers - CELL level calculations.
- Subcanopy light capture - already in parallel across cells
- Calculate light use efficiency (already at cell by layer level).
- Estimate GPP - CELL level calculations, extract cohorts in each cell,
- Calculate nutrients - applied across all cohorts
- Allocate GPP - applied across all cohorts
- Subcanopy dynamics - already in parallel
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.