Summary
Add a partition demand setting so users can choose which outputs are materialized: pooled only (same as existing output), female-only, male-only, or both sexes. This is separate from infrastructure, which works on how strata are defined, indexed, and stored. Configuring partition demand tells the model which partition slices should be written to DQs, and demand-based computation is the key to maintaining model efficiency after partitions are added.
Current status
After the PR #1581:
PartitionSpec, GroupSelector, and IndexLayout exist, each Population is initialized with a default sex partition in CatchAtAge::Initialize().
- Fleet
*_by_partition containers are registered with DimensionInfo {"n_strata", "n_years", "n_ages"}.
- No user-facing option controls partitioning.
- Evaluation still fills pooled DQs only, partitioned containers are never written.
Implementation details
PR Scope: demand configuration and routing only, starting with the sex-ratio model (scalar split). The goal is to split pooled values into partitioned containers on write when demand requires it. Explicit/implicit two-sex dynamics are out of scope at the moment.
Demand representation
Recap: Demand maps to the existing GroupSelector API. "pooled" means no partitioned output. "female" / "male" select one stratum. "both" uses a wildcard and expands to all strata. Default is "pooled" for backward compatibility.
R / interface exposure
Recap: Users configure demand at the population (or model) level from R, similar to other Population settings. The R interface should use clear, string type names rather than integer codes. C++ stores the resolved GroupSelector or demand enum.
population <- Population()
population$partition_demand <- "pooled" # default
# population$partition_demand <- "female"
# population$partition_demand <- "male"
# population$partition_demand <- "both"
Conditional DQ registration
Recap: Infrastructure currently registers all *_by_partition fleet DQs unconditionally. Demand should gate registration so pooled-only users pay no storage or reporting cost.
Evaluation routing (sex-ratio model)
Recap: When demand is not "pooled", keep pooled evaluation unchanged, then split into partitioned containers for requested strata only, using proportion_female and index_layout.i_stratum_age_year().
Notes and Design Directions
At this stage this issue is drafted mainly off the GSoC Project Proposal to keep track of project progress prior to the midterm evaluation. Details will be modified based on the final implementation of PR #1581.
Summary
Add a partition demand setting so users can choose which outputs are materialized: pooled only (same as existing output), female-only, male-only, or both sexes. This is separate from infrastructure, which works on how strata are defined, indexed, and stored. Configuring partition demand tells the model which partition slices should be written to DQs, and demand-based computation is the key to maintaining model efficiency after partitions are added.
Current status
After the PR #1581:
PartitionSpec,GroupSelector, andIndexLayoutexist, eachPopulationis initialized with a default sex partition inCatchAtAge::Initialize().*_by_partitioncontainers are registered withDimensionInfo {"n_strata", "n_years", "n_ages"}.Implementation details
PR Scope: demand configuration and routing only, starting with the sex-ratio model (scalar split). The goal is to split pooled values into partitioned containers on write when demand requires it. Explicit/implicit two-sex dynamics are out of scope at the moment.
Demand representation
PartitionDemandonPopulation.GroupSelectorper axis.requested_strata()returningstd::vector<size_t>viapartition_spec.expand_group_to_strata().R / interface exposure
partition_demandon Population Rcpp interfaceConditional DQ registration
*_by_partitionregistration in rcpp_models.hpp onpartition_demand != pooled.InitializeCAA()to reflect demand.*_by_partitionkeys while "both" creates partitioned DQs present with correct size.Evaluation routing (sex-ratio model)
Notes and Design Directions
At this stage this issue is drafted mainly off the GSoC Project Proposal to keep track of project progress prior to the midterm evaluation. Details will be modified based on the final implementation of PR #1581.