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

Migration common toolkit #193

Merged
merged 34 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f4387f8
migration first part
gmalinve Mar 13, 2024
177dfd7
customize UI
gmalinve Mar 13, 2024
7cb469f
customize UI
gmalinve Mar 13, 2024
46b8a65
Merge branch 'main' into migration
gmalinve Mar 13, 2024
02064f4
customize UI
gmalinve Mar 13, 2024
bb880c7
post-processing ui
gmalinve Mar 14, 2024
62bf2c5
post-processing ui
gmalinve Mar 14, 2024
b67c9ed
json to toml
gmalinve Apr 3, 2024
6a31986
fixes
gmalinve Apr 3, 2024
b3cd315
fixes
gmalinve Apr 3, 2024
dde0b5f
run pre-commit and update pre-commit-config.yaml
gmalinve Apr 3, 2024
699e2b0
segmentation and skew buttons
gmalinve Apr 4, 2024
b082688
improve ui and icons
gmalinve Apr 8, 2024
446b1e8
migration
gmalinve Apr 12, 2024
9d66f82
fix tests
gmalinve Apr 14, 2024
c944dbb
fix doc
gmalinve Apr 14, 2024
d0abe2c
last thing of migration + export faces
gmalinve Apr 24, 2024
fce46d2
fix tests
gmalinve Apr 24, 2024
a000632
fix common_api.rst
gmalinve Apr 27, 2024
a991946
fix doc
gmalinve Apr 27, 2024
b719536
fix examples
gmalinve Apr 27, 2024
150cb77
fix example
gmalinve Apr 28, 2024
683f234
add images
gmalinve Apr 29, 2024
1ca8b51
WIP: test conftest fix
SMoraisAnsys Apr 29, 2024
4e6986a
update toml
gmalinve Apr 29, 2024
bf95e87
Update pyproject.toml
SMoraisAnsys May 7, 2024
e58822d
WIP: Leverage toolkits-common dependencies
SMoraisAnsys May 7, 2024
a553838
fix apply_skew_test
gmalinve May 9, 2024
6fd3f31
fix test validate
gmalinve May 9, 2024
f1e1e21
FIX: Typo in README.rst
SMoraisAnsys May 9, 2024
6f48501
improve doc
gmalinve May 10, 2024
ac14e80
update toml
gmalinve May 10, 2024
cc3e94f
clean user guide
gmalinve May 10, 2024
22f836a
update run_toolkit.py
gmalinve May 10, 2024
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
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ exclude: |
(?x)(
src/ansys/aedt/toolkits/magnet_segmentation/ui/common/frontend_ui.py |
tests/input_data/.* |
examples/input_files/.*
examples/input_files/.* |
src/ansys/aedt/toolkits/magnet_segmentation/ui/windows/.*
)

repos:
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Contributing

We absolutely welcome any code contributions and we hope that this
guide will facilitate an understanding of the Magnet Segmentation Toolkit
guide will facilitate an understanding of the Magnet Segmentation ToolkitBackend
code repository. It is important to note that while the Magnet Segmentation
Toolkit software package is maintained by ANSYS and any submissions will be
ToolkitBackend software package is maintained by ANSYS and any submissions will be
reviewed thoroughly before merging, we still seek to foster a community that can
support user questions and develop new features to make this software
a useful tool for all users. As such, we welcome and encourage any
Expand Down
16 changes: 8 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Magnet Segmentation Toolkit
===========================
Magnet Segmentation ToolkitBackend
==================================

|pyansys| |PythonVersion| |GH-CI| |MIT| |black|

Expand All @@ -22,7 +22,7 @@ Magnet Segmentation Toolkit

.. reuse_start

The Magnet Segmentation Toolkit is a Python wrapper for automating the segmentation
The Magnet Segmentation ToolkitBackend is a Python wrapper for automating the segmentation
and skew of interior permanent magnet (IPM) and surface permanent magnet (SPM)
motors using Ansys Electronics Desktop (AEDT). You can launch this toolkit
from the AEDT UI or launch it directly from a Python console.
Expand All @@ -31,25 +31,25 @@ Requirements
~~~~~~~~~~~~
In addition to the runtime dependencies listed in
`Getting started <https://magnet.segmentation.toolkit.docs.pyansys.com/version/stable/Getting_started.html>`_,
the Magnet Segmentation Toolkit requires AEDT 2023 R1 or later. This toolkit also supports the AEDT
the Magnet Segmentation ToolkitBackend requires AEDT 2023 R1 or later. This toolkit also supports the AEDT
Student Version for 2023 R1 or later.

Documentation and issues
~~~~~~~~~~~~~~~~~~~~~~~~
Documentation for the latest stable release of the Magnet Segmentation Toolkit is hosted at
`Magnet Segmentation Toolkit documentation <https://magnet.segmentation.toolkit.docs.pyansys.com/version/stable/index.html>`_.
Documentation for the latest stable release of the Magnet Segmentation ToolkitBackend is hosted at
`Magnet Segmentation ToolkitBackend documentation <https://magnet.segmentation.toolkit.docs.pyansys.com/version/stable/index.html>`_.

In the upper right corner of the documentation's title bar, there is an option for switching from
viewing the documentation for the latest stable release to viewing the documentation for the
development version or previously released versions.

On the `Magnet Segmentation Toolkit Issues <https://github.com/ansys/magnet-segmentation-toolkit/issues>`_
On the `Magnet Segmentation ToolkitBackend Issues <https://github.com/ansys/magnet-segmentation-toolkit/issues>`_
page, you can create issues to report bugs and request new features. On the `Discussions <https://discuss.ansys.com/>`_
page on the Ansys Developer portal, you can post questions, share ideas, and get community feedback.

License
~~~~~~~
The Magnet Segmentation Toolkit is licensed under the MIT license.
The Magnet Segmentation ToolkitBackend is licensed under the MIT license.

This toolkit makes no commercial claim over Ansys whatsoever. The use of this toolkit
requires a legally licensed copy of AEDT. For more information, see the
Expand Down
4 changes: 2 additions & 2 deletions doc/source/Contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Use the `Magnet Segmentation Toolkit Issues <https://github.com/ansys/magnet-seg
to create issues to report bugs and request new features.

View documentation
-------------------
Documentation for the latest stable release is hosted at `Magnet Segmentation Toolkit documentation <https://magnet.segmentation.toolkit.docs.pyansys.com/version/stable/>`_.
------------------
Documentation for the latest stable release is hosted at `Magnet Segmentation Toolkit Documentation <https://magnet.segmentation.toolkit.docs.pyansys.com/version/stable/>`_.

In the upper right corner of the documentation's title bar, there is an option for switching from viewing
the documentation for the latest stable release to viewing the documentation for the development version
Expand Down
167 changes: 0 additions & 167 deletions doc/source/Getting_started.rst

This file was deleted.

66 changes: 36 additions & 30 deletions doc/source/Toolkit/api.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Toolkit API

Check warning on line 1 in doc/source/Toolkit/api.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/Toolkit/api.rst#L1

[Google.Headings] 'Toolkit API' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'Toolkit API' should use sentence-style capitalization.", "location": {"path": "doc/source/Toolkit/api.rst", "range": {"start": {"line": 1, "column": 1}}}, "severity": "WARNING"}
===========
The Toolkit API contains the ``Toolkit`` class, which provides methods for
controlling the toolkit workflow. In addition to methods for creating an AEDT
Expand All @@ -19,33 +19,39 @@

Toolkit

This code shows how to use the ``Toolkit`` class:

.. code:: python

# Import required modules and backend
from ansys.aedt.toolkits.magnet_segmentation.backend.api import Toolkit

# Initialize generic service
toolkit = Toolkit()

# Get the default properties loaded from JSON file
properties = toolkit.get_properties()

# Set properties
new_properties = {"aedt_version": "2023.2"}
toolkit.set_properties(new_properties)
properties = toolkit.get_properties()

# Launch AEDT
msg = toolkit.launch_aedt()

# Wait for the toolkit thread to be idle
toolkit.wait_to_be_idle()

# Segment and skew motor
toolkit.segmentation()
toolkit.apply_skew()

# Release AEDT
toolkit.release_aedt()
This code shows how to use the ``ToolkitBackend`` class:

.. code:: python

# Import required modules and backend
from ansys.aedt.toolkits.magnet_segmentation.backend.api import ToolkitBackend

# Initialize generic service
toolkit = ToolkitBackend()

# Get the default properties loaded from JSON file
properties = toolkit.get_properties()

# Set properties
aedt_file = os.path.join(common_temp_dir, "input_data", f"{PROJECT_NAME}.aedt")
new_properties = {
"aedt_version": "2024.1",
"non_graphical": True,
"active_project": aedt_file,
"active_design": DESIGN_NAME,
"design_list": {PROJECT_NAME: [DESIGN_NAME]},
"use_grpc": config["use_grpc"],
}
toolkit.set_properties(new_properties)

# Launch AEDT and open project
msg = toolkit.launch_aedt()
toolkit.open_project(aedt_file)
toolkit.connect_design("Maxwell3D")

# Segment and skew motor
toolkit.segmentation()
toolkit.apply_skew()

# Release AEDT
toolkit.release_aedt()
43 changes: 0 additions & 43 deletions doc/source/Toolkit/common_api.rst

This file was deleted.

7 changes: 1 addition & 6 deletions doc/source/Toolkit/index.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.. _toolkit_API_ref:

=============
API reference

Check warning on line 4 in doc/source/Toolkit/index.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/Toolkit/index.rst#L4

[Google.Headings] 'API reference' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'API reference' should use sentence-style capitalization.", "location": {"path": "doc/source/Toolkit/index.rst", "range": {"start": {"line": 4, "column": 1}}}, "severity": "WARNING"}
=============

This section provides descriptions of the two APIs available for the Magnet
This section provides descriptions of the available API for the Magnet
Segmentation Toolkit:

- **Toolkit API**: Contains the ``Toolkit`` class, which provides methods for
Expand All @@ -19,12 +19,7 @@
- For segmentation, ``SymmetryFactor`` and ``HalfAxial`` design settings must be defined.
- For skew, ``Shaft`` must be the name of the shaft.

- **AEDT Common Toolkit API**: Contains the ``AEDTCommonToolkit`` class, which provides basic
functions for controlling AEDT that are shared between the backend and frontend.
These functions are the same for all AEDT toolkits.

.. toctree::
:maxdepth: 2

api
common_api
Loading
Loading