(self, method)
| 468 | yield self.generate_code(method, self.has_keep_attrs) |
| 469 | |
| 470 | def generate_example(self, method): |
| 471 | created = self.datastructure.create_example.format( |
| 472 | example_array=method.np_example_array |
| 473 | ) |
| 474 | calculation = f"{self.datastructure.example_var_name}{self.example_call_preamble}.{method.name}" |
| 475 | if method.extra_kwargs: |
| 476 | extra_examples = "".join( |
| 477 | kwarg.example for kwarg in method.extra_kwargs if kwarg.example |
| 478 | ).format(calculation=calculation, method=method.name) |
| 479 | else: |
| 480 | extra_examples = "" |
| 481 | |
| 482 | return f""" |
| 483 | Examples |
| 484 | --------{created} |
| 485 | >>> {self.datastructure.example_var_name} |
| 486 | |
| 487 | >>> {calculation}(){extra_examples}""" |
| 488 | |
| 489 | |
| 490 | class GroupByAggregationGenerator(AggregationGenerator): |
no test coverage detected