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

Fix Examples documentation #4070

Merged
merged 7 commits into from
Jan 12, 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
2 changes: 1 addition & 1 deletion doc/source/User_guide/intro.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Minimal Example
Minimal example
===============

You can initiate AEDT in non-graphical mode from Python using this code:
Expand Down
4 changes: 2 additions & 2 deletions doc/source/User_guide/pyaedt_file_data/project.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Project Configuration file
Project configuration file
==========================

The project configuration file is the most comprehensive format that allows to apply a set of variables, materials,
setup, mesh and boundaries to a new project or save an existing one.
setup, mesh, and boundaries to a new project or save an existing one.
This code creates the JSON file:

.. code:: python
Expand Down
3 changes: 1 addition & 2 deletions examples/00-EDB/03_5G_antenna_example_parametrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,7 @@ def points(self):
# ~~~~~~~~~~~~~~
# Launch HFSS 3D.

h3d = pyaedt.Hfss(specified_version="2023.2",new_desktop_session=True, close_on_exit=True, solution_type="Terminal")

h3d = pyaedt.Hfss(specified_version="2023.2", new_desktop_session=True, close_on_exit=True, solution_type="Terminal")

###############################################################################
# Add the layout component
Expand Down
6 changes: 5 additions & 1 deletion examples/00-EDB/13_edb_create_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@
###########################
# Save EDB and open in AEDT
# ~~~~~~~~~~~~~~~~~~~~~~~~~

edb.save_edb()
edb.close_edb()
h3d = pyaedt.Hfss3dLayout(specified_version="2023.2", projectname=aedb_path, non_graphical=False)
h3d = pyaedt.Hfss3dLayout(specified_version="2023.2",
projectname=aedb_path,
non_graphical=False,
new_desktop_session=True)
h3d.release_desktop(False, False)
6 changes: 3 additions & 3 deletions examples/00-EDB/14_edb_create_parametrized_design.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
#############################
# Generated design parameters
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~
#

edb.auto_parametrize_design(layers=True, materials=True, via_holes=True, pads=True, antipads=True, traces=True)
edb.save_edb()
Expand All @@ -65,5 +64,6 @@
# Open project in AEDT
# ~~~~~~~~~~~~~~~~~~~~

hfss = pyaedt.Hfss3dLayout(projectname=target_aedb, specified_version=aedt_version)
hfss.release_desktop(False, False)
# Uncomment the following line to open the design in HFSS 3D Layout
# hfss = pyaedt.Hfss3dLayout(projectname=target_aedb, specified_version=aedt_version, new_desktop_session=True)
# hfss.release_desktop()
15 changes: 7 additions & 8 deletions examples/02-HFSS/Array.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@

eep_file = ffdata.eep_files
frequencies = ffdata.frequencies
working_directory = hfss.working_directory

hfss.release_desktop()

Expand Down Expand Up @@ -148,12 +149,10 @@

ffdata.polar_plot_3d(farfield_quantity='RealizedGain')

##########################################################
# Generate 3D plots in PyVista
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Generate 3D plots in PyVista. You can define the Theta and Phi
# scan angles. You can change the easy-to-use interactive plot
# that is generated on the fly.
###############################################################################
# Analyze and release
# ~~~~~~~~~~~~~~~~~~~~
# Uncomment the ``hfss.analyze`` command if you want to analyze the
# model and release AEDT.

ffdata.polar_plot_3d_pyvista(farfield_quantity='RealizedGain',
show=False)
hfss.release_desktop()
1 change: 1 addition & 0 deletions examples/02-HFSS/Flex_CPWG.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ def create_bending(radius, extension=0):
my_plot.plot(
os.path.join(hfss.working_directory, "Image.jpg"),
)

###############################################################################
# Analyze and release
# ~~~~~~~~~~~~~~~~~~~~
Expand Down
5 changes: 5 additions & 0 deletions pyaedt/desktop.py
Original file line number Diff line number Diff line change
Expand Up @@ -1437,6 +1437,11 @@ def release_desktop(self, close_projects=True, close_on_exit=True):
>>> desktop.release_desktop(close_projects=False, close_on_exit=False) # doctest: +SKIP

"""
self.logger.oproject = None
self.logger.odesign = None
if os.getenv("PYAEDT_DOC_GENERATION", "False").lower() in ("true", "1", "t"): # pragma: no cover
close_projects = True
close_on_exit = True
if close_projects:
projects = self.odesktop.GetProjectList()
for project in projects:
Expand Down
Loading