Releases: HighDiceRoller/icepool
Releases · HighDiceRoller/icepool
v2.2.1
v2.2.1 - 25 December 2025
- Added
wild,wild_low, andwild_highoptions tolargest_count()evaluation. These allow specifying outcomes as wild, combining with any outcomes, outcomes that they are lower than, and outcomes that they are higher than respectively. standard_poolrenamed tod_pool, leaving a deprecation warning.
v2.2.0
v2.2.0 - 11 December 2025
Major modifications to map(repeat) Markov process flow.
- Now requires Python >= 3.12 (from 3.10).
Rerollsplit into separateRerollandRestartsymbols with different meanings inmap(repeat)andAgain.- In
map(repeat),Rerollrerolls only the current stage, whileRestartrestarts the entire process. - With
again_count,Rerollrerolls any dice over the limit until they don't rollAgain, whileRestartrestarts the entire process. - With
again_depth,Rerollrerolls the last depth if going over the limit, whileRestartcannot be used withagain_depth.
- In
Breakoutcome wrapper that can be returned from a function sent tomap(repeat)in order to immediately terminate the Markov process.map(repeat)now defaults torepeat=None;repeatis now explicitly incompatible withAgain.- Remove separate
time_limitparameter tomap();repeatnow always returns early if fully absorbed. again_endcan now be used withagain_count..weightless()method for multiset generators that sets the quantity for all possible multisets to 1.- New
product_of_counts()multiset evaluation. - More specific overloads for
map,tupleize,vectorize. - Rename
commonize_denominator()toharmonize_denominator()and add optional weight parameter. - Fix immediate absorption case for
map(repeat='inf').
v2.1.2
v2.1.2 - 7 August 2025
- Breaking change:
difference(but not other operations) now haskeep_negative_countsparameter again, which defaults toFalse.
v2.1.1 - 4 August 2025
- Experimental
sort_pair_keep_while()andsort_pair_drop_while()multiset ops.
v2.1.0
v2.1.0 - 30 July 2025
- Breaking change:
any()multiset evaluation renamed and inverted toempty(). - Breaking change:
sort_match()renamed tosort_pair(),maximum_match_highest()renamed tomax_pair_highest()and similar forminimum_match_highest(). - Add
extraparameter tosort_pair. - Rename several
whichandtargetparameters tooutcomes. - Make
max_rerollsanddepthparameters ofreroll_to_pool()keyword-only, and add default outcomes to reroll. - Experimental
leximin()andleximax()multiset evaluations. - Experimental
versus_any()andversus_all()multiset operations.
v2.0.2
v2.0.2 - 1 April 2025
- Fix default
next_state_keyidentification.
v2.0.1 - 1 April 2025
- Adjusted behavior of
MultisetEvaluatorcaching between calls toevaluate()depending on the value ofnext_state_key.- By default,
next_state_keywill only cache if the evaluator is called directly (i.e. not inside a@multiset_function). - If a full
next_state_keyis given, it will cache inside@multiset_function, provided the other contents agree. - The special value
NoCachewill disable caching.
- By default,
- Support argumentless evaluations.
- Some typing fixes.
v2.0.0
v2.0.0 - 31 March 2025
Major rewrite of multiset handling. Things will be more unstable than usual for a while.
MultisetEvaluator.next_state()now has an explicit parameter with the order in which outcomes are seen.- Optional
MultisetEvaluator.initial_state()method. MultisetEvaluator.initial_state()andfinal_state()now get the following parameters:- The order in which outcomes are / were seen.
- All outcomes that will be / were seen.
- The sizes of the input multisets, if inferrable with counts being non-negative.
- Non-multiset keyword arguments that were passed to
evaluate().
ascendinganddescendingvariants ofnext_stateno longer exist.- Instead,
raise UnsupportedOrder()if you don't like the current order. The other order will automatically be tried. - This can be done in
initial_state()(recommended),next_state(), orfinal_outcome().
- Instead,
- Multiset operator order is now always attached to the evaluator side rather than the generator side.
- Unless the operator modifies the generator in-place, but in this case both orders will certainly be supported.
MultisetEvaluatorcan optionally provide a key for persistent caching.- Some existing expressions and evaluators now take advantage of inferred multiset sizes.
- In particular,
keep()andsorted_match().
- In particular,
MultisetExpression.count()renamed tosize().@multiset_functionnow implements late binding like a standard Python method. (Though I still recommend using only pure functions.)@multiset_functionnow accepts variadic arguments.@multiset_functionnow accepts non-multiset keyword arguments.@multiset_functionnow works with joint evaluations where some sub-evaluations don't contain parameters.- Hopefully better
@multiset_functionperformance. Alignmentclass is retired.- Deprecated
depth=Noneis removed fromDie.reroll(). - Multiset generators now always produce a single count value, with
MultiDealnow producing tuple-valued counts rather than taking up multiple argument slots. - Multiset computations now try to infer multiset sizes if the counts are non-negative. This improves the applicability of
keepandsort_matchexpressions. - Cartesian products (e.g.
tupleize) now returnRerollif any argument isReroll.
v1.7.2
This is likely the end of the v1.x series apart from bugfixes.
v1.7.2 - 25 February 2025
- Add
Population.append()and.remove()methods. - Improve
Vectorperformance. - Adjusted typing of mixture expressions.
- Experimental
Walleniusnoncentral hypergeometric.
v1.7.1
v1.7.1 - 10 February 2025
- Fix joint evaluations and
@multiset_functioninteraction withnext_state_ascendingandnext_state_descending.
v1.7.0 - 9 February 2025
- Overhauled multiset expressions. This allows expressions that are given to an evaluator to have the evaluation persistently cached. This makes the caching behavior more consistent: a single expression will be cached in the final evaluator (e.g.
(a - b).unique().sum()would be cached in thesumevaluator), and@multiset_functioncreates an evaluator like any other. Unfortunately, this did come at some performance cost for@multiset_function. I have some ideas on how to claw back some of the performance but I haven't decided whether it's worth the complexity. - Instead of specifying
order()for an evaluator, you can now implementnext_state_ascending()and/ornext_state_descending(). Alignmentnow has a denominator of 1.keep(),isdisjoint(),sort_match(), andmaximum_match()operations now treat negative incoming counts as zero rather than raising an error.- Add
Population.group_by()method to split a population into a "covering" set of conditional probabilities.Population.group_by[]can also be used to group by index or slice.
- Move
split()fromDieto the basePopulationclass. - Straight-related multiset operations can now choose between prioritizing low and high outcomes.
- Store original names of
@multiset_functionparameters.
v1.6.1
v1.6.1 - 17 November 2024
- Add
pointwise_max,pointwise_minarguments to take pointwise maximum or minimum of CDFs. - Add
Die.time_to_sum()method. - Fix identification of absorbing states in the presence of
extra_argsinmap_and_time(). - Add
time_limitparameter tomap(). repeatparameter now uses'inf'to request the absorbing distribution rather thanNone.
v1.6.0
v1.6.0 - 20 September 2024
- Breaking change: outcomes with zero quantities are removed when constructing
DieandDeck.- Functions and methods relating to zero-quantities are removed:
align(),align_range(),Population.has_zero_quantities(),Die.trim(),Die.set_range(),Die.set_outcomes(). - You can use
consecutive()orsorted_union()to get an appropriate superset of sets of outcomes.
- Functions and methods relating to zero-quantities are removed:
- Breaking change:
MultisetEvaluator.alignment()is renamed toMultisetEvaluator.extra_outcomes().MultisetEvaluator.range_alignment()is renamed toMultisetEvaluator.consecutive().- The
Alignmentclass is no longer public.
- Breaking change:
Deck.multiply_counts()andPopulation.scale_quantities()are replaced/renamed toPopulation.multiply_quantities()etc. - Add
Deck.sequence()andDie.sequence()method. - Add
Population.pad_to_denominator()method. - Move
zero()andzero_outcome()fromDietoPopulation. @operator now sums left-to-right.- Remove old
compairevaluation. min_outcome()andmax_outcome()free functions can now be called using a single iterable argument.- Forward algorithm now has a persistent cache.
- Add skip optimization for single deals with keep tuples.
- Pools now only skip dice, not outcomes. This is a bit slower in some cases but provides more consistent iteration order.
- Add shared evaluator instances for some built-in evaluator for caching.
- Simplify determination of outcome order for multiset evaluations.
- Simplify implementation of generator unbinding.
- Fix
extra_argsexpansion formap_and_time.