| 327 | |
| 328 | |
| 329 | class Method: |
| 330 | def __init__( |
| 331 | self, |
| 332 | name, |
| 333 | bool_reduce=False, |
| 334 | extra_kwargs=tuple(), |
| 335 | numeric_only=False, |
| 336 | see_also_modules=("numpy", "dask.array"), |
| 337 | see_also_methods=(), |
| 338 | min_flox_version=None, |
| 339 | additional_notes="", |
| 340 | aggregation_type: Literal["reduce", "scan"] = "reduce", |
| 341 | ): |
| 342 | self.name = name |
| 343 | self.extra_kwargs = extra_kwargs |
| 344 | self.numeric_only = numeric_only |
| 345 | self.see_also_modules = see_also_modules |
| 346 | self.see_also_methods = see_also_methods |
| 347 | self.min_flox_version = min_flox_version |
| 348 | self.additional_notes = additional_notes |
| 349 | self.aggregation_type = aggregation_type |
| 350 | if bool_reduce: |
| 351 | self.array_method = f"array_{name}" |
| 352 | self.np_example_array = ( |
| 353 | """np.array([True, True, True, True, True, False], dtype=bool)""" |
| 354 | ) |
| 355 | |
| 356 | else: |
| 357 | self.array_method = name |
| 358 | self.np_example_array = """np.array([1, 2, 3, 0, 2, np.nan])""" |
| 359 | |
| 360 | |
| 361 | @dataclass |
no outgoing calls
no test coverage detected
searching dependent graphs…