Skip to content

Commit

Permalink
FIX: Multiple docstrings improvements (#5563)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcapodi78 authored Dec 12, 2024
1 parent 4f47c08 commit 23f68ca
Show file tree
Hide file tree
Showing 30 changed files with 1,085 additions and 1,071 deletions.
41 changes: 33 additions & 8 deletions doc/source/API/Boundaries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,49 @@ app methods and can be used to edit or delete a boundary condition.
:toctree: _autosummary
:nosignatures:

BoundaryObject
BoundaryObject3dLayout
NetworkObject
FarFieldSetup
Matrix
BoundaryObject3dLayout
common.BoundaryObject
hfss_boundary.FarFieldSetup
hfss_boundary.NearFieldSetup
q3d_boundary.Matrix
maxwell_boundary.MaxwellParameters
maxwell_boundary.MaxwellMatrix
layout_boundary.BoundaryObject3dLayout
icepak_boundary.NetworkObject

Circuit excitations
-------------------
To facilitate excitations assignment in Circuit, multiple classes have been created.

.. currentmodule:: ansys.aedt.core.modules.boundary.circuit_boundary

.. autosummary::
:toctree: _autosummary
:nosignatures:

Sources
PowerSinSource
PowerIQSource
VoltageFrequencyDependentSource
VoltageDCSource
VoltageSinSource
CurrentSinSource
Excitations

Native components
-----------------

When native components object are created, the ``NativeComponentObject`` class is returned. For PCB components, ``NativeComponentPCB`` is returned.

.. currentmodule:: ansys.aedt.core.modules.boundary.layout_boundary

.. autosummary::
:toctree: _autosummary
:nosignatures:

NativeComponentObject
NativeComponentPCB
NativeComponentObject
PCBSettingsDeviceParts
PCBSettingsPackageParts

``Native Component Object`` example:

Expand All @@ -50,14 +73,16 @@ Icepak transient assignments
----------------------------
To facilitate transient assignment handling in Icepak, it is possible to use one of the following classes:

.. currentmodule:: ansys.aedt.core.modules.boundary.icepak_boundary

.. autosummary::
:toctree: _autosummary
:nosignatures:

SinusoidalDictionary
LinearDictionary
PowerLawDictionary
ExponentialDictionary
SinusoidalDictionary
SquareWaveDictionary
PieceWiseLinearDictionary

Expand Down
2 changes: 1 addition & 1 deletion src/ansys/aedt/core/application/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def setups(self):
Returns
-------
List[:class:`ansys.aedt.core.modules.solve_setup.Setup`]
list[:class:`ansys.aedt.core.modules.solve_setup.Setup`]
Setups in the project.
"""
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/aedt/core/application/analysis_nexxim.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def sources(self):
Returns
-------
List of :class:`ansys.aedt.core.modules.boundary.circuit_boundary.Sources`
list[:class:`ansys.aedt.core.modules.boundary.circuit_boundary.Sources`]
List of sources.
"""
Expand Down
18 changes: 10 additions & 8 deletions src/ansys/aedt/core/application/design.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import sys
import threading
import time
from typing import List
import warnings

from ansys.aedt.core.application.aedt_objects import AedtObjects
Expand Down Expand Up @@ -77,8 +78,8 @@
from ansys.aedt.core.generic.general_methods import settings
from ansys.aedt.core.generic.general_methods import write_csv
from ansys.aedt.core.generic.load_aedt_file import load_entire_aedt_file
from ansys.aedt.core.modules.boundary.circuit_boundary import NetworkObject
from ansys.aedt.core.modules.boundary.common import BoundaryObject
from ansys.aedt.core.modules.boundary.icepak_boundary import NetworkObject
from ansys.aedt.core.modules.boundary.maxwell_boundary import MaxwellParameters

if sys.version_info.major > 2:
Expand Down Expand Up @@ -324,7 +325,7 @@ def project_datasets(self):
Returns
-------
Dict[str, :class:`ansys.aedt.core.application.variables.DataSet`]
dict[str, :class:`ansys.aedt.core.application.variables.DataSet`]
"""
if not self._project_datasets:
self._project_datasets = self._get_project_datasets()
Expand All @@ -336,20 +337,21 @@ def design_datasets(self):
Returns
-------
Dict[str, :class:`ansys.aedt.core.application.variables.DataSet`]
dict[str, :class:`ansys.aedt.core.application.variables.DataSet`]
"""
if not self._design_datasets:
self._design_datasets = self._get_design_datasets()
return self._design_datasets

@property
def boundaries(self):
def boundaries(self) -> List[BoundaryObject]:
"""Design boundaries and excitations.
Returns
-------
List[:class:`ansys.aedt.core.modules.boundary.common.BoundaryObject`]
list[:class:`ansys.aedt.core.modules.boundary.common.BoundaryObject`]
Boundaries available in design.
"""
bb = []
if self.oboundary and "GetBoundaries" in self.oboundary.__dir__():
Expand Down Expand Up @@ -466,7 +468,7 @@ def boundaries_by_type(self):
Returns
-------
Dict[str, :class:`ansys.aedt.core.modules.boundary.common.BoundaryObject`]
dict[str, :class:`ansys.aedt.core.modules.boundary.common.BoundaryObject`]
"""
_dict_out = {}
for bound in self.boundaries:
Expand Down Expand Up @@ -2353,7 +2355,7 @@ def _get_boundaries_data(self):
Returns
-------
List[:class:`ansys.aedt.core.modules.boundary.common.BoundaryObject`]
list[:class:`ansys.aedt.core.modules.boundary.common.BoundaryObject`]
"""
boundaries = []
if self.design_properties and "BoundarySetup" in self.design_properties:
Expand Down
9 changes: 4 additions & 5 deletions src/ansys/aedt/core/filtersolutions_core/dll_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ def _define_dll_functions(self):
self._dll.getVersion.restype = ctypes.c_int

def get_string(self, dll_function: Callable, max_size=100) -> str:
"""
Call a DLL function that returns a string.
"""Call a DLL function that returns a string.
Parameters
----------
Expand All @@ -108,13 +107,13 @@ def get_string(self, dll_function: Callable, max_size=100) -> str:
Maximum number of string characters to return. This value is used for the string buffer size.
Raises
-------
------
If there is an error in the execution of the DLL function, an exception is raised.
Returns
--------
-------
str
Return value of the called DLL function.
Return value of the called DLL function.
"""
text_buffer = ctypes.create_string_buffer(max_size)
status = dll_function(text_buffer, max_size)
Expand Down
6 changes: 3 additions & 3 deletions src/ansys/aedt/core/filtersolutions_core/export_to_aedt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1247,7 +1247,7 @@ def substrate_er(self) -> Union[SubstrateType, str]:
The value can be either a string or an instance of the ``SubstrateEr`` enum.
The default is ``9.8`` for ``SubstrateEr.ALUMINA``.
Returns:
Returns
-------
Union[SubstrateEr, str]
Expand Down Expand Up @@ -1282,7 +1282,7 @@ def substrate_resistivity(self) -> Union[SubstrateResistivity, str]:
The value can be either a string or an instance of the ``SubstrateResistivity`` enum.
The default is ``1.43`` for ``SubstrateResistivity.GOLD``.
Returns:
Returns
-------
Union[SubstrateResistivity, str]
"""
Expand Down Expand Up @@ -1315,7 +1315,7 @@ def substrate_loss_tangent(self) -> Union[SubstrateEr, str]:
The value can be either a string or an instance of the ``SubstrateEr`` enum.
The default is ``0.0005`` for ``SubstrateEr.ALUMINA``.
Returns:
Returns
-------
Union[SubstrateEr, str]
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def restore_design_goals(self):
def save_goals(self, design, file_path) -> str:
"""Save the optimization goals from a design's optimization goals table to a CSV file.
Parameters:
Parameters
----------
design: The design object containing the optimization goals table.
file_path: The path to the CSV file where the goals will be saved.
Expand All @@ -316,9 +316,10 @@ def save_goals(self, design, file_path) -> str:
def load_goals(self, file_path) -> str:
"""Load optimization goals from a CSV file into this optimization goals table.
Parameters:
Parameters
----------
file_path: The path to the CSV file from which the goals will be loaded.
file_path: str
The path to the CSV file from which the goals will be loaded.
"""
try:
with open(file_path, mode="r", newline="") as file:
Expand Down
4 changes: 2 additions & 2 deletions src/ansys/aedt/core/hfss.py
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,7 @@ def create_sbr_antenna(
Returns
-------
:class:`ansys.aedt.core.modules.layout_boundary.NativeComponentObject`
:class:`ansys.aedt.core.modules.boundary.layout_boundary.NativeComponentObject`
NativeComponentObject object.
References
Expand Down Expand Up @@ -1590,7 +1590,7 @@ def create_sbr_file_based_antenna(
Returns
-------
:class:`ansys.aedt.core.modules.layout_boundary.NativeComponentObject`
:class:`ansys.aedt.core.modules.boundary.layout_boundary.NativeComponentObject`
References
----------
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/aedt/core/hfss3dlayout.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ def create_ports_on_component_by_nets(
Returns
-------
List[:class:`ansys.aedt.core.modules.boundary.layout_boundary.BoundaryObject3dLayout`]
list[:class:`ansys.aedt.core.modules.boundary.layout_boundary.BoundaryObject3dLayout`]
Port Objects when successful.
References
Expand Down
26 changes: 13 additions & 13 deletions src/ansys/aedt/core/icepak.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@
from ansys.aedt.core.modeler.cad.elements_3d import FacePrimitive
from ansys.aedt.core.modeler.geometry_operators import GeometryOperators
from ansys.aedt.core.modeler.geometry_operators import GeometryOperators as go
from ansys.aedt.core.modules.boundary.circuit_boundary import NetworkObject
from ansys.aedt.core.modules.boundary.common import BoundaryObject
from ansys.aedt.core.modules.boundary.icepak_boundary import BoundaryDictionary
from ansys.aedt.core.modules.boundary.icepak_boundary import ExponentialDictionary
from ansys.aedt.core.modules.boundary.icepak_boundary import LinearDictionary
from ansys.aedt.core.modules.boundary.icepak_boundary import NetworkObject
from ansys.aedt.core.modules.boundary.icepak_boundary import PieceWiseLinearDictionary
from ansys.aedt.core.modules.boundary.icepak_boundary import PowerLawDictionary
from ansys.aedt.core.modules.boundary.icepak_boundary import SinusoidalDictionary
Expand Down Expand Up @@ -459,7 +459,7 @@ def create_source_blocks_from_list(self, list_powers, assign_material=True, defa
Returns
-------
List[:class:`ansys.aedt.core.modules.boundary.common.BoundaryObject`]
list[:class:`ansys.aedt.core.modules.boundary.common.BoundaryObject`]
List of boundaries inserted.
References
Expand Down Expand Up @@ -910,7 +910,7 @@ def create_network_blocks(
Returns
-------
List[:class:`ansys.aedt.core.modules.boundary.common.BoundaryObject`]
list[:class:`ansys.aedt.core.modules.boundary.common.BoundaryObject`]
List of boundary objects created.
References
Expand Down Expand Up @@ -2276,7 +2276,7 @@ def create_fan(
Returns
-------
:class:`ansys.aedt.core.modules.boundary.NativeComponentObject`
:class:`ansys.aedt.core.modules.boundary.layout_boundary.NativeComponentObject`
NativeComponentObject object.
References
Expand Down Expand Up @@ -2419,7 +2419,7 @@ def create_ipk_3dcomponent_pcb(
Returns
-------
:class:`ansys.aedt.core.modules.boundary.NativeComponentPCB`
:class:`ansys.aedt.core.modules.boundary.layout_boundary.NativeComponentPCB`
NativeComponentObject object.
References
Expand Down Expand Up @@ -4242,7 +4242,7 @@ def create_network_object(self, name=None, props=None, create=False):
Returns
-------
:class:`ansys.aedt.core.modules.boundary.BoundaryNetwork`
:class:`ansys.aedt.core.modules.boundary.icepak_boundary.NetworkObject`
Boundary network object when successful or ``None`` when failed.
References
Expand Down Expand Up @@ -6266,7 +6266,7 @@ def __create_dataset_assignment(self, type_assignment, ds_name, scale):
Returns
-------
bool or :class:`PieceWiseLinearDictionary`
bool or :class:`ansys.aedt.core.modules.boundary.icepak_boundary.PieceWiseLinearDictionary`
Created dataset condition assignments when successful, ``False`` when failed.
"""
ds = None
Expand Down Expand Up @@ -6297,7 +6297,7 @@ def create_temp_dep_assignment(self, ds_name, scale=1):
Returns
-------
:class:`ansys.aedt.core.modules.boundary.PieceWiseLinearDictionary`
:class:`ansys.aedt.core.modules.boundary.icepak_boundary.PieceWiseLinearDictionary`
Boundary dictionary object that can be passed to boundary condition assignment functions.
"""
Expand All @@ -6317,7 +6317,7 @@ def create_dataset_transient_assignment(self, ds_name, scale=1):
Returns
-------
:class:`ansys.aedt.core.modules.boundary.PieceWiseLinearDictionary`
:class:`ansys.aedt.core.modules.boundary.icepak_boundary.PieceWiseLinearDictionary`
Boundary dictionary object that can be passed to boundary condition assignment functions.
"""
Expand Down Expand Up @@ -6372,7 +6372,7 @@ def create_powerlaw_transient_assignment(self, intercept, coefficient, scaling_e
Returns
-------
:class:`ansys.aedt.core.modules.boundary.PowerLawDictionary`
:class:`ansys.aedt.core.modules.boundary.icepak_boundary.PowerLawDictionary`
Boundary dictionary object that can be passed to boundary condition assignment functions.
"""
return PowerLawDictionary(intercept, coefficient, scaling_exponent)
Expand All @@ -6399,7 +6399,7 @@ def create_exponential_transient_assignment(self, vertical_offset, coefficient,
Returns
-------
:class:`ansys.aedt.core.modules.boundary.ExponentialDictionary`
:class:`ansys.aedt.core.modules.boundary.icepak_boundary.ExponentialDictionary`
Boundary dictionary object that can be passed to boundary condition assignment functions.
"""
return ExponentialDictionary(vertical_offset, coefficient, exponent_coefficient)
Expand Down Expand Up @@ -6428,7 +6428,7 @@ def create_sinusoidal_transient_assignment(self, vertical_offset, vertical_scali
Returns
-------
:class:`ansys.aedt.core.modules.boundary.SinusoidalDictionary`
:class:`ansys.aedt.core.modules.boundary.icepak_boundary.SinusoidalDictionary`
Boundary dictionary object that can be passed to boundary condition assignment functions.
"""
return SinusoidalDictionary(vertical_offset, vertical_scaling, period, period_offset)
Expand All @@ -6453,7 +6453,7 @@ def create_square_wave_transient_assignment(self, on_value, initial_time_off, on
Returns
-------
:class:`ansys.aedt.core.modules.boundary.SquareWaveDictionary`
:class:`ansys.aedt.core.modules.boundary.icepak_boundary.SquareWaveDictionary`
Boundary dictionary object that can be passed to boundary condition assignment functions.
"""
return SquareWaveDictionary(on_value, initial_time_off, on_time, off_time, off_value)
Expand Down
Loading

0 comments on commit 23f68ca

Please sign in to comment.