add extra input parameter to abstract aggregate method in fc base #200

Merged
LeSasse merged 6 commits from fix/fc_base_extra_input into main 2023-03-20 17:41:01 +00:00
2 changed files with 8 additions and 2 deletions

View file

@ -81,6 +81,8 @@ Bugs
- Fix a bug in which :class:`junifer.markers.ParcelAggregation` could yield duplicated column names if two or more parcels were used and label names were not unique (:gh:`194` by `Fede Raimondo`_). - Fix a bug in which :class:`junifer.markers.ParcelAggregation` could yield duplicated column names if two or more parcels were used and label names were not unique (:gh:`194` by `Fede Raimondo`_).
- Fix a bug in which :func:`junifer.data.masks.get_mask` fails for FunctionalConnectivityBase class, because of missing extra_input parameter (:gh:`200` by `Leonard Sasse`_)
API changes API changes
~~~~~~~~~~~ ~~~~~~~~~~~

View file

@ -66,7 +66,11 @@ class FunctionalConnectivityBase(BaseMarker):
super().__init__(on="BOLD", name=name) super().__init__(on="BOLD", name=name)
@abstractmethod @abstractmethod
def aggregate(self, input: Dict[str, Any]) -> Dict[str, Any]: def aggregate(
self,
input: Dict[str, Any],
extra_input: Optional[Dict[str, Any]] = None,
) -> Dict[str, Any]:
"""Perform aggregation.""" """Perform aggregation."""
raise_error( raise_error(
msg="Concrete classes need to implement aggregate().", msg="Concrete classes need to implement aggregate().",
@ -130,7 +134,7 @@ class FunctionalConnectivityBase(BaseMarker):
""" """
# Perform necessary aggregation # Perform necessary aggregation
aggregation = self.aggregate(input) aggregation = self.aggregate(input, extra_input=extra_input)
# Compute correlation # Compute correlation
if self.cor_method_params["empirical"]: if self.cor_method_params["empirical"]:
connectivity = ConnectivityMeasure( connectivity = ConnectivityMeasure(