def test_get_class_for_plot_type(self): """Tests if we can get a type based on a plot name.""" initialize_plots() plot_type = Plot.get_class_for_plot_type('paper_config_overview_plot') self.assertEqual( str(plot_type), "<class 'varats.plots.paper_config_overview.PaperConfigOverviewPlot'>" )
def main() -> None: """ Main function for working with artefacts. `vara-art` """ initialize_cli_tool() initialize_projects() initialize_reports() initialize_tables() initialize_plots() initialize_artefact_types()
def setUp(cls): """Setup artefacts file from yaml doc.""" initialize_plots() initialize_tables() initialize_artefact_types() with NamedTemporaryFile('w') as yaml_file: yaml_file.write(YAML_ARTEFACTS) yaml_file.seek(0) cls.artefacts = load_artefacts_from_file(Path(yaml_file.name)) cls.plot_artefact = tp.cast(PlotArtefact, next(cls.artefacts.__iter__())) if not isinstance(cls.plot_artefact, PlotArtefact): raise AssertionError("Test artefact is not a PlotArtefact!")
def main(context: click.Context, **kwargs: tp.Any) -> None: """Entry point for the plot generation tool.""" # store common options in context so they can be passed to subcommands common_options = CommonPlotOptions.from_kwargs(**kwargs) plot_config = PlotConfig.from_kwargs(**kwargs) context.ensure_object(dict) context.obj["common_options"] = common_options context.obj["plot_config"] = plot_config context.obj["save_artefact"] = kwargs["save_artefact"] initialize_cli_tool() initialize_projects() initialize_tables() initialize_plots()
def __init__(self, **attrs: tp.Any): initialize_plots() super().__init__(**attrs)
def create_plot_type_choice() -> TypedChoice[tp.Type[Plot]]: initialize_plots() return TypedChoice(Plot.PLOTS)
def setUp(cls) -> None: """Setup artefacts file from yaml doc.""" initialize_reports() initialize_tables() initialize_plots()