Argmin by attribute. Returns (new_variable, "Observation: ...").
(self, variable: Variable, attribute: str)
| 189 | return new_variable, rtn_str |
| 190 | |
| 191 | def argmin(self, variable: Variable, attribute: str): |
| 192 | """ |
| 193 | Argmin by attribute. Returns (new_variable, "Observation: ..."). |
| 194 | """ |
| 195 | cache_key = (self.task_id, hash(variable)) |
| 196 | if cache_key not in attribute_cache and variable not in variable_attributes_cache: |
| 197 | self.get_attributes(variable) |
| 198 | |
| 199 | if attribute not in variable_attributes_cache.get(variable, []): |
| 200 | raise ValueError("argmin: attribute must be an attribute of the variable") |
| 201 | |
| 202 | rtn_str = f"Observation: variable ##, which are instances of {variable.type}" |
| 203 | new_variable = Variable(variable.type, f"(ARGMIN {variable.program} {attribute})") |
| 204 | return new_variable, rtn_str |
nothing calls this directly
no test coverage detected