Skip to content

Commit

Permalink
DOCS: Fix python code error in visualization report (#5437)
Browse files Browse the repository at this point in the history
  • Loading branch information
SMoraisAnsys authored Nov 18, 2024
1 parent ed3aab4 commit 780a7e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/source/API/visualization/report.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ The following code shows how to use report modules in standalone mode.
p1 = app.modeler.create_polyline(test_points)
setup = app.create_setup()
report = Fields(app=app, report_category="Fields",
report = Fields(app=app.post, report_category="Fields",
setup_name=setup.name + " : LastAdaptive",
expressions="Mag_E")
report.polyline = p1.name
Expand Down
10 changes: 7 additions & 3 deletions src/ansys/aedt/core/visualization/report/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
This module provides all functionalities for creating and editing reports.
"""
from ansys.aedt.core.generic.general_methods import pyaedt_function_handler
from ansys.aedt.core.visualization.report.common import CommonReport
from ansys.aedt.core.visualization.report.standard import Standard

Expand Down Expand Up @@ -67,10 +68,13 @@ def _context(self):


class Fields(CommonReport):
"""Provides for managing fields."""
"""Handler to manage fields."""

def __init__(self, app, report_category, setup_name, expressions=None):
CommonReport.__init__(self, app, report_category, setup_name, expressions)
@pyaedt_function_handler(
app="post_app",
)
def __init__(self, post_app, report_category, setup_name, expressions=None):
CommonReport.__init__(self, post_app, report_category, setup_name, expressions)
self.domain = "Sweep"
self.primary_sweep = "Distance"

Expand Down

0 comments on commit 780a7e0

Please sign in to comment.