tommy.controller.visualizations.abstract_visualization.AbstractVisualization

class tommy.controller.visualizations.abstract_visualization.AbstractVisualization[source]

Bases: ABC

Abstract class that defines the interface to create a matplotlib figure of a visualization given a topic runner object

delete_cache()[source]

Delete all cached figures

get_figure(topic_runner: TopicRunner, topic_id: TopicID = None, metadata_corpus: MetadataCorpus = None, processed_corpus: ProcessedCorpus = None, ignore_cache: bool = False) Figure[source]

Get the matplotlib figure showing the requested visualization :param topic_runner: the topic runner to extract the result data from :param topic_id: the index of the topic to create the visualization

about if applicable, defaults to None

Parameters:
  • metadata_corpus – the metadata of all documents in the corpus if applicable, defaults to None

  • processed_corpus – the entire preprocessed corpus if applicable, defaults to None

  • ignore_cache – whether to ignore the cache and always create a new figure, defaults to False

Returns:

The matplotlib figure showing the requested visualization

is_possible(metadata_available: bool, topic_runner: TopicRunner) bool[source]

Test whether the topic runner implements the necessary interfaces for this visualization type :param metadata_available: whether metadata is available :param topic_runner: the topic runner to check interfaces from :return: True iff the visualization is possible on given topic runner

name: str = NotImplemented
needed_input_data: list[VisInputData] = NotImplemented
short_tab_name: str = NotImplemented
vis_group: VisGroup = NotImplemented