From d2adbb1d89f0adf2dbb6f020f0dedb5742b44d1a Mon Sep 17 00:00:00 2001 From: HighDiceRoller <98680644+HighDiceRoller@users.noreply.github.com> Date: Thu, 2 Nov 2023 07:33:55 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20HighDice?= =?UTF-8?q?Roller/icepool@28fe49b129eab1f275b01649f4b58f88aca71106=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apidoc/latest/icepool.html | 185 +++++++++++++++--------------- apidoc/latest/icepool/typing.html | 10 +- 2 files changed, 98 insertions(+), 97 deletions(-) diff --git a/apidoc/latest/icepool.html b/apidoc/latest/icepool.html index 11bab19a..eb97747a 100644 --- a/apidoc/latest/icepool.html +++ b/apidoc/latest/icepool.html @@ -2197,64 +2197,63 @@

1138 1139 def __bool__(self) -> bool: 1140 raise TypeError( -1141 'A `Die` only has a truth value if it is the result of == or !=. ' -1142 'This could result from trying to use a die in an if-statement, ' -1143 'in which case you should use `die.if_else()` instead. ' -1144 'Or it could result from trying to use a `Die` inside a tuple or ' -1145 'vector outcome, ' -1146 'in which case you should use `tupleize()` or `vectorize().') -1147 -1148 @cached_property -1149 def _hash_key(self) -> tuple: -1150 """A tuple that uniquely (as `equals()`) identifies this die. -1151 -1152 Apart from being hashable and totally orderable, this is not guaranteed -1153 to be in any particular format or have any other properties. -1154 """ -1155 return tuple(self.items()) -1156 -1157 @cached_property -1158 def _hash(self) -> int: -1159 return hash(self._hash_key) -1160 -1161 def __hash__(self) -> int: -1162 return self._hash -1163 -1164 def equals(self, other, *, simplify: bool = False) -> bool: -1165 """`True` iff both dice have the same outcomes and quantities. -1166 -1167 This is `False` if `other` is not a `Die`, even if it would convert -1168 to an equal `Die`. -1169 -1170 Truth value does NOT matter. -1171 -1172 If one `Die` has a zero-quantity outcome and the other `Die` does not -1173 contain that outcome, they are treated as unequal by this function. -1174 -1175 The `==` and `!=` operators have a dual purpose; they return a `Die` -1176 with a truth value determined by this method. -1177 Only dice returned by these methods have a truth value. The data of -1178 these dice is lazily evaluated since the caller may only be interested -1179 in the `Die` value or the truth value. -1180 -1181 Args: -1182 simplify: If `True`, the dice will be simplified before comparing. -1183 Otherwise, e.g. a 2:2 coin is not `equals()` to a 1:1 coin. -1184 """ -1185 if not isinstance(other, Die): -1186 return False -1187 -1188 if simplify: -1189 return self.simplify()._hash_key == other.simplify()._hash_key -1190 else: -1191 return self._hash_key == other._hash_key -1192 -1193 # Strings. -1194 -1195 def __repr__(self) -> str: -1196 inner = ', '.join( -1197 f'{outcome}: {weight}' for outcome, weight in self.items()) -1198 return type(self).__qualname__ + '({' + inner + '})' +1141 'A `Die` only has a truth value if it is the result of == or !=.\n' +1142 'This could result from trying to use a die in an if-statement,\n' +1143 'in which case you should use `die.if_else()` instead.\n' +1144 'Or it could result from trying to use a `Die` inside a tuple or vector outcome,\n' +1145 'in which case you should use `tupleize()` or `vectorize().') +1146 +1147 @cached_property +1148 def _hash_key(self) -> tuple: +1149 """A tuple that uniquely (as `equals()`) identifies this die. +1150 +1151 Apart from being hashable and totally orderable, this is not guaranteed +1152 to be in any particular format or have any other properties. +1153 """ +1154 return tuple(self.items()) +1155 +1156 @cached_property +1157 def _hash(self) -> int: +1158 return hash(self._hash_key) +1159 +1160 def __hash__(self) -> int: +1161 return self._hash +1162 +1163 def equals(self, other, *, simplify: bool = False) -> bool: +1164 """`True` iff both dice have the same outcomes and quantities. +1165 +1166 This is `False` if `other` is not a `Die`, even if it would convert +1167 to an equal `Die`. +1168 +1169 Truth value does NOT matter. +1170 +1171 If one `Die` has a zero-quantity outcome and the other `Die` does not +1172 contain that outcome, they are treated as unequal by this function. +1173 +1174 The `==` and `!=` operators have a dual purpose; they return a `Die` +1175 with a truth value determined by this method. +1176 Only dice returned by these methods have a truth value. The data of +1177 these dice is lazily evaluated since the caller may only be interested +1178 in the `Die` value or the truth value. +1179 +1180 Args: +1181 simplify: If `True`, the dice will be simplified before comparing. +1182 Otherwise, e.g. a 2:2 coin is not `equals()` to a 1:1 coin. +1183 """ +1184 if not isinstance(other, Die): +1185 return False +1186 +1187 if simplify: +1188 return self.simplify()._hash_key == other.simplify()._hash_key +1189 else: +1190 return self._hash_key == other._hash_key +1191 +1192 # Strings. +1193 +1194 def __repr__(self) -> str: +1195 inner = ', '.join( +1196 f'{outcome}: {weight}' for outcome, weight in self.items()) +1197 return type(self).__qualname__ + '({' + inner + '})' @@ -3959,34 +3958,34 @@

Raises:
-
1164    def equals(self, other, *, simplify: bool = False) -> bool:
-1165        """`True` iff both dice have the same outcomes and quantities.
-1166
-1167        This is `False` if `other` is not a `Die`, even if it would convert
-1168        to an equal `Die`.
-1169
-1170        Truth value does NOT matter.
-1171
-1172        If one `Die` has a zero-quantity outcome and the other `Die` does not
-1173        contain that outcome, they are treated as unequal by this function.
-1174
-1175        The `==` and `!=` operators have a dual purpose; they return a `Die`
-1176        with a truth value determined by this method.
-1177        Only dice returned by these methods have a truth value. The data of
-1178        these dice is lazily evaluated since the caller may only be interested
-1179        in the `Die` value or the truth value.
-1180
-1181        Args:
-1182            simplify: If `True`, the dice will be simplified before comparing.
-1183                Otherwise, e.g. a 2:2 coin is not `equals()` to a 1:1 coin.
-1184        """
-1185        if not isinstance(other, Die):
-1186            return False
-1187
-1188        if simplify:
-1189            return self.simplify()._hash_key == other.simplify()._hash_key
-1190        else:
-1191            return self._hash_key == other._hash_key
+            
1163    def equals(self, other, *, simplify: bool = False) -> bool:
+1164        """`True` iff both dice have the same outcomes and quantities.
+1165
+1166        This is `False` if `other` is not a `Die`, even if it would convert
+1167        to an equal `Die`.
+1168
+1169        Truth value does NOT matter.
+1170
+1171        If one `Die` has a zero-quantity outcome and the other `Die` does not
+1172        contain that outcome, they are treated as unequal by this function.
+1173
+1174        The `==` and `!=` operators have a dual purpose; they return a `Die`
+1175        with a truth value determined by this method.
+1176        Only dice returned by these methods have a truth value. The data of
+1177        these dice is lazily evaluated since the caller may only be interested
+1178        in the `Die` value or the truth value.
+1179
+1180        Args:
+1181            simplify: If `True`, the dice will be simplified before comparing.
+1182                Otherwise, e.g. a 2:2 coin is not `equals()` to a 1:1 coin.
+1183        """
+1184        if not isinstance(other, Die):
+1185            return False
+1186
+1187        if simplify:
+1188            return self.simplify()._hash_key == other.simplify()._hash_key
+1189        else:
+1190            return self._hash_key == other._hash_key
 
@@ -9169,8 +9168,8 @@
Inherited Members
469 match tie: 470 case 'error': 471 raise IndexError( -472 f'The middle {keep} of {self.keep_size()} elements is ambiguous.' -473 " Specify tie='low' or tie='high' to determine what to pick." +472 f'The middle {keep} of {self.keep_size()} elements is ambiguous.\n' +473 "Specify tie='low' or tie='high' to determine what to pick." 474 ) 475 case 'high': 476 start = (self.keep_size() + 1 - keep) // 2 @@ -9916,8 +9915,8 @@
Arguments:
469 match tie: 470 case 'error': 471 raise IndexError( -472 f'The middle {keep} of {self.keep_size()} elements is ambiguous.' -473 " Specify tie='low' or tie='high' to determine what to pick." +472 f'The middle {keep} of {self.keep_size()} elements is ambiguous.\n' +473 "Specify tie='low' or tie='high' to determine what to pick." 474 ) 475 case 'high': 476 start = (self.keep_size() + 1 - keep) // 2 @@ -10927,7 +10926,7 @@
Inherited Members
154 if isinstance(inner, 155 icepool.MultisetGenerator) and inner.output_arity() != 1: 156 raise ValueError( -157 'Only generators with output arity of 1 may be bound to expressions. Use a multiset_function to select individual outputs.' +157 'Only generators with output arity of 1 may be bound to expressions.\nUse a multiset_function to select individual outputs.' 158 ) 159 160 # Binary operators. @@ -13671,7 +13670,7 @@
Arguments:
272 outcome = self.final_outcome(state) 273 if outcome is None: 274 raise TypeError( -275 "None is not a valid final outcome. " +275 "None is not a valid final outcome.\n" 276 "This may have been a result of not supplying any generator with an outcome." 277 ) 278 if outcome is not icepool.Reroll: @@ -14399,7 +14398,7 @@
Raises:
272 outcome = self.final_outcome(state) 273 if outcome is None: 274 raise TypeError( -275 "None is not a valid final outcome. " +275 "None is not a valid final outcome.\n" 276 "This may have been a result of not supplying any generator with an outcome." 277 ) 278 if outcome is not icepool.Reroll: diff --git a/apidoc/latest/icepool/typing.html b/apidoc/latest/icepool/typing.html index e4cf6764..3c1c9e2c 100644 --- a/apidoc/latest/icepool/typing.html +++ b/apidoc/latest/icepool/typing.html @@ -218,8 +218,9 @@

104 try: 105 required_count, _ = count_positional_parameters(function) 106 except ValueError: -107 raise ValueError(f'Could not guess whether to unpack the first argument to the function. You may need to specify star explicitly.') -108 return required_count > arg_count +107 raise ValueError(f'Could not guess whether to unpack the first argument to the function.\n' +108 'You may need to specify `star` explicitly.') +109 return required_count > arg_count

@@ -624,8 +625,9 @@
Returns:
105 try: 106 required_count, _ = count_positional_parameters(function) 107 except ValueError: -108 raise ValueError(f'Could not guess whether to unpack the first argument to the function. You may need to specify star explicitly.') -109 return required_count > arg_count +108 raise ValueError(f'Could not guess whether to unpack the first argument to the function.\n' +109 'You may need to specify `star` explicitly.') +110 return required_count > arg_count