# Path: rsmtool/reporter.py
# class Reporter:
#     def __init__(self, logger=None):
#     def locate_custom_sections(custom_report_section_paths, configdir):
#     def merge_notebooks(notebook_files, output_file):
#     def check_section_names(specified_sections,
#                             section_type,
#                             context='rsmtool'):
#     def check_section_order(chosen_sections, section_order):
#     def convert_ipynb_to_html(notebook_file, html_file):
#     def determine_chosen_sections(self,
#                                   general_sections,
#                                   special_sections,
#                                   custom_sections,
#                                   subgroups,
#                                   context='rsmtool'):
#     def get_section_file_map(self,
#                              special_sections,
#                              custom_sections,
#                              model_type=None,
#                              context='rsmtool'):
#     def get_ordered_notebook_files(self,
#                                    general_sections,
#                                    special_sections=[],
#                                    custom_sections=[],
#                                    section_order=None,
#                                    subgroups=[],
#                                    model_type=None,
#                                    context='rsmtool'):
#     def create_report(self,
#                       config,
#                       csvdir,
#                       figdir,
#                       context='rsmtool'):
#     def create_comparison_report(self,
#                                  config,
#                                  csvdir_old,
#                                  figdir_old,
#                                  csvdir_new,
#                                  figdir_new,
#                                  output_dir):
#     def create_summary_report(self,
#                               config,
#                               all_experiments,
#                               csvdir):
# def main():  # noqa: D103


from os.path import join, normpath
from nose.tools import eq_, ok_, raises
from rsmtool.reporter import (Reporter,
                              comparison_notebook_path,
                              master_section_dict,
                              notebook_path,
                              notebook_path_dict,
                              summary_notebook_path)
general_section_list_rsmcompare = master_section_dict['general']['rsmcompare']
general_section_list_rsmsummarize = master_section_dict['general']['rsmsummarize']


class TestReporter:

    def setUp(self):
        self.reporter = Reporter()

    def check_section_lists(self, context):
        general_sections = master_section_dict['general'][context]
        special_sections = master_section_dict['special'][context]
        overlap = set(general_sections) & set(special_sections)
        # check that there are general section
        ok_(len(general_sections) > 0)
        # check that there is no overlap between general and special section
        # list
        eq_(len(overlap), 0)

    def test_check_section_lists_rsmtool(self):
        # sanity checks to make sure nothing went wrong when generating
        # master section list
        for context in ['rsmtool', 'rsmeval', 'rsmcompare']:
            yield self.check_section_lists, context

    @raises(ValueError)
    def test_check_section_order_not_enough_sections(self):
        general_sections = ['evaluation', 'sysinfo']
        special_sections = ['placeholder_special_section']
        custom_sections = ['custom.ipynb']

# Path: rsmtool/reporter.py
# class Reporter:
#     def __init__(self, logger=None):
#     def locate_custom_sections(custom_report_section_paths, configdir):
#     def merge_notebooks(notebook_files, output_file):
#     def check_section_names(specified_sections,
#                             section_type,
#                             context='rsmtool'):
#     def check_section_order(chosen_sections, section_order):
#     def convert_ipynb_to_html(notebook_file, html_file):
#     def determine_chosen_sections(self,
#                                   general_sections,
#                                   special_sections,
#                                   custom_sections,
#                                   subgroups,
#                                   context='rsmtool'):
#     def get_section_file_map(self,
#                              special_sections,
#                              custom_sections,
#                              model_type=None,
#                              context='rsmtool'):
#     def get_ordered_notebook_files(self,
#                                    general_sections,
#                                    special_sections=[],
#                                    custom_sections=[],
#                                    section_order=None,
#                                    subgroups=[],
#                                    model_type=None,
#                                    context='rsmtool'):
#     def create_report(self,
#                       config,
#                       csvdir,
#                       figdir,
#                       context='rsmtool'):
#     def create_comparison_report(self,
#                                  config,
#                                  csvdir_old,
#                                  figdir_old,
#                                  csvdir_new,
#                                  figdir_new,
#                                  output_dir):
#     def create_summary_report(self,
#                               config,
#                               all_experiments,
#                               csvdir):
# def main():  # noqa: D103


# Path: tests/test_reporter.py
from os.path import join, normpath
from nose.tools import eq_, ok_, raises
from rsmtool.reporter import (Reporter,
                              comparison_notebook_path,
                              master_section_dict,
                              notebook_path,
                              notebook_path_dict,
                              summary_notebook_path)

general_section_list_rsmcompare = master_section_dict['general']['rsmcompare']
general_section_list_rsmsummarize = master_section_dict['general']['rsmsummarize']


class TestReporter:

    def setUp(self):
        self.reporter = Reporter()

    def check_section_lists(self, context):
        general_sections = master_section_dict['general'][context]
        special_sections = master_section_dict['special'][context]
        overlap = set(general_sections) & set(special_sections)
        # check that there are general section
        ok_(len(general_sections) > 0)
        # check that there is no overlap between general and special section
        # list
        eq_(len(overlap), 0)

    def test_check_section_lists_rsmtool(self):
        # sanity checks to make sure nothing went wrong when generating
        # master section list
        for context in ['rsmtool', 'rsmeval', 'rsmcompare']:
            yield self.check_section_lists, context

    @raises(ValueError)
    def test_check_section_order_not_enough_sections(self):
        general_sections = ['evaluation', 'sysinfo']
        special_sections = ['placeholder_special_section']
        custom_sections = ['custom.ipynb']

        subgroups = ['prompt', 'gender']