Skip to content

Commit

Permalink
rename pool_cost.py -> pop_order.py
Browse files Browse the repository at this point in the history
  • Loading branch information
HighDiceRoller committed Aug 24, 2024
1 parent 69a11c9 commit 0a4fbe0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/icepool/generator/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import icepool
import icepool.expression
import icepool.math
import icepool.generator.pool_cost
import icepool.generator.pop_order
import icepool.creation_args
from icepool.generator.keep import KeepGenerator, pop_max_from_keep_tuple, pop_min_from_keep_tuple
from icepool.generator.multiset_generator import InitialMultisetGenerator, NextMultisetGenerator
Expand Down Expand Up @@ -181,7 +181,7 @@ def _estimate_order_costs(self) -> tuple[int, int]:
pop_min_cost
pop_max_cost
"""
return icepool.generator.pool_cost.estimate_costs(self)
return icepool.generator.pop_order.estimate_costs(self)

@cached_property
def _min_outcome(self) -> T:
Expand Down
File renamed without changes.
18 changes: 9 additions & 9 deletions tests/pool_cost_test.py → tests/pop_order_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,60 @@
import pytest

from icepool import d4, d6, d8, d10, d12
import icepool.generator.pool_cost
import icepool.generator.pop_order


def test_pool_single_type():
pool = icepool.Pool([d6, d6, d6])
pop_min_cost, pop_max_cost = icepool.generator.pool_cost.estimate_costs(
pop_min_cost, pop_max_cost = icepool.generator.pop_order.estimate_costs(
pool)
assert pop_min_cost == pop_max_cost


def test_pool_standard():
pool = icepool.Pool([d8, d12, d6])
pop_min_cost, pop_max_cost = icepool.generator.pool_cost.estimate_costs(
pop_min_cost, pop_max_cost = icepool.generator.pop_order.estimate_costs(
pool)
assert pop_min_cost > pop_max_cost


def test_pool_standard_negative():
pool = icepool.Pool([-d8, -d12, -d6])
pop_min_cost, pop_max_cost = icepool.generator.pool_cost.estimate_costs(
pop_min_cost, pop_max_cost = icepool.generator.pop_order.estimate_costs(
pool)
assert pop_min_cost < pop_max_cost


def test_pool_non_truncate():
pool = icepool.Pool([-d8, d12, -d6])
pop_min_cost, pop_max_cost = icepool.generator.pool_cost.estimate_costs(
pop_min_cost, pop_max_cost = icepool.generator.pop_order.estimate_costs(
pool)
assert pop_min_cost == pop_max_cost


def test_pool_skip_min():
pool = icepool.Pool([d6, d6, d6])[0, 1, 1]
pop_min_cost, pop_max_cost = icepool.generator.pool_cost.estimate_costs(
pop_min_cost, pop_max_cost = icepool.generator.pop_order.estimate_costs(
pool)
assert pop_min_cost > pop_max_cost


def test_pool_skip_max():
pool = icepool.Pool([d6, d6, d6])[1, 1, 0]
pop_min_cost, pop_max_cost = icepool.generator.pool_cost.estimate_costs(
pop_min_cost, pop_max_cost = icepool.generator.pop_order.estimate_costs(
pool)
assert pop_min_cost < pop_max_cost


def test_pool_skip_min_but_truncate():
pool = icepool.Pool([-d6, -d6, -d8])[0, 1, 1]
pop_min_cost, pop_max_cost = icepool.generator.pool_cost.estimate_costs(
pop_min_cost, pop_max_cost = icepool.generator.pop_order.estimate_costs(
pool)
assert pop_min_cost < pop_max_cost


def test_pool_skip_max_but_truncate():
pool = icepool.Pool([d6, d6, d8])[1, 1, 0]
pop_min_cost, pop_max_cost = icepool.generator.pool_cost.estimate_costs(
pop_min_cost, pop_max_cost = icepool.generator.pop_order.estimate_costs(
pool)
assert pop_min_cost > pop_max_cost

0 comments on commit 0a4fbe0

Please sign in to comment.