def run_clustering(repository_parameter_name, start_date, end_date, limit): """ :param repository_parameter_name: One of the types from ``RepositoryParameter`` :param start_date: First day :param end_date: Last day :param limit: Limit the number of examined stations :return: Show clustering """ params = get_repository_parameters(repository_parameter_name) station_repository = StationRepository(*params) station_dicts = station_repository.load_all_stations(start_date, end_date, limit=limit) station_time_series_comparator = StationTimeSeriesComparator(station_dicts) stations = [Station(station_dict) for station_dict in station_dicts] cluster = HierarchicalClustering( stations, station_time_series_comparator.compare_time_series, num_processes=4) cluster.cluster() cluster.display(print_function=logging.debug) logging.info(cluster._data)