Flattens a list repeatedly until only non-list elements remain.
NOTE: List.flatten drops nested lists that are empty. listDeepFlatten is no different.
import 'hub:mlao-pdx/lib-common' as c l = [1,2,[3,[4],[]],5,[]]
Create list of unique values by Name, or value if no name.
Convert a value into a list, unless it is already a list.
Copy values for tags ["doc","numberFormat","hidden","name","startOpenState"] from tagSource
to tagTarget
.
import 'hub:mlao-pdx/lib-common' as c @name('FooName') @doc('FooDoc')
Semantic versioning is used.
Return same dictionary with private attributes (_*) ommitted.
Collect values for tags ["doc","numberFormat","hidden","name","startOpenState"] and return as dictionary.
Use in combination with tagMerge
to copy tag values from one object to another.
See this discord chat
import 'hub:mlao-pdx/lib-common' as c @name('FooName')
A list of all dictionary keys that start with an underscore.
import 'hub:mlao-pdx/lib-common' as c d = {_yes: 'Private Attribute', no: 'Common Attribute'} c.privateAttributes(d)
Return slice of a string, as if it was a list of single characters.
Set values for tags ["doc","numberFormat","hidden","name","startOpenState"], that are not yet present on the object, from given dictionary of tags.
Use in combination with tagGet
to copy tag values from one object to another.
See this discord chat
import 'hub:mlao-pdx/lib-common' as c @name('FooName')
Set values for tags ["doc","numberFormat","hidden","name","startOpenState"] from given dictionary of tags.
Use in combination with tagGet
to copy tag values from one object to another.
See this discord chat
import 'hub:mlao-pdx/lib-common' as c @name('FooName')
Cast values into a distribution, if reasonable.
import 'hub:mlao-pdx/lib-common' as c e = { number: c.toDistribution(10), list_of_numbers: c.toDistribution(List.upTo(1,20)), distribution: c.toDistribution(10 to 100),
Flattens a list repeatedly until only non-list elements remain.
NOTE: List.flatten drops nested lists that are empty. listDeepFlatten is no different.
import 'hub:mlao-pdx/lib-common' as c l = [1,2,[3,[4],[]],5,[]]
Check if a list is a unnested list of Numbers.
import 'hub:mlao-pdx/lib-common' as c { yes: c.isListOf([1n,2%,3,4T],'Number'), yes: c.isListOf(['a', '3'],'String'), no: c.isListOfNumbers([1n,2%,'3',4T],'Number'),
Assertion allows embedding of propositions in the estimate that have a certain likelihood of being true or false.
Aliases assumption1,
risk, and
scope` have been provided for semantic purposes.
Resolve the four sets of assertions into a single True or False Bernoulli distribution.
every
requires that each passed assertion MUST be truenone
requires that each passed assertion MUST be falsesome
requires that any of the passed assertions could be truesomeNot
requires that any of the passed assertions could be falseAssertions that do not (yet) warrant their impact be woven into the estimate, but are important to document. These tend to be assertions with wide ranging impacts and should be named as statements of truth. Their chance is commonly 100%.
Adds items that desire to use the given item.
Adds desired components to the given item.
Always asserts to false.