Skip to content

Commit

Permalink
DOCS: Revert changes to use webp (#4716)
Browse files Browse the repository at this point in the history
  • Loading branch information
SMoraisAnsys authored May 23, 2024
1 parent e192d1a commit a17f1b2
Show file tree
Hide file tree
Showing 50 changed files with 58 additions and 89 deletions.
2 changes: 1 addition & 1 deletion doc/source/API/Application.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Application and solvers
The PyAEDT API includes classes for different applications available in Ansys Electronics Desktop (AEDT).
You must initialize AEDT to get access to all PyAEDT modules and methods.

.. image:: ../Resources/aedt_2.webp
.. image:: ../Resources/aedt_2.png
:width: 800
:alt: Ansys Electronics Desktop (AEDT) is a platform that enables true electronics system design.

Expand Down
2 changes: 1 addition & 1 deletion doc/source/API/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ and Mechanical solvers for comprehensive multiphysics analysis.
Tight integration among these solutions provides unprecedented ease of use for setup and
faster resolution of complex simulations for design and optimization.

.. image:: ../Resources/aedt_2.webp
.. image:: ../Resources/aedt_2.png
:width: 800
:alt: AEDT Applications
:target: https://www.ansys.com/products/electronics
Expand Down
2 changes: 1 addition & 1 deletion doc/source/Getting_started/About.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ and mechanical solvers for comprehensive multiphysics analysis.
Tight integration among these solutions provides unprecedented ease of use for setup and
faster resolution of complex simulations for design and optimization.

.. image:: ../Resources/aedt_collage.webp
.. image:: ../Resources/aedt_collage.jpg
:width: 800
:alt: AEDT Applications
:target: https://www.ansys.com/products/electronics
Expand Down
8 changes: 4 additions & 4 deletions doc/source/Getting_started/Installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ In order to do that you can:
Please note that AEDT 2023 R1 and lower requires Python 3.7 wheelhouse while AEDT 2023 R2
and higher requires the Python 3.10 wheelhouse.

.. image:: ../Resources/wheelhouse_installation.webp
.. image:: ../Resources/wheelhouse_installation.png
:width: 800
:alt: PyAEDT run script

Starting from 2023R2, buttons are available in the Automation Tab as in the example below.

.. image:: ../Resources/toolkits_ribbon.webp
.. image:: ../Resources/toolkits_ribbon.png
:width: 800
:alt: PyAEDT toolkit buttons available in AEDT

Expand All @@ -55,13 +55,13 @@ There are three options:

- Open source PyAEDT toolkits. Open source PyAEDT toolkits following the `common library <https://aedt.common.toolkit.docs.pyansys.com/>`_ standard.

.. image:: ../Resources/toolkit_manager_1.webp
.. image:: ../Resources/toolkit_manager_1.png
:width: 800
:alt: PyAEDT toolkit manager 1

The user can select the AEDT application to install the specific workflow.

.. image:: ../Resources/toolkit_manager_2.webp
.. image:: ../Resources/toolkit_manager_2.png
:width: 400
:alt: PyAEDT toolkit manager 2

Expand Down
2 changes: 1 addition & 1 deletion doc/source/Getting_started/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ and Mechanical solvers for comprehensive multiphysics analysis.
Tight integration among these solutions provides unprecedented ease of use for setup and
faster resolution of complex simulations for design and optimization.

.. image:: ../Resources/aedt_3.webp
.. image:: ../Resources/aedt_3.png
:width: 800
:alt: AEDT Applications
:target: https://www.ansys.com/products/electronics
Expand Down
Binary file added doc/source/Resources/Mesh_Operations.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/source/Resources/Mesh_Operations.webp
Binary file not shown.
Binary file added doc/source/Resources/Optimetrics_Parametric.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/source/Resources/Optimetrics_Parametric.webp
Binary file not shown.
Binary file added doc/source/Resources/Setups.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/source/Resources/Setups.webp
Binary file not shown.
Binary file added doc/source/Resources/aedt_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/source/Resources/aedt_2.webp
Binary file not shown.
Binary file added doc/source/Resources/aedt_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/source/Resources/aedt_3.webp
Binary file not shown.
Binary file added doc/source/Resources/aedt_box.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/source/Resources/aedt_box.webp
Binary file not shown.
Binary file added doc/source/Resources/aedt_collage.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/source/Resources/aedt_collage.webp
Binary file not shown.
Binary file added doc/source/Resources/aedt_first_page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/source/Resources/aedt_first_page.webp
Binary file not shown.
Binary file added doc/source/Resources/aedt_variables.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/source/Resources/aedt_variables.webp
Binary file not shown.
Binary file modified doc/source/Resources/objects_operations.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/source/Resources/pyvista_plot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/source/Resources/pyvista_plot.webp
Binary file not shown.
Binary file added doc/source/Resources/sparams.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/source/Resources/sparams.webp
Binary file not shown.
Binary file added doc/source/Resources/sparams_w_matplotlib.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/source/Resources/sparams_w_matplotlib.webp
Binary file not shown.
Binary file added doc/source/Resources/toolkit_manager_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/source/Resources/toolkit_manager_1.webp
Binary file not shown.
Binary file added doc/source/Resources/toolkit_manager_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/source/Resources/toolkit_manager_2.webp
Binary file not shown.
Binary file added doc/source/Resources/toolkits_ribbon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/source/Resources/toolkits_ribbon.webp
Binary file not shown.
Binary file added doc/source/Resources/variables_advanced.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/source/Resources/variables_advanced.webp
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/source/Resources/wheelhouse_installation.webp
Binary file not shown.
2 changes: 1 addition & 1 deletion doc/source/User_guide/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ You can initiate AEDT in non-graphical mode from Python using this code:
The preceding code launches AEDT and initializes a new Circuit design.

.. image:: ../Resources/aedt_first_page.webp
.. image:: ../Resources/aedt_first_page.png
:width: 800
:alt: AEDT launched

Expand Down
2 changes: 1 addition & 1 deletion doc/source/User_guide/mesh.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ All mesh operations are conveniently listed within the mesh object:
my_mesh_op.update()
.. image:: ../Resources/Mesh_Operations.webp
.. image:: ../Resources/Mesh_Operations.png
:width: 800
:alt: Mesh object List

Expand Down
2 changes: 1 addition & 1 deletion doc/source/User_guide/modeler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The following code creates a box and changes the color to red:
.. image:: ../Resources/aedt_box.webp
.. image:: ../Resources/aedt_box.png
:width: 800
:alt: Modeler Object

Expand Down
6 changes: 3 additions & 3 deletions doc/source/User_guide/postprocessing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To use PyAEDT to create a report in AEDT, you can follow this general structure:
hfss.post.create_report(["db(S11)", "db(S12)"])
.. image:: ../Resources/sparams.webp
.. image:: ../Resources/sparams.jpg
:width: 800
:alt: AEDT report

Expand All @@ -34,7 +34,7 @@ You can also generate reports in Matplotlib:
plt = solution.plot(solution.expressions) # Matplotlib axes object.
.. image:: ../Resources/sparams_w_matplotlib.webp
.. image:: ../Resources/sparams_w_matplotlib.jpg
:width: 800
:alt: S-Parameters report created with Matplotlib

Expand Down Expand Up @@ -97,7 +97,7 @@ PyAEDT leverages PyVista to export and plot fields outside AEDT, generating imag
)
.. image:: ../Resources/pyvista_plot.webp
.. image:: ../Resources/pyvista_plot.jpg
:width: 800
:alt: Postprocessing features

Expand Down
2 changes: 1 addition & 1 deletion doc/source/User_guide/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ essential components of the simulation process:
new_setup = m3d.create_setup("New_Setup")
.. image:: ../Resources/Setups.webp
.. image:: ../Resources/Setups.png
:width: 800
:alt: Setup Editing and Creation

6 changes: 3 additions & 3 deletions doc/source/User_guide/variables.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ for the variable name, a project-wide variable is created:
hfss["$dim"] = "1mm" # project variable
.. image:: ../Resources/aedt_variables.webp
.. image:: ../Resources/aedt_variables.png
:width: 800
:alt: Variable Management

Expand All @@ -36,7 +36,7 @@ access the ``variable_manager`` object for a more comprehensive set of functions
'34 * $PrjVar1/$PrjVar2'
.. image:: ../Resources/variables_advanced.webp
.. image:: ../Resources/variables_advanced.png
:width: 600
:alt: Variable Management

Expand All @@ -54,7 +54,7 @@ optimetrics setups by allowing you to read existing configurations, make edits,
m3d.parametrics.add("Rload", 0.1, 1, 0.1)
.. image:: ../Resources/Optimetrics_Parametric.webp
.. image:: ../Resources/Optimetrics_Parametric.png
:width: 800
:alt: Optimetrics creation

20 changes: 10 additions & 10 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# Additionally, when documenting images in formats other than the supported ones,
# make sure to specify their types.
from sphinx.builders.latex import LaTeXBuilder
LaTeXBuilder.supported_image_types = ["image/png", "image/pdf", "image/svg+xml", "image/webp" ]
LaTeXBuilder.supported_image_types = ["image/png", "image/pdf", "image/svg+xml"]

from sphinx.writers.latex import CR
from sphinx.writers.latex import LaTeXTranslator
Expand Down Expand Up @@ -139,20 +139,20 @@ def setup(app):
# extensions coming with Sphinx_PyAEDT (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.intersphinx",
"ansys_sphinx_theme.extension.linkcode",
"numpydoc",
"recommonmark",
"sphinx.ext.autodoc",
"sphinx.ext.todo",
"sphinx.ext.autosummary",
"sphinx.ext.intersphinx",
"sphinx.ext.coverage",
"sphinx_copybutton",
"sphinx_design",
"sphinx.ext.graphviz",
"sphinx.ext.mathjax",
"sphinx.ext.imgconverter",
"sphinx.ext.inheritance_diagram",
"numpydoc",
"ansys_sphinx_theme.extension.linkcode",
"recommonmark",
"sphinx.ext.intersphinx",
"sphinx.ext.mathjax",
"sphinx.ext.todo",
"sphinx_copybutton",
"sphinx_design",
]

# Intersphinx mapping
Expand Down
38 changes: 14 additions & 24 deletions pyaedt/generic/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,13 @@ def is_notebook():
bool
"""
try:
from IPython import get_ipython

shell = get_ipython().__class__.__name__
# Check if shell is Jupyter notebook or QTconsole
return shell == "ZMQInteractiveShell"
# Probably standard Python interpreter
if shell == "ZMQInteractiveShell":
return True # Jupyter notebook or qtconsole
else:
return False
except NameError:
return False
return False # Probably standard Python interpreter


def is_float(istring):
Expand Down Expand Up @@ -386,7 +385,7 @@ def plot_polar_chart(

@pyaedt_function_handler()
@update_plot_settings
def plot_3d_chart(plot_data, size=(2000, 1000), xlabel="", ylabel="", title="", snapshot_path=None, show=True):
def plot_3d_chart(plot_data, size=(2000, 1000), xlabel="", ylabel="", title="", snapshot_path=None):
"""Create a Matplotlib 3D plot based on a list of data.
Parameters
Expand All @@ -404,9 +403,6 @@ def plot_3d_chart(plot_data, size=(2000, 1000), xlabel="", ylabel="", title="",
Plot Title label.
snapshot_path : str
Full path to image file if a snapshot is needed.
show : bool, optional
Whether to render the figure. The default is ``True``. If ``False``, the
figure is not drawn.
Returns
-------
Expand Down Expand Up @@ -436,16 +432,14 @@ def plot_3d_chart(plot_data, size=(2000, 1000), xlabel="", ylabel="", title="",
fig.set_size_inches(size[0] / dpi, size[1] / dpi)
if snapshot_path:
fig.savefig(snapshot_path)
if show:
else:
fig.show()
return fig


@pyaedt_function_handler()
@update_plot_settings
def plot_2d_chart(
plot_data, size=(2000, 1000), show_legend=True, xlabel="", ylabel="", title="", snapshot_path=None, show=True
):
def plot_2d_chart(plot_data, size=(2000, 1000), show_legend=True, xlabel="", ylabel="", title="", snapshot_path=None):
"""Create a Matplotlib plot based on a list of data.
Parameters
----------
Expand All @@ -465,9 +459,6 @@ def plot_2d_chart(
snapshot_path : str, optional
Full path to image file if a snapshot is needed.
The default value is ``None``.
show : bool, optional
Whether to render the figure. The default is ``True``. If ``False``, the
figure is not drawn.
Returns
-------
Expand Down Expand Up @@ -498,7 +489,7 @@ def plot_2d_chart(

if snapshot_path:
fig.savefig(snapshot_path)
if show:
elif not is_notebook():
fig.show()
return fig

Expand Down Expand Up @@ -549,10 +540,9 @@ def plot_matplotlib(
Default is `False`.
annotations : list, optional
List of annotations to add to the plot. The format is [x, y, string, dictionary of font options].
The default is ``None``.
Default is `None`.
show : bool, optional
Whether to render the figure. The default is ``True``. If ``False``, the
figure is not drawn.
Whether to show the plot or return the matplotlib object. Default is `True`.
Returns
Expand Down Expand Up @@ -646,10 +636,10 @@ def plot_contour(
levels : int, optional
Color map levels. The default is ``64``.
snapshot_path : str, optional
Full path to save the image to. The default is ``None``.
Full path to save the image save. The default is ``None``.
show : bool, optional
Whether to render the figure. The default is ``True``. If ``False``, the
figure is not drawn.
Whether to render the figure. The default is ``True``. If
``False``, the image is not drawn.
Returns
-------
Expand Down
33 changes: 10 additions & 23 deletions pyaedt/modules/AdvancedPostProcessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,20 +340,17 @@ def plot_field_from_fieldplot(
project_path : str, optional
Path for saving the image file. The default is ``""``.
mesh_plot : bool, optional
Whether to create and plot the mesh over the fields. The
default is ``False``.
Whether to create and plot the mesh over the fields. The default is ``False``.
image_format : str, optional
Format of the image file. Options are ``"jpg"``,
``"png"``, ``"svg"``, and ``"webp"``. The default is
``"jpg"``.
Format of the image file. Options are ``"jpg"``, ``"png"``, ``"svg"``, and ``"webp"``.
The default is ``"jpg"``.
view : str, optional
View to export. Options are ``"isometric"``, ``"xy"``, ``"xz"``, ``"yz"``.
plot_label : str, optional
Type of the plot. The default is ``"Temperature"``.
plot_folder : str, optional
Plot folder to update before exporting the field.
The default is ``None``, in which case all plot
folders are updated.
The default is ``None``, in which case all plot folders are updated.
show : bool, optional
Export Image without plotting on UI.
scale_min : float, optional
Expand Down Expand Up @@ -497,9 +494,8 @@ def plot_field(
export_path : str, optional
Image export path. Default is ``None`` to not export the image.
image_format : str, optional
Format of the image file. Options are ``"jpg"``,
``"png"``, ``"svg"``, and ``"webp"``. The default is
``"jpg"``.
Format of the image file. Options are ``"jpg"``, ``"png"``, ``"svg"``, and ``"webp"``.
The default is ``"jpg"``.
keep_plot_after_generation : bool, optional
Either to keep the Field Plot in AEDT after the generation is completed. Default is ``False``.
dark_mode : bool, optional
Expand Down Expand Up @@ -811,13 +807,7 @@ def animate_fields_from_aedtplt(

@pyaedt_function_handler()
def create_3d_plot(
self,
solution_data,
nominal_sweep=None,
nominal_value=None,
primary_sweep="Theta",
secondary_sweep="Phi",
show=True,
self, solution_data, nominal_sweep=None, nominal_value=None, primary_sweep="Theta", secondary_sweep="Phi"
):
"""Create a 3D plot using Matplotlib.
Expand All @@ -833,20 +823,17 @@ def create_3d_plot(
Primary sweep. The default is ``"Theta"``.
secondary_sweep : str, optional
Secondary sweep. The default is ``"Phi"``.
show : bool, optional
Whether to render the figure. The default is ``True``. If ``False``, the
figure is not drawn.
Returns
-------
:class:`matplotlib.plt`
Matplotlib fig object.
bool
``True`` when successful, ``False`` when failed.
"""
if nominal_value:
solution_data.intrinsics[nominal_sweep] = nominal_value
if nominal_value:
solution_data.primary_sweep = primary_sweep
return solution_data.plot_3d(x_axis=primary_sweep, y_axis=secondary_sweep, show=show)
return solution_data.plot_3d(x_axis=primary_sweep, y_axis=secondary_sweep)

@pyaedt_function_handler(frames_list="frames", output_gif_path="gif_path")
def plot_scene(
Expand Down
Loading

0 comments on commit a17f1b2

Please sign in to comment.