Skip to content

Commit

Permalink
update available report and categories
Browse files Browse the repository at this point in the history
  • Loading branch information
gmalinve committed Jun 17, 2024
1 parent bfab942 commit 6573d85
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 14 deletions.
8 changes: 4 additions & 4 deletions pyaedt/modules/Boundary.py
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,6 @@ def __init__(self, app, name, props=None, boundarytype=None):
self.type = boundarytype
self._boundary_name = self.name
self.auto_update = True
self.CATEGORIES = CATEGORIESQ3D()

@property
def object_properties(self):
Expand Down Expand Up @@ -1470,7 +1469,7 @@ def get_sources_for_plot(
get_mutual_terms=True,
first_element_filter=None,
second_element_filter=None,
category="C",
category="L",
):
"""Return a list of source of specified matrix ready to be used in plot reports.
Expand All @@ -1485,7 +1484,7 @@ def get_sources_for_plot(
second_element_filter : str, optional
Filter to apply to second element of equation. It accepts `*` and `?` as special characters.
category : str
Plot category name as in the report. Eg. "C" is category Capacitance.
Plot category name as in the report. Eg. "L" is category Inductance.
Matrix `CATEGORIES` property can be used to map available categories.
Returns
Expand All @@ -1504,7 +1503,7 @@ def get_sources_for_plot(
if not second_element_filter:
second_element_filter = "*"
is_cg = False
if category in [self.CATEGORIES.Q3D.C, self.CATEGORIES.Q3D.G]:
if category in [self.CATEGORIESMAXWELL.Maxwell2d.L, self.CATEGORIESMAXWELL.Maxwell2d.R]:
is_cg = True
list_output = []
# params = oDesign.GetChildObject("Parameters")
Expand Down Expand Up @@ -2067,6 +2066,7 @@ def get_sources_for_plot(
>>> q3d.matrices[0].get_sources_for_plot(first_element_filter="Bo?1",
... second_element_filter="GND*", category="DCL")
"""
# DO WE REALLY NEED IT?
if not first_element_filter:
first_element_filter = "*"
if not second_element_filter:
Expand Down
36 changes: 26 additions & 10 deletions pyaedt/modules/PostProcessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -945,21 +945,21 @@ def available_display_types(self, report_category=None):

@pyaedt_function_handler()
def available_quantities_categories(
self, report_category=None, display_type=None, solution=None, context="", is_siwave_dc=False
self, report_category=None, display_type=None, solution=None, context=None, is_siwave_dc=False
):
"""Compute the list of all available report categories.
Parameters
----------
report_category : str, optional
Report Category. Default is `None` which will take first default category.
Report Category. Default is ``None`` which will take first default category.
display_type : str, optional
Report Display Type.
Default is `None` which will take first default type which is in most of the case "Rectangular Plot".
solution : str, optional
Report Setup. Default is `None` which will take first nominal_adaptive solution.
context : str, optional
Report Category. Default is `""` which will take first default context.
Report Setup. Default is ``None`` which will take first nominal_adaptive solution.
context : str, dict, optional
Report Category. Default is ``None`` which will take first default context.
is_siwave_dc : bool, optional
Whether if the setup is Siwave DCIR or not. Default is ``False``.
Expand Down Expand Up @@ -994,7 +994,14 @@ def available_quantities_categories(
"SimValueContext:=",
[37010, 0, 2, 0, False, False, -1, 1, 0, 1, 1, "", 0, 0, "DCIRID", False, id_, "IDIID", False, "1"],
]

elif self._app.design_type == "Maxwell 2D" and self._app.solution_type == "EddyCurrent":
if isinstance(context, dict):
for k, v in context.items():
context = ["Context:=", k, "Matrix:=", v]
elif context and isinstance(context, str):
context = ["Context:=", context]
elif not context:
context = ""
elif not context: # pragma: no cover
context = ""

Expand All @@ -1009,7 +1016,7 @@ def available_report_quantities(
display_type=None,
solution=None,
quantities_category=None,
context="",
context=None,
is_siwave_dc=False,
):
"""Compute the list of all available report quantities of a given report quantity category.
Expand All @@ -1026,8 +1033,10 @@ def available_report_quantities(
quantities_category : str, optional
The category to which quantities belong. It has to be one of ``available_quantities_categories`` method.
Default is ``None`` which will take first default quantity.".
context : str, optional
Report Context. Default is ``""`` which will take first default context.
context : str, dict, optional
Report Context. Default is ``None`` which will take first default context.
For Maxwell 2D Eddy Current solution types this can be provided as a dictionary
where the key is the matrix name and value the reduced matrix.
is_siwave_dc : bool, optional
Whether if the setup is Siwave DCIR or not. Default is ``False``.
Expand Down Expand Up @@ -1062,7 +1071,14 @@ def available_report_quantities(
"SimValueContext:=",
[37010, 0, 2, 0, False, False, -1, 1, 0, 1, 1, "", 0, 0, "DCIRID", False, id, "IDIID", False, "1"],
]

elif self._app.design_type == "Maxwell 2D" and self._app.solution_type == "EddyCurrent":
if isinstance(context, dict):
for k, v in context.items():
context = ["Context:=", k, "Matrix:=", v]
elif context and isinstance(context, str):
context = ["Context:=", context]
elif not context:
context = ""
elif not context:
context = ""
if not quantities_category:
Expand Down

0 comments on commit 6573d85

Please sign in to comment.