Skip to content

Commit

Permalink
remove old compair evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
HighDiceRoller committed Aug 24, 2024
1 parent b6524e3 commit 7b2fc27
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 234 deletions.
4 changes: 1 addition & 3 deletions src/icepool/evaluator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from icepool.evaluator.constant import ConstantEvaluator
from icepool.evaluator.keep import KeepEvaluator
from icepool.evaluator.argsort import ArgsortEvaluator
from icepool.evaluator.compair import CompairEvalautor
from icepool.evaluator.expression import ExpressionEvaluator

__all__ = [
Expand All @@ -33,6 +32,5 @@
'IsSubsetEvaluator', 'IsProperSubsetEvaluator', 'IsSupersetEvaluator',
'IsProperSupersetEvaluator', 'IsEqualSetEvaluator',
'IsNotEqualSetEvaluator', 'IsDisjointSetEvaluator', 'ConstantEvaluator',
'KeepEvaluator', 'ArgsortEvaluator', 'CompairEvalautor',
'ExpressionEvaluator'
'KeepEvaluator', 'ArgsortEvaluator', 'ExpressionEvaluator'
]
81 changes: 0 additions & 81 deletions src/icepool/evaluator/compair.py

This file was deleted.

150 changes: 0 additions & 150 deletions src/icepool/expression/multiset_expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -1234,153 +1234,3 @@ def isdisjoint(
which both multisets have positive count, and `True` if there is not.
"""
return self._compare(other, icepool.evaluator.IsDisjointSetEvaluator)

def compair_lt(
self,
other:
'MultisetExpression[T_contra] | Mapping[T_contra, int] | Sequence[T_contra]',
*,
order: Order = Order.Descending):
"""Evaluation: EXPERIMENTAL: Compare pairs of elements in sorted order, counting how many pairs `self` is < `other`.
Any extra unpaired elements do not affect the result.
Args:
other: The other multiset to compare.
order: Which order elements will be matched in.
Default is descending.
"""
other = implicit_convert_to_expression(other)
return self.evaluate(other,
evaluator=icepool.evaluator.CompairEvalautor(
order=order,
tie=0,
left_greater=0,
right_greater=1))

def compair_le(
self,
other:
'MultisetExpression[T_contra] | Mapping[T_contra, int] | Sequence[T_contra]',
*,
order: Order = Order.Descending):
"""Evaluation: EXPERIMENTAL: Compare pairs of elements in sorted order, counting how many pairs `self` is <= `other`.
Any extra unpaired elements do not affect the result.
Example: number of armies destroyed by the defender in a
3v2 attack in *RISK*:
```python
d6.pool(3).compair_le(d6.pool(2))
```
Args:
other: The other multiset to compare.
order: Which order elements will be matched in.
Default is descending.
"""
other = implicit_convert_to_expression(other)
return self.evaluate(other,
evaluator=icepool.evaluator.CompairEvalautor(
order=order,
tie=1,
left_greater=0,
right_greater=1))

def compair_gt(
self,
other:
'MultisetExpression[T_contra] | Mapping[T_contra, int] | Sequence[T_contra]',
*,
order: Order = Order.Descending):
"""Evaluation: EXPERIMENTAL: Compare pairs of elements in sorted order, counting how many pairs `self` is > `other`.
Any extra unpaired elements do not affect the result.
Example: number of armies destroyed by the attacker in a
3v2 attack in *RISK*:
```python
d6.pool(3).compair_gt(d6.pool(2))
```
Args:
other: The other multiset to compare.
order: Which order elements will be matched in.
Default is descending.
"""
other = implicit_convert_to_expression(other)
return self.evaluate(other,
evaluator=icepool.evaluator.CompairEvalautor(
order=order,
tie=0,
left_greater=1,
right_greater=0))

def compair_ge(
self,
other:
'MultisetExpression[T_contra] | Mapping[T_contra, int] | Sequence[T_contra]',
*,
order: Order = Order.Descending):
"""Evaluation: EXPERIMENTAL: Compare pairs of elements in sorted order, counting how many pairs `self` is >= `other`.
Any extra unpaired elements do not affect the result.
Args:
other: The other multiset to compare.
order: Which order elements will be matched in.
Default is descending.
"""
other = implicit_convert_to_expression(other)
return self.evaluate(other,
evaluator=icepool.evaluator.CompairEvalautor(
order=order,
tie=1,
left_greater=1,
right_greater=0))

def compair_eq(
self,
other:
'MultisetExpression[T_contra] | Mapping[T_contra, int] | Sequence[T_contra]',
*,
order: Order = Order.Descending):
"""Evaluation: EXPERIMENTAL: Compare pairs of elements in sorted order, counting how many pairs `self` is >= `other`.
Any extra unpaired elements do not affect the result.
Args:
other: The other multiset to compare.
order: Which order elements will be matched in.
Default is descending.
"""
other = implicit_convert_to_expression(other)
return self.evaluate(other,
evaluator=icepool.evaluator.CompairEvalautor(
order=order,
tie=1,
left_greater=0,
right_greater=0))

def compair_ne(
self,
other:
'MultisetExpression[T_contra] | Mapping[T_contra, int] | Sequence[T_contra]',
*,
order: Order = Order.Descending):
"""Evaluation: EXPERIMENTAL: Compare pairs of elements in sorted order, counting how many pairs `self` is >= `other`.
Any extra unpaired elements do not affect the result.
Args:
other: The other multiset to compare.
order: Which order elements will be matched in.
Default is descending.
"""
other = implicit_convert_to_expression(other)
return self.evaluate(other,
evaluator=icepool.evaluator.CompairEvalautor(
order=order,
tie=0,
left_greater=1,
right_greater=1))

0 comments on commit 7b2fc27

Please sign in to comment.