Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New pdf report #4030

Merged
merged 9 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions _unittest/test_01_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from _unittest.conftest import local_path
import pytest

from pyaedt import pyaedt_path
from pyaedt.generic.pdf import AnsysReport

tol = 1e-12
Expand All @@ -17,8 +16,7 @@ def desktop():

class TestClass(object):
def test_create_pdf(self, local_scratch):
template_path = os.path.join(pyaedt_path, "dlls", "PDFReport", "AnsysTemplate.json")
report = AnsysReport(project_name="Coaxial", design_name="Design1", tempplate_json_file=template_path)
report = AnsysReport(project_name="Coaxial", design_name="Design1")
report.aedt_version = desktop_version
assert "AnsysTemplate" in report.template_name
report.template_name = "AnsysTemplate"
Expand All @@ -37,7 +35,7 @@ def test_create_pdf(self, local_scratch):
report.add_empty_line(2)
report.add_page_break()
report.add_image(os.path.join(local_path, "example_models", "Coax_HFSS.jpg"), "Coaxial Cable")
report.add_section("L")
report.add_section(portrait=False, page_format="a3")
report.add_table("MyTable", [["x", "y"], ["0", "1"], ["2", "3"], ["10", "20"]])
report.add_section()
report.add_chart([0, 1, 2, 3, 4, 5], [10, 20, 4, 30, 40, 12], "Freq", "Val", "MyTable")
Expand Down
5 changes: 1 addition & 4 deletions examples/06-Multiphysics/Hfss_Icepak_Coupling.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,6 @@
# Generate a pdf report with output of simultion.
report = AnsysReport(project_name=aedtapp.project_name, design_name=aedtapp.design_name,version=desktopVersion)
report.create()


report.add_section()
report.add_chapter("Hfss Results")
report.add_sub_chapter("Field Plot")
Expand All @@ -346,9 +344,8 @@
report.add_chapter("Icepak Results")
report.add_sub_chapter("Temperature Plot")
report.add_text("This section contains Multiphysics temperature plot.")

#report.add_image(os.path.join(results_folder, plot5.name+".jpg"), "Coaxial Cable Temperatures")
report.add_toc()
#report.add_image(os.path.join(results_folder, plot5.name+".jpg"), "Coaxial Cable Temperatures")
report.save_pdf(results_folder, "AEDT_Results.pdf")


Expand Down
Loading
Loading