# 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)
                                   [join(summary_notebook_path, s) + '.ipynb' for s in ['evaluation']] +
                                   [join(summary_notebook_path, 'footer.ipynb')])
        eq_(notebook_files, expected_notebook_files)

    def test_get_section_file_map_rsmtool(self):
        special_sections = ['placeholder']
        custom_sections = ['/path/notebook.ipynb']
        section_file_map = self.reporter.get_section_file_map(special_sections,
                                                              custom_sections,
                                                              model_type='R')
        eq_(section_file_map['model'], join(notebook_path, 'r_model.ipynb'))
        eq_(section_file_map['notebook'], '/path/notebook.ipynb')
        eq_(section_file_map['placeholder'], normpath('special_notebook_path/placeholder.ipynb'))

    def test_get_section_file_map_rsmeval(self):
        special_sections = ['placeholder']
        custom_sections = ['/path/notebook.ipynb']
        section_file_map = self.reporter.get_section_file_map(special_sections,
                                                              custom_sections,
                                                              context='rsmeval')
        eq_(section_file_map['data_description'], join(notebook_path, 'data_description.ipynb'))
        eq_(section_file_map['notebook'], '/path/notebook.ipynb')
        eq_(section_file_map['placeholder'], normpath('special_notebook_path/placeholder.ipynb'))

    def test_get_section_file_map_rsmcompare(self):
        special_sections = ['placeholder']
        custom_sections = ['/path/notebook.ipynb']
        section_file_map = self.reporter.get_section_file_map(special_sections,
                                                              custom_sections,
                                                              context='rsmcompare')

# 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)

                                   [join(summary_notebook_path, s) + '.ipynb' for s in ['evaluation']] +
                                   [join(summary_notebook_path, 'footer.ipynb')])
        eq_(notebook_files, expected_notebook_files)

    def test_get_section_file_map_rsmtool(self):
        special_sections = ['placeholder']
        custom_sections = ['/path/notebook.ipynb']
        section_file_map = self.reporter.get_section_file_map(special_sections,
                                                              custom_sections,
                                                              model_type='R')
        eq_(section_file_map['model'], join(notebook_path, 'r_model.ipynb'))
        eq_(section_file_map['notebook'], '/path/notebook.ipynb')
        eq_(section_file_map['placeholder'], normpath('special_notebook_path/placeholder.ipynb'))

    def test_get_section_file_map_rsmeval(self):
        special_sections = ['placeholder']
        custom_sections = ['/path/notebook.ipynb']
        section_file_map = self.reporter.get_section_file_map(special_sections,
                                                              custom_sections,
                                                              context='rsmeval')
        eq_(section_file_map['data_description'], join(notebook_path, 'data_description.ipynb'))
        eq_(section_file_map['notebook'], '/path/notebook.ipynb')
        eq_(section_file_map['placeholder'], normpath('special_notebook_path/placeholder.ipynb'))

    def test_get_section_file_map_rsmcompare(self):
        special_sections = ['placeholder']
        custom_sections = ['/path/notebook.ipynb']
        section_file_map = self.reporter.get_section_file_map(special_sections,
                                                              custom_sections,
                                                              context='rsmcompare')

        eq_(section_file_map['evaluation'], join(comparison_notebook_path, 'evaluation.ipynb'))