MDFactoryMDFactory

composition

Pydantic models for system composition (mixedbox, bilayer, LNP).

funcdistribute_counts(fractions, total)list[int]

Distribute total into integer counts preserving the sum exactly.

Uses floor + largest fractional part method to ensure the sum of returned counts equals total exactly, while respecting proportions.

paramfractionslist[float]

Fractions for each species (must sum to 1.0).

paramtotalint

Total count to distribute.

Returns

list

Integer counts that sum to exactly total.