csv_report_algorithm
Algorithm for outputting results to CSV on the pod-side.
Classes
CSVReportAlgorithm
class CSVReportAlgorithm( datastructure: DataStructure, save_path: Optional[Union[str, os.PathLike]] = None, original_cols: Optional[list[str]] = None, filter: Optional[list[ColumnFilter]] = None, **kwargs: Any,):Algorithm for generating the CSV results reports.
Arguments
datastructure: The data structure to use for the algorithm.original_cols: The tabular columns from the datasource to include in the report. If not specified it will include all tabular columns from the datasource.filter: A list ofColumnFilterinstances on which we will filter the data on. Defaults to None. If supplied, columns will be added to the output csv indicating the records that match the specified criteria. If more than oneColumnFilteris given, and additional column will be added to the output csv indicating the datapoints that match all given criteria (as well as the individual matches)
Ancestors
- BaseNonModelAlgorithmFactory
- BaseAlgorithmFactory
- abc.ABC
- bitfount.federated.roles._RolesMixIn
- bitfount.types._BaseSerializableObjectMixIn
- typing.Generic
Variables
- static
fields_dict : ClassVar[T_FIELDS_DICT]
Methods
modeller
def modeller( self, *, context: ProtocolContext, **kwargs: Any,) ‑> NoResultsModellerAlgorithm:Inherited from:
BaseNonModelAlgorithmFactory.modeller :
Modeller-side of the algorithm.
worker
def worker( self, *, context: ProtocolContext, **kwargs: Any,) ‑> bitfount.federated.algorithms.csv_report_algorithm._WorkerSide:Inherited from:
BaseNonModelAlgorithmFactory.worker :
Worker-side of the algorithm.
ColumnFilter
class ColumnFilter(column: str, operator: str, value: typing.Union[str, int, float]):Dataclass for column filtering.
Arguments
column: The column name on which the filter will be applied. The filtering ignores capitalization or spaces for the column name.operator: The operator for the filtering operation. E.g., "less than", ">=", "not equal", "==".value: The value for the filter. This is allowed to be a string only forequalsornot equaloperators, and needs to be a float or integer for all other operations.
Raises
ValueError: If an inequality comparison operation is given with a value which cannot be converted to a float.