Thanks to Splinterz for showing me the function!
This is how it works
1. You have to create a ranked list of labors where the 1st item is the highest priority of assigning high % dwarf's to, and the last is least priority.
Example: at the top of mine, I had miner's, farmer's, at the top, and I had shearer's and milker's at the bottom.
2. Coverage: Then you need to decide how much coverage you want per labor. For example, do I want 2 miner's available at all times? Well, then I set coverage to 2. Coverage determines the # of dwarf's to assign to that labor... coverage / (1/number of dwarfs per labor (step3) can't be larger than population).
3. Labors Per Dwarf: Then you decide how many labor's you want per dwarf. I recommend a low # of labor's per dwarf for small populations, and more? for large populations. I have 100 population, so I set my labors to 10 each. Labors per dwarf has to be less than the highest value derived in step 3a
3a. Dwarfs Per Labor: Each labor has it's own # of dwarf's to assign: Calculate by taking the labor's coverage / (1/# of labors per dwarf). For maximum efficiency I recommend multiplying (and rounding) this number by population/(sum of coverages), sum of the rounded numbers should equal: population * labor's per dwarf.
Example: 2 coverage for mining, at 10 labors for each dwarf. Is 20 dwarf's for mining.
4. Now you unassign everyone's labor (create a custom profession that you want to use a base labor set, for example, mine included all hauling jobs, recovering wounded, burying, architecture, etc.). Apply this custom profession to everyone...
5. Now see how many labors are assigned to each dwarf by sorting by total labor's assigned (use the filter drop down). This is your base #. Important for next step. Unapply sort.
6. Now take the # of labors you wish to assign to each dwarf established in step 3 and add this to the number you got in step 5.
7. Apply this filter script (save it too!) d.total_assigned_labors()<# derived in step 6.
8. Now sort each labor by % highest to lowest. Start assigning the # of dwarf's established in step 3a.
Special note:
Nobles, militia: you can assign militia at the end (and unassign labors, or... you can assign them first and just exclude them by name in your filter script...
Same with nobles. I personally selected my nobles at the end by sorting by # of labors, and picking a low # of labor dwarf with a good fit for a noble position to fill that position, therefore preserving my super dwarf's (i.e. a good % fit for a lot of roles) who had a lot of labors assigned to keep doing there super dwarf labors.
There's an optional way of handling militia as well as Nobles. You can assign them a cost. For example, a manager you can safely assume is a cost of 1 (100% of their time is consumed doing work). This cost kind of equals coverage. All it means is you subtract 1 from the population in your calculations above... then you don't assign him to any other labors and everyone else is still assigned.
You can kind of do this with the military as well if you have half active/half inactive like I do... You can then assign them a cost of .5, so they could still be assigned 1/2 of the labors per dwarf that the other dwarf's can have. Originally I didn't want to say anything about this cuz it's confusing, but... in Splinterz version of DT, militia dwarf's are highlighted. And if they are your highest priority to assign, you can keep an eye on them until they reach there 50% labor mark, and then add their names to the filter script to exclude them from future assignments!
Custom Professions: If you have custom professions, as I do with Nurses, craftsdwarfs, and metalsmiths. Do not assign their custom profession during this process, if you do it will add say 5-6 labors at once, and you may only wish to count nursing as 1 labor for the purposes of the ranked labor list (step 1). If you want to count nursing as 1 labor, assign just 1 labor in the meantime (example diagnosis) until you finish assigning everyone, then apply the custom profession that applies the 5-6 labors.
Incompatible Labors: This is important, these 3 are incompatible: Woodcutting, hunting, and mining. When you get to these roles, you need to filter by the other incompatible labors by adding this to the filter script (step 7). d.has_labor(00) for mining, or d.has_labor(44) for hunting. So when you get to woodcutting, and you already have your miner's and ambusher's assigned, then you need to add to the filter script (!d.has_labor(00)) && (!d.has_labor(44)), this will filter out those dwarf's so you can assign the correct # of dwarf's without accidentally unassigning the incompatible labor dwarf's, be sure to remove that additional filter part when not needed
That's it. With practice, you can efficiently assign your whole fortress in less than 5 minutes! I was doing it (finally at the end) in 10 minutes after about 10 failed attempts without the d.total_assigned_labors()<# function, which was a pain, I was manually filtering by names that had exceeded the # of labor's assigned...
Here's a csv sheet of my stuff (without the military/noble stuff described above)
Population,,95,,,Dwarfs per labor,10,,Pop/Cov,1.210191083
Name,P Weight,Coverage,# of Dwarfs,x Pop/Cov,Labor,,,,
Miner,0.5625,2.5,25,30,Mining,,,,
Farmer,0.5625,2.5,25,30,Farming (fields),,,,
Metalsmith,0.523437,2.5,25,30,Custom Profession,,,,
Leatherworker,0.523437,2,20,24,Leatherworking,,,,
Bowyer,0.471094,2,20,24,Crossbow-making,,,,
Carpenter,0.46875,2,20,24,Carpentry,,,,
Mason,0.46875,2,20,24,Masonry,,,,
Brewer,0.46875,2,20,24,Brewing,,,,
Gem Cutter,0.468749,2,20,24,Gem cutting,,,,
Thresher,0.421875,2,20,24,Plant processing,,,,
Craftsdwarf,0.421874,2,20,24,Custom Profession,,,,
Mechanic,0.421874,3,30,36,Mechanics,,,,
Plant Gatherer,0.390625,4,40,48,Plant gathering,,,,
Cook,0.390624,2,20,24,Cooking,,,,
Engraver,0.375,3,30,36,Stone detailing,,,,
Ambusher,0.375,3,30,36,Hunting,,,,
Nurse,0.375,6,60,73,Custom Profession,,,,
Woodcutter,0.34375,2,20,24,Wood cutting,,,,
Trapper,0.328125,2.5,25,30,Trapping,,,,
Lyemaker,0.328125,2,20,24,Lye making,,,,
Fisherdwarf,0.312499,3,30,36,Fishing,,,,
Fish Cleaner,0.281249,2.5,25,30,Fish cleaning,,,,
Spinner,0.273437,2,20,24,Spinning,,,,
Butcher,0.25,3,30,36,Butchery,,,,
Tanner,0.234375,2.5,25,30,Tanning,,,,
Soaper,0.1875,2,20,24,Soap making,,,,
Cheesemaker,0.140624,2,20,24,Cheese making,,,,
Animal Caretaker,0,4,40,48,Animal care,,,,
Wood Burner,0,2.5,25,30,Wood burning,,,,
Milker,-0.000001,2,20,24,Milking,,,,
Shearer,-0.000001,2,20,24,Shearing,,,,
,Sum,78.5,,,,,,,
Need to apply custom professions last!,,,,,,,,,