petermr / amilib

Python library of `ami` software especially NLP, HTML, downloading and related convenience utilities
Apache License 2.0
0 stars 0 forks source link

[NameError] Branch `pmr_dict` fail #23

Open nitikabaghel opened 1 month ago

nitikabaghel commented 1 month ago

System: Windows 11, Python 3.12.3

__________________________________________ PDFTest.test_make_raw_ami_pages_with_spans_from_charstream_ipcc_chap6 __________________________________________

self = <test.test_pdf.PDFTest testMethod=test_make_raw_ami_pages_with_spans_from_charstream_ipcc_chap6>

    def test_make_raw_ami_pages_with_spans_from_charstream_ipcc_chap6(self):
        """
        The central AMI method to make HTML from PDF characters

        creates spans with coordinates inside divs
        Uses AmiPage.create_html_pages() which uses AmiPage.chars_to_spans()
        creates Raw HTML

        """
        output_stem = "raw_plumber"
        page_nos = range(3, 13)
        # page_nos = [3 4 5 8 ]
        input_pdf = Path(Resources.TEST_IPCC_CHAP06_PDF)
        assert input_pdf.exists(), f"{input_pdf} should exist"
        bbox = BBox(xy_ranges=[[60, 999], [60, 790]])
        output_dir = Path(AmiAnyTest.TEMP_PDF_IPCC_CHAP06)
        AmiPage.create_html_pages_pdfplumber(bbox=bbox, input_pdf=input_pdf,
                                             output_dir=output_dir, output_stem=output_stem,
                                             range_list=[range(3, 8), range(129, 131)])
        assert output_dir.exists()
        html_file = f"{output_stem}_{5}.html"
>       logger.info(f"created HTML file {html_file}")
E       NameError: name 'logger' is not defined

test\test_pdf.py:355: NameError

================================================================= short test summary info =================================================================

FAILED test/test_pdf.py::PDFTest::test_make_raw_ami_pages_with_spans_from_charstream_ipcc_chap6 - NameError: name 'logger' is not defined

============================================ 3 failed, 221 passed, 83 skipped, 4 warnings in 182.20s (0:03:02) ============================================
petermr commented 1 month ago

My fault, missing logger. OK we'll show how to create loggers in modules.