Skip to content

Provide a better implementation of Dataset.__init__ #82

@tizianocitro

Description

@tizianocitro

The implementation could change but the issue is the same: __init__ does too many things.

I want to refactor this, also to make dependency clearer. For example, process() requires self.hypergraph not None and self.__is_original == True, which is not very clear from the current implementation.

def __init__(
   self,
   hdata: Optional[HData] = None,
   sampling_strategy: SamplingStrategy = SamplingStrategy.HYPEREDGE,
    is_original: Optional[bool] = True,
) -> None:
    self.__is_original = is_original
    self.__sampler = create_sampler_from_strategy(sampling_strategy)

    self.sampling_strategy = sampling_strategy
    self.hypergraph = self.download() if hdata is None else HIFHypergraph.empty()
    self.hdata = self.process() if hdata is None else hdata

I want to refactor this to provide a better way to create datasets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions